Commit c16af016 authored by Jon Nordby's avatar Jon Nordby Committed by Sven Neumann
Browse files

plug-ins: OpenRaster, fix wrong layer positions

Don't store layer offsets in the PNG, or honor them on loading. The layer
position is given by the OpenRaster layer attributes alone. This caused a bug
where the offsets were applied twice, positioning the layer wrong.
parent 262bfd9c
......@@ -86,7 +86,7 @@ def save_ora(img, drawable, filename, raw_filename):
def store_layer(img, drawable, path):
tmp = os.path.join(tempdir, 'tmp.png')
interlace, compression = 0, 2
png_chunks = (1, 1, 1, 1, 1) # write all PNG chunks
png_chunks = (1, 1, 0, 1, 1) # write all PNG chunks except oFFs(ets)
pdb['file-png-save'](img, drawable, tmp, 'tmp.png',
interlace, compression, *png_chunks)
orafile.write(tmp, path)
......@@ -172,7 +172,7 @@ def load_ora(filename, raw_filename):
# import layer, set attributes and add to image
gimp_layer = pdb['gimp-file-load-layer'](img, tmp)
gimp_layer.name = name
gimp_layer.translate(x, y) # move to correct position
gimp_layer.set_offsets(x, y) # move to correct position
gimp_layer.opacity = opac * 100 # a float between 0 and 100
img.add_layer(gimp_layer, layer_no)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment