Page 1 of 1

getImageProfiles() Returns Undefined

Posted: 2014-05-17T06:24:15-07:00
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.

Re: getImageProfiles() Returns Undefined

Posted: 2014-05-17T09:35:49-07:00
by fmw42
IPTC is not a profile, but a set of properties. Profiles define color spaces. Try using getImageProperties