Problem embedding new IPTC data using -profile

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
markgowdy

Problem embedding new IPTC data using -profile

Post by markgowdy »

Hello,

We use IM to update the IPTC caption data in an image, but there is a strange data duplication issues with the other fields.

I am running the latest version of IM on OS X (but the same problem happens in Windows too):

Code: Select all

Version: ImageMagick 6.5.1-3 2009-04-20 Q8
The link below is to one of the JPGs in question.
kitty.jpg (412Kb)

We first extract the profile using:

Code: Select all

convert kitty.jpg kitty.8BIMTEXT
The resulting file start like this:

Code: Select all

8BIM#1028="IPTC"
2#0="�"
2#120#Caption="Kittens at the GSPCA -  looking for a home"
2#80#Byline="Joe O'Shaughnessy"
2#5#Image Name="GSPCA kittens"
2#55#Created Date="20050430"
2#25#Keyword="Kittens"
2#25#Keyword="GSPCA"
...
...
(Notice there are only 2 keywords)

We then edit the caption line in the file 'kitty.8BIMTEXT' (we do this in java, but you can use a text editor)

Then we push the new profile back into the photo using:

Code: Select all

convert kitty.jpg -profile kitty.8BIMTEXT new_kitty.jpg
Now, if you open the file in 'Preview.app' (in OS X), the IPTC Properties says:

Code: Select all

	Byline:	Joe O'Shaughnessy
				Joe O'Shaughnessy
	Caption / Abstract:	Kittens at the GSPCA -  looking for a home
	Date Created:	20050430
	Keywords: Kittens
				GSPCA
				Kittens
				GSPCA
	Object Name:	GSPCA kittens
Notice that the Byline and the Keywords repeat themselves.

If you extract the 8BIMTEXT again, you should notice that the IPTC block is at the top, and repeated again at the bottom.

I thought it might be appending it to the data already there, but the same thing happens if you first strip the profile, before applying the updated one.

Can anyone shed light on this issue, or recommend another way to update IPTC data (especially the caption) of a jpg?

Many thanks,

Mark
markgowdy

Re: Problem embedding new IPTC data using -profile

Post by markgowdy »

*Ping*
Anyone?
I'm sure I am not the only one using this to push IPTC data back into an image.

Also, if someone is poking around the 8BIMTEXT stuff, I also noticed a small bug where the IPTC field 1:90 is being called 'City':
1#90#City="....."
1:90 identifies the 'Coded Character Set' as far as I can tell.

Thanks,

Mark
markgowdy

Re: Problem embedding new IPTC data using -profile

Post by markgowdy »

**Ping**
I think I am starting to experience abandonment issues :cry:
Has anyone even had a look at this yet?

Mark
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem embedding new IPTC data using -profile

Post by magick »

Try this command:
  • convert kitty.jpg +profile iptc -profile kitty.8BIMTEXT new_kitty.jpg
markgowdy

Re: Problem embedding new IPTC data using -profile

Post by markgowdy »

Thanks for the reply.

No luck however, the problem still persists.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem embedding new IPTC data using -profile

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.5.2-5 Beta, available sometime tomorrow. Thanks.
markgowdy

Re: Problem embedding new IPTC data using -profile

Post by markgowdy »

You guys are great !!!

Thanks,

Mark
markgowdy

Re: Problem embedding new IPTC data using -profile

Post by markgowdy »

Hello again! (This is kinda related to this old post, so I decided to append it.)

We use 'convert' (outlined in the previous postings above) to embed a new 8BIMTEXT profile into an image.
This is how we update the IPTC data in a jpg file.
This works fine, except that the new file is a bit bigger, and the image part has a different signature.
(in other words, it is generating a completetly new jpg)

Is there a way when generating the new file, to keep the original image part untouched (so it has the same signature), but to simply embed the 8BIMTEXT profile?

Kindest Regards,

Mark
markgowdy

Re: Problem embedding new IPTC data using -profile

Post by markgowdy »

**Ping** Anyone? It's been nearly a month.

To recap:
Is there a way to embed a new 8BIMTEXT profile into a jpg without re-rendering the image part of the file?
(For the purposed of injecting IPTC data, without effecting the image - so it would have the same signature)

I suspect this should be a simple (but very useful) feature.

Mark
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem embedding new IPTC data using -profile

Post by fmw42 »

I am no expert on profiles, but I believe that IM will not swap profiles without reprocessing the image. In fact, just a copy from input to output reprocess the image. But I will defer to the IM experts.
markgowdy

Re: Problem embedding new IPTC data using -profile

Post by markgowdy »

I am guessing the developers are not interested in this (which is surprising, cos it sounds like a very simple thing to do).

However, I still need to be able to write into IPTC fields without reprocessing the image.
Does anyone have any suggestions of a Java library (or preferably a command line tool) that is able to do that?

Many thanks,

Mark
markgowdy

Re: Problem embedding new IPTC data using -profile

Post by markgowdy »

Hi,
Due to an eerie silence, I decided to move this to the "Developers Forum" under "Simple Feature Request".
It should be a simple enough thing to achieve.

Thanks anyway,

Mark
Post Reply