SetImageProfile(image,"iptc",...) doesen't work

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
jn0101
Posts: 40
Joined: 2007-06-16T01:36:07-07:00

SetImageProfile(image,"iptc",...) doesen't work

Post by jn0101 »

Dear IM folks,

when I try to clear an IPTC profile (which I have read from &image->iptc_profile - you clam backward compatibility, so that should be OK), with


RemoveImageProfile(image,"iptc");

and thereafter save the image, nothing happens, the profile is still there.

When I try
StringInfo* profile_info;
profile_info = AcquireStringInfo(infoSize);
SetStringInfoDatum(profile_info, info);
SetImageProfile(image,"iptc",profile_info);
profile_info=DestroyStringInfo(profile_info);

then the file gets a little larger (corresponding to the size of IPTC profile) but e.g. identify -verbose shows the old profile.

I suspect that this is becaurse of the two names used ("iptc" and "8bim") in the source code and becaurse of that the profile might be saved two times.

Please advice how to work around this - and if you need more info.

Jacob Nordfalk
jn0101
Posts: 40
Joined: 2007-06-16T01:36:07-07:00

Re: SetImageProfile(image,"iptc",...) doesen't work

Post by jn0101 »

Is seems that changing from
SetImageProfile(image,"iptc",profile_info);

to
SetImageProfile(image,"8bim",profile_info);

makes the IPTC profile be set correctly.

Could you please state the correct names to be used in this method call?

I would like to see http://www.imagemagick.org/api/profile.php updated to state the correct thing.

E.g. change
% o name: The profile name.

To
% o name: The profile name. Valid names are "icc", "exif" and "8bim" (for IPTC data - "iptc" should be avoided)


Thanks,
Jacob Nordfalk


% SetImageProfile() adds a named profile to the image. If a profile with the
% same name already exists, it is replaced. This method differs from the
% ProfileImage() method in that it does not apply CMS color profiles.
%
% The format of the SetImageProfile method is:
%
% MagickBooleanType SetImageProfile(Image *image,const char *name,
% const StringInfo *profile)
%
% A description of each parameter follows:
%
% o image: The image.
%
% o name: The profile name.
%
% o profile: A StringInfo structure that contains the named profile.
%
jn0101
Posts: 40
Joined: 2007-06-16T01:36:07-07:00

Re: SetImageProfile(image,"iptc",...) doesen't work

Post by jn0101 »

I repeat my request (with hopes of a reaction):
Could you please state the correct names to be used in this method call?
Thank you
Jacob Nordfalk
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: SetImageProfile(image,"iptc",...) doesen't work

Post by magick »

IPTC and 8BIM are both valid profile names. 8BIM is a container that among other things can embed an IPTC profile. So the answer is that if the IPTC profile is within a 8BIM container, use "8BIM". If the IPTC profile is a pure IPTC profile with no wrapper, use "IPTC".
Post Reply