Photoshop 8BIM-path information

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
User avatar
BlackCat
Posts: 3
Joined: 2014-03-17T02:28:10-07:00
Authentication code: 6789

Photoshop 8BIM-path information

Post 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?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Photoshop 8BIM-path information

Post 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.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
BlackCat
Posts: 3
Joined: 2014-03-17T02:28:10-07:00
Authentication code: 6789

Re: Photoshop 8BIM-path information

Post 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?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Photoshop 8BIM-path information

Post 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').
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
BlackCat
Posts: 3
Joined: 2014-03-17T02:28:10-07:00
Authentication code: 6789

Re: Photoshop 8BIM-path information

Post 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
Post Reply