saves svg file, that it can't read afterwards

Bug #499257 reported by Tomas Pospisek
122
This bug affects 18 people
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Medium
Unassigned
Declined for 0.47.x by Qantas94Heavy
Declined for 0.48.x by Qantas94Heavy
Declined for 0.91.x by Qantas94Heavy
Declined for Old by Qantas94Heavy
inkscape (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: inkscape

$ lsb_release -rd
Description: Ubuntu 9.10
Release: 9.10

$ dpkg -s inkscape | grep Version
Version: 0.47~pre4-0ubuntu1

Loading attached file in inkscape results in:

$ inkscape Rubin-mit-Schnee.svg
Rubin-mit-Schnee.svg:2588: parser error : Input is not proper UTF-8, indicate encoding !
Bytes: 0xFF 0x22 0x20 0x69
   id="metadata3"><?xpacket begin="�" id="W5M0MpCehiHzreSzNTczkc9d"?>

However, that file was written by inkscape itself and not modified manually by myself after.

I think the problem was caused by myself adding metadata to the file (from within inkscape)
that contain non-ascii characters, since that was more or less the only thing I remember I
did after loading the file in inkscape (when it still worked) and before saving it. After saving
it inkscape was not able to read it any more.

*t

PS: after replacing the character displayed above in the error message with a random ascii
      character, inkscape was able to load the image with no problem.

Tags: encoding
Revision history for this message
Tomas Pospisek (tpo-deb) wrote :
Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Thanks for reporting this bug. I can confirm that the file will not open (using the same Ubuntu & Inkscape versions as you) and that replacing the non-ascii character allows the file to be opened.

How did you edit the metadata? Did you directly enter it using the XML editor in Inkscape or did you use File->Document Metadata?

Changed in inkscape (Ubuntu):
status: New → Incomplete
Changed in inkscape:
status: New → Incomplete
Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Windows XP, Inkscape 0.47, but I'm quite sure it's possible to reproduce it on Ubuntu.

Steps:
1. Open Tomas' attached file with a text editor and replace encoding="UTF-8" with encoding="ISO-8859-1" .
2. Open the file with Inkscape.
3. Save it.
4. Open it again in a text editor: encoding is back to UTF-8.

I think that your original AI file was ISO encoded. That's the reason why you've been able to open and modify it once.
The issue is not that Inkscape doesn't open the file, but that it changes its encoding.
Inkscape fails to open the file because in <?xpacket begin="ÿ" id="W5M0MpCehiHzreSzNTczkc9d"?> (line 2588), ÿ is not UTF-8 encoded.

Could you please confirm (or attach the original AI exported file)?

Changed in inkscape:
importance: Undecided → Medium
status: Incomplete → Confirmed
Revision history for this message
Tomas Pospisek (tpo-deb) wrote :

Alex Valavanis wrote:

> How did you edit the metadata? Did you directly enter it using the XML editor
> in Inkscape or did you use File->Document Metadata?

I used File->Document Metadata

Revision history for this message
jazzynico (jazzynico) wrote :

Bug #394472 (Wrong characters in imported PDF) is very close to this one.

Revision history for this message
Tomas Pospisek (tpo-deb) wrote :

JazzyNico wrote:

> I think that your original AI file was ISO encoded. That's the reason why you've been
> able to open and modify it once.
> The issue is not that Inkscape doesn't open the file, but that it changes its encoding.
> Inkscape fails to open the file because in
> <?xpacket begin="ÿ" id="W5M0MpCehiHzreSzNTczkc9d"?> (line 2588), ÿ is
> not UTF-8 encoded.
>
> Could you please confirm (or attach the original AI exported file)?

I started with this AI file:

   http://commons.wikimedia.org/wiki/File:Ruby_logo.svg

which claims that it's UTF-8 encoded. The line that gives an error above looks like this in it:

  <?xpacket begin="<U+FEFF>" id="W5M0MpCehiHzreSzNTczkc9d"?>

"<U+FEFF>" the byte sequence of that is 0xef 0xbb 0xbf.

Inkscape will transform that into a single 0xff byte (which is represented as "ÿ" when reported as error on the console) when saving the file.

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

similar issue: bug #369861 in Inkscape: “Unable to open previously imported pdf file”

Revision history for this message
sk750 (sk750) wrote :

Same issue affects me.

With Inkscape 0.46 under Win XP32 I remember it worked.

Now I'm using Inkscape 0.47 under Win 7 64 bit and can't reopen the modified svgs
before manually removing the special character.

One of the affected (not yet by Inkscape changed) svg's is at:
http://gpsmid.cvs.sourceforge.net/viewvc/gpsmid/GpsMid/resources/images/icon/main/i_back.svg

Changed in inkscape (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Marco Lackovic (marco-lackovic) wrote :

I had the same problem with Inkscape 0.47 and Ubuntu 10.04.

- downloaded UbuntuLogo.svg from https://wiki.ubuntu.com/Artwork/Official
- installed Ubuntu logo by running "sudo apt-get install ttf-ubuntu-title"
- opened UbuntuLogo.svg with Inkscape 0.47
- removed the Ubuntu name and changed it to something else using the ubuntu title font
- saved to another svg file
- closed Inkscape
- tried to open the saved svg file and got the error message "failed to load the requested file"

I solved it by removing all <?xpacket [...] ?> tags.

su_v (suv-lp)
tags: added: encoding
Revision history for this message
JBENNET (jbennet) wrote :

Same problem when importing .PDF files in ubuntu inkscape 0.47 ; saving to SVG ; reloading file. It worked with last year's version. Inkscape seems to produce bad .xml output encoding, shall be trivial to fix... maybe I should be upgrading now.

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

See also most recent duplicate
Bug #675170 “Exported Illustrator SVG with XMP results in xpacket encoding problem in Inkscape”
<https://bugs.launchpad.net/inkscape/+bug/675170>

for a precise description and minimal test case (saving an empty Illustrator CS3 document (SVG with XMP export) in Inskcape results in a broken SVG file with improper encoding: "Input is not proper UTF-8, indicate encoding").

Changed in inkscape (Ubuntu):
importance: Undecided → Low
Changed in inkscape (Ubuntu):
status: Confirmed → Triaged
Changed in inkscape:
status: Confirmed → Triaged
Revision history for this message
Adrien Cordonnier (adrien-cordonnier) wrote :

The bug can be reproduced by creating a brand new svg file. This is not related to imported files:

1) open Inkscape (0.48 in my case)
2) choose menu/File/Save as
3) input non ascii characters in title field such as "Réseau"
4) close Inkscape
5) Inkscape fails to open the file
6) Google Chrome fails to open the file and gives error position on the first non-ascii character

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

@Adrien - you talk about a Windows-specific issue which is tracked in
Bug #576126 “[win XP] cannot open file with non-ASCII chars in Save-as Title field”.
(Only the native dialogs used in Inkscape on Windows have a 'Title' field)

Revision history for this message
Brian Cleary (bpcleary) wrote :

Added a bug that duplicates this, so here is what I said there. I think it's worth keeping the issue alive this way because I can't imagine most users will open the SVG file in a text editor to fix the file after each save.

------

Reproduction:
1. Open SVG file created using AI SVG export plugin.
2. Change document size in File > Document Properties (e.g. +1px to width) and save.
File is now broken because a non-UTF-8 character has been included in an xpacket tag.

Ver: Inkscape 0.48.2 r9819 in XQuartz 2.7.2 (xorg-server 1.12.2) on MacOS 10.8

Does not appear to affect SVG files created in Inkscape.

Revision history for this message
neo (tkolodziejski) wrote :

Probably same problem here. I'm adding non-ascii attributes and opening and saving Inkscape no longer can open it.

Inkscape 0.48.3.1 r9886, Linux arch 3.5.3-1-ARCH

Revision history for this message
Jacob Certain (jace42) wrote :

I can replicate with bpcleary's steps. My svg had a funky character that looked like a Y. Replaced it with a Y and got on with things.

% inkscape --version
Inkscape 0.48.3.1 r9886 (Nov 1 2012)

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

Apparently the changes in revision 12510
 <http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/12510>
allow current trunk at least to load affected files, despite warning about "not proper UTF-8".

Not closing the report - the corruption on save still occurs (tested on Ubuntu 13.04 with r12699 and on OS X 10.7.5 with r12670).

Revision history for this message
Jeff (burdges) wrote :

I've confirmed this bug on Mac OS X 10.9.5 with Inkscape versions 0.48.5_6 and 0.91.99.13797 via MacPorts as well as 0.48.5, 0.91 Pre3, and 0.91+devel-r13822 via the .dmg's distributed at inkscape.org.

/Cloud/OSS/go/src/github.com/agl/pond/icons/pond-icon-blob-1.svg:141: parser error : Input is not proper UTF-8, indicate encoding !
Bytes: 0xFF 0x22 0x20 0x69
     id="metadata4"><?xpacket begin="?" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmet

All the relevant files are in this pull request if you want to see them : https://github.com/agl/pond/pull/153

I've reproduced the errors both when saving as an Inkscape .svg file and when saving as a plain .svg file. Also, originally the .svg file was created with Adobe Illustrator, but while Adobe's .svg file is readable from Mac OS X's Preview, none of the Inkscape .svg files are.

Revision history for this message
Jeff (burdges) wrote :

I can also confirm that replacing the funky y aka ? in begin="?" with a y fixes the issue. In fact, Mac OS X still doesn't display one element from that .svg file, but that's probably due to gradients or fuzziness. At least now Chrome and FireFox display it properly, which they did not before.

I've now committed the fix to that pull request but the original bad .svg created by Inkscape is here :
https://github.com/burdges/pond/commit/18cdb4e86666ec7c22eba2c5068ed48dc2ec4b4f

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.