Layers positioning in PSD file

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
ggarra13
Posts: 30
Joined: 2015-04-17T14:08:07-07:00
Authentication code: 6789

Layers positioning in PSD file

Post by ggarra13 »

I have coded a reader and viewer for the multiple layers of a PSD file using ImageMagick. All works well, except for a detail. All the layers start at coordinate 0,0. When these layers are brought in GIMP, you can see them positioned (and scaled?) somewhere else. I would like to show my layers just like Photoshop or GIMP do.
I currently cannot find any GetImage function to obtain the, I believe its called, geometry attribute.
ggarra13
Posts: 30
Joined: 2015-04-17T14:08:07-07:00
Authentication code: 6789

Re: Layers positioning in PSD file

Post by ggarra13 »

I solved it. For what its worth, the wand interface has no access to the positioning. It is needed to use the low level api. Getting an Image, the image->page.x, image->page.y, image->page.width, image->page.height contain the bounding box of the layer.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Layers positioning in PSD file

Post by magick »

> the wand interface has no access to the positioning

How 'bout MagickSetPage()?
ggarra13
Posts: 30
Joined: 2015-04-17T14:08:07-07:00
Authentication code: 6789

Re: Layers positioning in PSD file

Post by ggarra13 »

I missed MagickGetPage, but on trying it, MagickGetPage does not work. It returns all 0 to all values.

Still, I am confused. I am looking for the, in OpenEXR parlance, the data window and the display window. That is, the data window is the area where the image has information. The display window is the canvas size (the area where the data window is displayed).

For example, a ball of 32 pixels in size has a data window of 32 pixels. However, it is on a field (on another layer), which is 1024 pixels in size (the display window).

The page->x and page->width return the data window, but there's no information on the display window.
Post Reply