Gimp XCF export fails when exporting from an unsaved new document
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| Inkscape |
Fix Released
|
Low
|
jazzynico | ||
| inkscape (Ubuntu) |
Fix Released
|
Low
|
Unassigned | ||
Bug Description
Noticed on Windows XP and Ubuntu 10.04, Inkscape 0.47 and 0.48.
Steps:
1. Create a blank new document.
2. Use File>Save a Copy. Inkscape returns [1]
2b. Use File>Save as. Inkscape returns [2]
Related to Bug #642417 (Will not save .xcf file)? Message [2] looks like the one in comment 16.
Patch in progress.
[1]
No matching node for expression: /svg:svg/
Traceback (most recent call last):
File "gimp_xcf.py", line 185, in <module>
e.affect()
File "C:\Documents and Settings\
self.effect()
File "gimp_xcf.py", line 43, in effect
docname = self.xpathSingl
TypeError: 'NoneType' object is unsubscriptable
[2]
Traceback (most recent call last):
File "gimp_xcf.py", line 185, in <module>
e.affect()
File "C:\Documents and Settings\
self.effect()
File "gimp_xcf.py", line 179, in effect
x = open(xcf, 'r')
IOError: [Errno 2] No such file or directory: 'c:\\docume~
Confirmed (exactly as described) with inkscape_
Attached is a patch for the trunk.
Tested and working on Windows XP and Ubuntu 10.04.
(ok, due to an error, this is not a patch but the py file).
Please test and confirm!
Using the file in comment #2 with inkscape_
Save As XCF gives:
Traceback (most recent call last):
File "gimp_xcf.py", line 221, in <module>
e.affect()
File "/usr/share/
self.effect()
File "gimp_xcf.py", line 209, in effect
x = open(xcf, 'rb')
IOError: [Errno 2] No such file or directory: '/tmp/tmpEL6_Pf/New document 1.xcf'
Should I also be using the new .inx file from bug #642417?
AV> Should I also be using the new .inx file from bug #642417?
Not, it should work if you update the python file only.
Did you test with Maverick or Lucid?
I was using Maverick with the version of gimp_xcf.inx from 0.48.0
@Alex - I've reproduced your bug with Maverick, but not with Lucid. It seems that something has changed in the way temporary files are handled. If it's the case, some other extensions are very likely to be affected too.
Are you still affected if you create a document, draw a shape, save it as SVG and then export (save as or save a copy) it to XCF with this last python file?
No, the new python file works fine if I save as SVG before exporting.
Oh, I see... I didn't test my patch correctly (sorry, sorry, sorry). It should now work when the document is unsaved BUT has something to export (a shape, path, whatever fits in a layer...). If the document is completely blank, then there's nothing to export and that's the reason why the extension fails.
New fix in progress (mainly a warning message and an exit).
- gimp_xcf.py Edit (8.2 KiB, text/x-python)
Fixed extension attached (based on the trunk files). Please test!
The latest version of the extension (commenThis extension requires at least one non empty layer.t #10) appears to work as you planned it (comment #9).
Just a quick observation: when exporting an empty document, an empty "Drawing.xcf" (size 0B) is still created even though the warning message appears as planned. Is this behaviour intentional?
Oops... that should have read as follows:
The latest version of the extension (comment #10) appears to work as you planned it (comment #9).
Just a quick observation: when exporting an empty document, an empty "Drawing.xcf" (size 0B) is still created even though the warning message appears as planned. Is this behaviour intentional?
No, the empty file is not created on purpose.
AFAIK, this is a common behavior for all output type extension (I've already run into that kind of bug when debugging SVG+media exports). I don't know if it's possible to fix it from the python file, but I'd rather see the bug in the extensions implementation code (src/extension/
+ Gimp XCF export fails when exporting from an unsaved new document
Fix committed in the trunk (revision 9802) and in the 0.48.x branch (revision 9678). I've also added a fix that removes the temporary folder when the extension has finished (successfully or not) its job.
I've reproduced the empty file error with the sk1 extension, and thus I guess it's not directly related to XCF and can be reported as a separate report.
Empty file bug reported in Bug #652943 (Aborted output extensions create an empty file).
This bug was fixed in the package inkscape - 0.48.1-0ubuntu1
---------------
inkscape (0.48.1-0ubuntu1) natty; urgency=low
* New upstream version (LP: #710619). Fixes several Ubuntu bugs:
- Node editing causes segmentation fault (LP: #544599)
- Cursor position markers are not cleared from rulers (LP: #627134)
- Crashes when opening document properties (LP: #658055)
- Export to XCF error with default template (LP: #485032)
- Editing a connector in a transformed group returns it to original
position (LP: #533897)
- Ungrouping objects changes position of arrow lines (LP: #552289)
- Will not save XCF file (LP: #642417)
- XCF export fails when exporting from unsaved document (LP: #650890)
* Drop all patches: Applied upstream
* debian/rules: Disable chmod on debian/patches/* in clean rule (no patches used)
-- Alexander Valavanis <email address hidden> 2011年2月01日 12:53:34 +0000