writing image infos (metadate) to resized image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: writing image infos (metadate) to resized image

Post by anthony »

Usally people do not want that part of the profile automatically modified. Thye want the original information from the camera preserved or removed, not updated.
When they want it, they want the original info. (With orientation as an exception, see below)

At the moment the only way you can change any profile entry is to extract and replace the profile in IM. IM does not have a general way to -set known profile entries beyond an 'in-memory' copy of the profile.

For example, this works in-memory....

Code: Select all

   convert pagoda_sm.jpg -set exif:orientation 5 \
                  -format '%[exif:orientation]'    info:
But IM does not save the profile change into a saved image...

Code: Select all

   convert pagoda_sm.jpg -set exif:orientation 5  tmp.jpg
   identify -format '%[exif:orientation]'  tmp.jpg
The same does for ALL other profile entries.

The only profile entry IM directly modifies is EXIF:orientation, as too many programs look at this to see if they should auto-orient the image.

Also doing this in IM is stupid, unless the image was modified (resized or transformed) as to do it to just change the entry causes the image to degrade when using JPEG file format.


Alturnativally use jhead, or some other... non-lossy JPEG handlers
http://www.imagemagick.org/Usage/formats/#jpg_non_im

Jhead is particularly good for this, especially for date/time modifications, to make it more readable. Many other photo archive and web page programs also do simular things, but leave the original image alone (except comment) doing the modifications out side that original.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply