Export to GIMP XCF (*.xcf) fails with option '--export-area-canvas'

Bug #484016 reported by su_v
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
su_v

Bug Description

Inkscape 0.46+devel r22575, OS X 10.5.8

Issue:
Exporting to GIMP XCF fails due to using the renamed (now invalid) command line option '--export-area-canvas'

Fix:
changing the script to use '--export-area-page'

Reference:
<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/CommandLine-Export.html#CommandLine-Export-Region>
 -C, --export-area-page
    Renamed from --export-area-canvas in v0.47.
    The area exported will correspond to the area defined by the page.

I could not trace back which revision renamed this option. The change is not yet mentioned in the release notes.

Tags: exporting xcf
Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Ubuntu 9.10, Inkscape revision 22575. The attached patch fixes the bug.

The extension console also complains about a python 2.6 code deprecation (os.popen3). It's only a warning, but it's very annoying.

Changed in inkscape:
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Brian (kravitz-brian) wrote :

This patch fixed the problem for me. Thanks!

Revision history for this message
su_v (suv-lp) wrote :

 'gimp_xcf.py' is the only extension in '/usr/share/inkscape/extensions' that uses '--export-area-canvas'.

The change happened in revision 22017.

ScislaC (scislac)
Changed in inkscape:
assignee: nobody → ~suv (suv-lp)
Revision history for this message
su_v (suv-lp) wrote :

@JazzyNico - the easy way would be to comment lines 167-169, the warnings still happen but are not sent back to Inkscape. Better would be to fix it like the other ones complaining about 'os.popen3()':

related: bug #387446 “Extension deprecation warnings”
another example: the updated slicing extension in bug #169985

Revision history for this message
su_v (suv-lp) wrote :

@JazzyNico - could you review and test the attached patch that uses Popen if available? It's a copy&paste job in parts from the slicing extension and compared to Alvin Penner's updated 'perspective.py'.
(I can't claim that I really understand the syntax of the different open() commands... ;-)

Revision history for this message
su_v (suv-lp) wrote :

… forgot to add: I have tested the patch with both Python 2.5.1 (osx system installation) and Python 2.6.2 (MacPorts installation) on OS X 10.5.8, exporting small files with one or two layers and guides.

Revision history for this message
jazzynico (jazzynico) wrote :

Patch tested on Ubuntu 9.10, Inkscape 0.47pre4 and Python 2.6.4 and 2.5. The file is correctly exported with no warning or error.

It's unrelated to the patch, but I've noticed an error when saving a default template as xcf without resizing it. In this case, the export script returns this error message:

Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/gimp_xcf.py", line 185, in <module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 207, in affect
    self.effect()
  File "/usr/share/inkscape/extensions/gimp_xcf.py", line 44, in effect
    pageHeight = int(self.xpathSingle('/svg:svg/@height').split('.')[0])
ValueError: invalid literal for int() with base 10: '297mm'

After resizing the page with Document properties>Fit page to selection, the size unit is removed from Height and Width attributes and everything works well.

Revision history for this message
ScislaC (scislac) wrote :

Committed the important piece in 22582. Thanks ~suv!

Changed in inkscape:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.