Page 1 of 1

Problem embedding new IPTC data using -profile

Posted: 2009-04-20T14:45:38-07:00
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

Re: Problem embedding new IPTC data using -profile

Posted: 2009-04-28T04:42:30-07:00
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

Re: Problem embedding new IPTC data using -profile

Posted: 2009-05-11T06:40:36-07:00
by markgowdy
**Ping**
I think I am starting to experience abandonment issues :cry:
Has anyone even had a look at this yet?

Mark

Re: Problem embedding new IPTC data using -profile

Posted: 2009-05-11T07:16:22-07:00
by magick
Try this command:
  • convert kitty.jpg +profile iptc -profile kitty.8BIMTEXT new_kitty.jpg

Re: Problem embedding new IPTC data using -profile

Posted: 2009-05-12T07:30:27-07:00
by markgowdy
Thanks for the reply.

No luck however, the problem still persists.

Re: Problem embedding new IPTC data using -profile

Posted: 2009-05-12T08:30:42-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.5.2-5 Beta, available sometime tomorrow. Thanks.

Re: Problem embedding new IPTC data using -profile

Posted: 2009-05-13T02:09:55-07:00
by markgowdy
You guys are great !!!

Thanks,

Mark

Re: Problem embedding new IPTC data using -profile

Posted: 2009-09-08T10:06:21-07:00
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

Re: Problem embedding new IPTC data using -profile

Posted: 2009-09-28T15:59:55-07:00
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

Re: Problem embedding new IPTC data using -profile

Posted: 2009-09-28T20:24:16-07:00
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.

Re: Problem embedding new IPTC data using -profile

Posted: 2009-10-09T02:44:58-07:00
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

Re: Problem embedding new IPTC data using -profile

Posted: 2009-10-20T08:38:33-07:00
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