GIMP, why 'Layer Boundary Size' always returns offsets as zero

0

I use GIMP (2.8.14), in PSD file when I select a layer its boundaries are highlighted by yellow line.

The tool Layer Boundary Size returns (correct) width and height, but offsets are always zeros.

Is there a way (or plug-in) to find these offsets?

Ome Twi

Posted 2015-09-27T03:36:36.610

Reputation: 1

This isn't a tool, in GIMP's terminology. And the dialog this menu entry pops up is only for changing the layer size and the offset is for moving it around within the resulting size. This isn't the offset to the image edges. – Michael Schumacher – 2015-09-28T11:44:50.473

Answers

0

There is the procedure gimp-drawable-offsets. If called with a layer id, it will return the offsets in x- and y-direction as a list.

Example via the Script-Fu console:

> (gimp-layer-set-offsets 2 42 23)
(#t)
> (gimp-drawable-offsets 2)
(42 23)

The first command offsets the layer with id 2 by 42 pixels in x- and 23 pixels in y-direction. The layer id is an educated guess I made; for real purposes you'd have to determine a suitable id, e.g. the currently active layer: gimp-image-get-active-layer.

The second command return the offsets as a list, in order to access them as numbers you can use the standard Scheme procedures car and cdr (and their concatenation shortcuts, such as cadr):

> (car (gimp-drawable-offsets 2))
42
> (cadr (gimp-drawable-offsets 2))
23

Michael Schumacher

Posted 2015-09-27T03:36:36.610

Reputation: 811