Author Topic: IPTC info not displayed after ImageMagick conversion  (Read 6886 times)

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
IPTC info not displayed after ImageMagick conversion
« on: June 28, 2007, 09:22:05 AM »
PM 4.5.1.1 does not display the IPTC info of a jpg file that has been converted -- in this case resized -- by ImageMagick (www.imagemagick.org, this software is incorporated in many online photo gallery applications).

This problem is not unique to PM.  Nikon View and Bridge CS3 do not display the IPTC info either.  Oddly, Photoshop CS3 does display the data.

I have attached a file that should demonstrate the problem.

Deven

[attachment deleted by admin]

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25056
    • View Profile
    • Camera Bits, Inc.
Re: IPTC info not displayed after ImageMagick conversion
« Reply #1 on: June 28, 2007, 11:11:02 AM »
Deven,

PM 4.5.1.1 does not display the IPTC info of a jpg file that has been converted -- in this case resized -- by ImageMagick (www.imagemagick.org, this software is incorporated in many online photo gallery applications).

This problem is not unique to PM.  Nikon View and Bridge CS3 do not display the IPTC info either.  Oddly, Photoshop CS3 does display the data.

I have attached a file that should demonstrate the problem.

From within PM I see the following Caption:

bernabei, cole  Bib: 185  Team: SBST  Class: B7/8

and a single keyword: SBST

However, looking at the file in a hexeditor, I see a larger IPTC caption and I am trying to determine why we aren't seeing it in PM.

I'll get back to you when I have it figured out.

-Kirk

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: IPTC info not displayed after ImageMagick conversion
« Reply #2 on: June 28, 2007, 11:34:18 AM »
That is the correct info, but I do not see it in the PM 4.5.1.1 IPTC Info dialog box under Windows XP.

Deven

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25056
    • View Profile
    • Camera Bits, Inc.
Re: IPTC info not displayed after ImageMagick conversion
« Reply #3 on: June 28, 2007, 11:51:46 AM »
Deven,

That is the correct info, but I do not see it in the PM 4.5.1.1 IPTC Info dialog box under Windows XP.

You have to tell PM to use the first IPTC caption it finds if there are multiple captions.  You can do this from the IPTC/XMP tab in the Preferences dialog.  It is a popup menu near the bottom of the panel.

-Kirk

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: IPTC info not displayed after ImageMagick conversion
« Reply #4 on: June 28, 2007, 02:45:13 PM »
Yes, that solved the problem.

Thanks!

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25056
    • View Profile
    • Camera Bits, Inc.
Re: IPTC info not displayed after ImageMagick conversion
« Reply #5 on: June 28, 2007, 04:26:21 PM »
Deven,

PM 4.5.1.1 does not display the IPTC info of a jpg file that has been converted -- in this case resized -- by ImageMagick (www.imagemagick.org, this software is incorporated in many online photo gallery applications).

This problem is not unique to PM.  Nikon View and Bridge CS3 do not display the IPTC info either.  Oddly, Photoshop CS3 does display the data.

I have attached a file that should demonstrate the problem.

Dennis Walker had a chance to look at your file, and here is what he had to say:

Quote from: dennis
The second IPTC block in the second PS marker is formatted wrong.  It is supposed to have all the 8BIM "resources", each one starts with '8BIM', followed two bytes for resource ID (0x0404 for IPTC), followed by two 0 bytes, followed by a 4 byte length (Motorolla), followed by the actual resource data (which for IPTC starts with the 0x1c 0x02 or maybe 0x1c 0x01 etc).  This instead has another '8BIM' where the IPTC data is supposed to start.  Badly formatted.  From the looks of the data inside this second caption, this didn't come from Photo Mechanic (see "[#Beginning of Shooting Data Section]").

So maybe it is ImageMagick that is doing the incorrect formatting of the data, or some other application, but in any rate, I'm surprised any apps are capable of seeing the larger caption data in your image.

Do you have the image before it was manipulated via ImageMagick?

-Kirk


Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: IPTC info not displayed after ImageMagick conversion
« Reply #6 on: June 28, 2007, 05:16:05 PM »
I just realized ImageMagick is probably not the cause of the problem, but it is part of the workflow and I jumped to the conclusion that IM was at fault.

Here is the workflow:

Camera jpgs are resized for the web (800 max dimension) using ImageMagick and IPTC fields are cleared and saved in a new directory (original jpgs are preserved).

The IPTC data for the resized jpgs is created and added using a Delphi program I wrote that used this IPTC library:

http://mcguirez.homestead.com/downloads.html

I see the library has been updated so maybe the author has addressed this issue.

Attached is a copy of the jpg before the IPTC info was added, but after being resized by IM.  I suppose it is possible that IM introduced the error.  Remember, at this point the file has no IPTC info since IM both resized the image and cleared the IPTC fields.

Deven

[attachment deleted by admin]
« Last Edit: June 28, 2007, 05:19:51 PM by devenh »

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 469
    • View Profile
    • Camera Bits, Inc.
Re: IPTC info not displayed after ImageMagick conversion
« Reply #7 on: June 28, 2007, 06:17:17 PM »
Deven,

This second file also has problems.  It looks like it has the same improperly formatted Photoshop / IPTC marker that occured in the first file.  So this file doesn't NOT have IPTC, it just isn't formatted correctly.  It wouldn't surprise me if some version of PS could read this since Adobe probably gets more bad files they have to work-around than we do.

Rather than try to figure-out what other software might be running amiss here, if you could privately contact me with a (properly formatted) file before being touched by PM and a problem file after PM then I can take a look, but I suspect the problem is not PM (I can't debug other software).  It looks like it may be IM, however, attempting to "clear" the IPTC.

--dennis

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: IPTC info not displayed after ImageMagick conversion
« Reply #8 on: June 29, 2007, 04:51:26 PM »
I guess it was an ImageMagick problem after all as I went to the IM site and downloaded the latest version and that seems to have cleared things up.

Deven