Page 1 of 1

Photoshop 8BIM-path information

Posted: 2014-03-17T03:28:38-07:00
by BlackCat
I need to work with the "path information" which Photoshop saves into JPEG-file. Photoshop saves the paths in an image resource block. In "Adobe Photoshop File Formats Specification" (http://www.adobe.com/devnet-apps/photos ... rmatashtml) I found, that image resource ID of path information is 2000-2997.

I have read the information about the first path (acProperty contains information in XML format):

Code: Select all

acProperty := MagickGetImageProperty(mWand, '8BIM:2000,2997')
I have read the information on the second path:

Code: Select all

acProperty := MagickGetImageProperty(mWand, '8BIM:2000,2997:#2')
I changed the acProperty. Such a function call returns 1 (TRUE):

Code: Select all

MagickSetImageProperty(mWand, '8BIM:2000,2997:#1', acProperty)
MagickSetImageProperty(mWand, '8BIM:2000,2997', acProperty)
MagickSetImageProperty(mWand, '8BIM:2000,2997:#2', nil)
MagickDeleteImageProperty(mWand, '8BIM:2000,2997')  
Attempts to use MagickSetImageProperty/MagickDeleteImageProperty not cause an error, but after saving the image to disk it paths parameters does not changed. :( In the table at the bottom of the this page (http://www.imagemagick.org/script/formats.php) is specified that 8BIM supported in READ-WRITE mode.

ImageMagick-6.8.8-Q16 not support write mode for paths information? Or am I doing something wrong?

Re: Photoshop 8BIM-path information

Posted: 2014-03-17T09:23:22-07:00
by dlemstra
You will have to use MagickGetImageProfile and MagickSetImageProfile to modify the profile. MagickGetImageProperty will allow you to access the 8BIM profile values but this is a cached list of the values. Using MagickSetImageProperty will not modify the profile, it only modifies the value in the cache list.

The formats page is talking about the .8bim file. You can read and write an .8bim file.

Re: Photoshop 8BIM-path information

Posted: 2014-03-19T01:41:44-07:00
by BlackCat
Thanks for the information! MagickGetImageProfile(mWand, '8BIM', iSize) retun "'8BIM'#4#4" and iSize = 16852. If I view results MagickGetImageProfile as an array of strings, the second string is "0{щ", and the rest is or empty or nil or contain garbage :( There is an example of reading and parsing 8BIM?

Re: Photoshop 8BIM-path information

Posted: 2014-03-19T02:24:25-07:00
by dlemstra
You should download the source of Imagemagick and take a look at the code in the method Sync8BimProfile method. You can find some more information about the 8BIM profile here: http://www.adobe.com/devnet-apps/photos ... matashtml/ (scroll down to 'Image Resources Section').

Re: Photoshop 8BIM-path information

Posted: 2014-03-19T04:01:46-07:00
by BlackCat
I at once thought that I needed to look at the the source code. But thought, that it's easier to ask - I was hoping that someone has already made ​​a similar :)

P.S. Link to "Adobe Photoshop File Formats Specification" I was giving in my first message