inkscape messing colours on svgz

Discuss SVG code, accessible via the XML Editor.
Jack the plotter

inkscape messing colours on svgz

Postby Jack the plotter » Wed Apr 09, 2008 7:57 am

Hi,

I wanted to save an svg as svgz and tried with inkscape. First of all I was taken aback by a warning about the format losing data (when I later wanted to close the image).

since neither svg nor gzip are lossy I could not understand and guessed it was a spurious warning.

However, when I reopened the image in Opera and again with inkscape the colours had got messed up. The image itself seemed intact.

Is this a known issue?

Is it possible to create a svgz ?

I tried
tar -czf test.svgz test.svg

and the result was about 25% as expected but opera choked on the first line.

Is that not the way to do it?

TIA

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: inkscape messing colours on svgz

Postby sas » Wed Apr 09, 2008 8:22 am

Converting SVG to SVGZ is lossless. I haven't tested saving as SVGZ in Inkscape, so I can't comment on problems with that.

Jack the plotter wrote:Is that not the way to do it?

No, you should just gzip it:

gzip test.svg
mv test.svg.gz test.svgz

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: inkscape messing colours on svgz

Postby microUgly » Wed Apr 09, 2008 9:24 am

Jack the plotter wrote:I wanted to save an svg as svgz and tried with inkscape. First of all I was taken aback by a warning about the format losing data (when I later wanted to close the image).

That's because you saved as "Compressed plain SVG". Saving as plain SVG strips all the information Inkscape uses to better manage objects. For example, if you draw a 3D Cube with :tool_3dbox: and save as plain SVG, when you reopen the file you won't be able to edit the cube like you could if you saved as Inkscape SVG.

Jack the plotter wrote:However, when I reopened the image in Opera and again with inkscape the colours had got messed up. The image itself seemed intact.

That doesn't sound good. Are you able to reproduce this? Perhaps save as both Inkscape SVG and one as Compressed plain SVG and post the files here for comparison?

jack the plotter

Re: inkscape messing colours on svgz

Postby jack the plotter » Sat Apr 12, 2008 10:53 pm

No, you should just gzip it:


well according to man tar that's exactly what the -z option does.

-z, --gzip, --gunzip, --ungzip
filter the archive through gzip

However using gzip does provide a readable svgz, unfortunately it destroys the original in doing so. Can anyone see why tar is not giving the output I expect?

Thanks for the info, I should have tried gzip directly but I had confidence in tar. Using tar would be preferable in several ways though.

That's because you saved as "Compressed plain SVG". Saving as plain SVG strips all the information Inkscape uses to better manage objects.


Well , hang on, colour definitions are not "optional extras" maintained by inkscape they are part of my data! I have compressed the same image using gzip and don't get the colours screwed.

Looks like an ugly bug to me if inkscape it's throwing this data out. May it strips out some objects that it didn't ought to .

Thanks for your replies.

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: inkscape messing colours on svgz

Postby sas » Sat Apr 12, 2008 11:35 pm

jack the plotter wrote:
No, you should just gzip it:

well according to man tar that's exactly what the -z option does.

-z, --gzip, --gunzip, --ungzip
filter the archive through gzip

No, that's saying that the -z option gzips the tar archive. You need to gzip the SVG file (not a tar archive containing the SVG file).

However using gzip does provide a readable svgz, unfortunately it destroys the original in doing so.

You could make a simple shell script that copies the SVG file and gzips the copy.

That's because you saved as "Compressed plain SVG". Saving as plain SVG strips all the information Inkscape uses to better manage objects.

Well , hang on, colour definitions are not "optional extras" maintained by inkscape they are part of my data! I have compressed the same image using gzip and don't get the colours screwed.

Looks like an ugly bug to me if inkscape it's throwing this data out. May it strips out some objects that it didn't ought to .

It's a bug if the colours change when saving as SVGZ. You can reports bugs on Launchpad, but you'll need to provide an example SVG file for which this happens, otherwise it's unlikely that anyone will be able to track the bug down.

Guest

Re: inkscape messing colours on svgz

Postby Guest » Sun Apr 13, 2008 10:02 am

No, that's saying that the -z option gzips the tar archive. You need to gzip the SVG file (not a tar archive containing the SVG file).


Ah, thanks, I was looking at this backwards. All makes sense now.

You could make a simple shell script that copies the SVG file and gzips the copy.


Bit clunky. I found a clean solution:

gzip -c test.svg > test.svgz ;)

Thx.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: inkscape messing colours on svgz

Postby microUgly » Mon Apr 14, 2008 9:14 am

jack the plotter wrote:
That's because you saved as "Compressed plain SVG". Saving as plain SVG strips all the information Inkscape uses to better manage objects.

Well , hang on, colour definitions are not "optional extras" maintained by inkscape they are part of my data!

I wasn't suggesting it was. I was simplying explaining what the warning meant.


Return to “SVG / XML Code”