[gimp] plug-ins: openraster: Ignore the x, y values of layer groups (bug 760348)
- From: Daniel Sabo <daniels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: openraster: Ignore the x, y values of layer groups (bug 760348)
- Date: Wed, 23 Mar 2016 19:00:40 +0000 (UTC)
commit f10067e560fd5b33104bdb680be1a9a1c7458d65
Author: Daniel Sabo <DanielSabo gmail com>
Date: Sat Jan 9 21:56:06 2016 -0800
plug-ins: openraster: Ignore the x,y values of layer groups (bug 760348)
Neither MyPaint or Krita sets these values when saving, and when
loading they have conflicting interpretations such that the only
universally valid value will be zero.
plug-ins/pygimp/plug-ins/file-openraster.py | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/plug-ins/pygimp/plug-ins/file-openraster.py b/plug-ins/pygimp/plug-ins/file-openraster.py
index c6b2949..b08b9f0 100755
--- a/plug-ins/pygimp/plug-ins/file-openraster.py
+++ b/plug-ins/pygimp/plug-ins/file-openraster.py
@@ -69,14 +69,12 @@ def get_layer_attributes(layer):
def get_group_layer_attributes(layer):
a = layer.attrib
name = a.get('name', '')
- x = int(a.get('x', '0'))
- y = int(a.get('y', '0'))
opac = float(a.get('opacity', '1.0'))
visible = a.get('visibility', 'visible') != 'hidden'
m = a.get('composite-op', 'svg:src-over')
layer_mode = layermodes_map.get(m, NORMAL_MODE)
- return name, x, y, opac, visible, layer_mode
+ return name, 0, 0, opac, visible, layer_mode
def thumbnail_ora(filename, thumb_size):
# FIXME: Untested. Does not seem to be used at all? should be run
@@ -156,16 +154,12 @@ def save_ora(img, drawable, filename, raw_filename):
a['composite-op'] = reverse_map(layermodes_map).get(gimp_layer.mode, 'svg:src-over')
return layer
- def add_group_layer(parent, x, y, opac, gimp_layer, visible=True):
+ def add_group_layer(parent, opac, gimp_layer, visible=True):
# create layer attributes
group_layer = ET.Element('stack')
parent.append(group_layer)
a = group_layer.attrib
a['name'] = gimp_layer.name
- if x:
- a['x'] = str(x)
- if y:
- a['y'] = str(y)
a['opacity'] = str(opac)
a['visibility'] = 'visible' if visible else 'hidden'
a['composite-op'] = reverse_map(layermodes_map).get(gimp_layer.mode, 'svg:src-over')
@@ -203,7 +197,7 @@ def save_ora(img, drawable, filename, raw_filename):
parent = stack if not parent_groups else parent_groups[-1][0]
if isinstance(lay, gimp.GroupLayer):
- group = add_group_layer(parent, x, y, opac, lay, lay.visible)
+ group = add_group_layer(parent, opac, lay, lay.visible)
group_path = ("{:03d}".format(i) if not parent_groups else
parent_groups[-1][1] + "-{:03d}".format(parent_groups[-1][2]))
parent_groups.append([group, group_path , 0])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]