Jump to content

iptcembed -orphan images


richardmorton

Recommended Posts

When I make dynamic thumbnails, they are produced as orphans (ie they have no metadata).  I am familiar with ways to get IPTC or EXIF data into such thumbnails if you go and actually write the file to disc, however I have more specific problem related to making them dynamically.  Below is a snippet of code  that is currently being used

 

// details of orig image

list($width, $height) = getimagesize($file);

// Resizing the Image (make up new modwith and modheight)

$tn = imagecreatetruecolor($modwidth, $modheight);

$image = imagecreatefromjpeg($file);

imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width,

$height);

// Outputting a .jpg,

imagejpeg($tn, null, 80);

What I would like to do is insert some IPTC headers into this exact process without changing the input or output - so the pseudocode for the revised  module would be

 

 

// details of orig image

list($width, $height) = getimagesize($file);

=== GET THE IPTC HEADERS FROM THE ORIGINAL  HERE =========

// Resizing the Image

$tn = imagecreatetruecolor($modwidth, $modheight);

$image = imagecreatefromjpeg($file);

imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width,

$height);

==RE-INSERT THESE IPTC HEADERS  =====

// Outputting a .jpg,

imagejpeg($tn, null, 80);

 

If anyone could help that would be most appreciated.  As regards getting the IPTC headers, clearly the php command iptcparse is the one, however I cannot get iptcembed to work.  Many thanks

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.