Page 1 of 1

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

Posted: 2008-01-17T09:09:32-07:00
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

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

Posted: 2008-01-17T23:52:01-07:00
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.
%

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

Posted: 2008-01-24T23:47:36-07:00
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

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

Posted: 2008-01-25T07:11:22-07:00
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".