getImageProfiles() Returns Undefined

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
zyggiepyggie
Posts: 1
Joined: 2014-05-17T06:16:12-07:00
Authentication code: 6789

getImageProfiles() Returns Undefined

Post by zyggiepyggie »

Hi,

I'm attempting to get the IPTC data from an image. If I run the following CLI command: identify -verbose image_file.jpg

I get the following profiles back (amongst all the other metadata):

Code: Select all

Profiles:
    Profile-8bim: 1734 bytes
    Profile-exif: 7841 bytes
    Profile-icc: 3144 bytes
    Profile-iptc: 186 bytes
      City[1,90]: 0x00000000: 254700                                        -%
      unknown[2,0]: 
      Caption[2,120]: A caption for the image
      Image Name[2,5]: My Image
      Created Date[2,55]: 20140510
      Keyword[2,25]: tag:My Tag
      Keyword[2,25]: tag: My Tag
      Copyright String[2,116]: COPYRIGHT
      Created Time[2,60]: 195101
      unknown[2,62]: 20140510
      unknown[2,63]: 195101
    Profile-xmp: 9752 bytes
However, upon running getImageProfiles() in PHP it simply returns 'undefined' and I can't figure out why. I also attempted grabbing the data with getImageProfile('Profile-iptc'), which returns the following ImageMagick Expeption: 'Can not get image profile'.

Any help would be really appreciated.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: getImageProfiles() Returns Undefined

Post by fmw42 »

IPTC is not a profile, but a set of properties. Profiles define color spaces. Try using getImageProperties
Post Reply