Photoshop image resource blocks
Posted: 2010-10-08T21:49:29-07:00
I am attempting to write a set of subroutines which are capable of manipulating the proprietary Photoshop paths stored in the IRBs of images saved by Photoshop. The relevant IDs are between 0x07D0 and 0x0BB6, with selector values of 1 or 2 (closed subpath bezier knots). The minimal documentation I've been able to locate seems to indicate that these records contain 3 quadwords describing control and anchor points, which are further subdivided into two dwords describing the vertical and horizontal components. My documentation states that these dwords are fixed-point values with 8 bits before the binary point and 24 bits after the binary point. I see that ImageMagick can already handle this: the following command will output an SVG describing the 8BIM embedded path named PATH_NAME:
identify -format '%[8BIM:1999,2998:PATH_NAME]' some_image.jpg
The problem I'm having is that I can't locate the code which actually does this conversion and I don't understand the data format that the individual dwords are stored in. Initially I thought I might be able to just use gcc's _Decimal32, but that appears not to be the case. Can anyone describe how to understand / decode these values, or point me to the code in ImageMagick which does so?
identify -format '%[8BIM:1999,2998:PATH_NAME]' some_image.jpg
The problem I'm having is that I can't locate the code which actually does this conversion and I don't understand the data format that the individual dwords are stored in. Initially I thought I might be able to just use gcc's _Decimal32, but that appears not to be the case. Can anyone describe how to understand / decode these values, or point me to the code in ImageMagick which does so?