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
inkscape messing colours on svgz
Re: inkscape messing colours on svgz
Converting SVG to SVGZ is lossless. I haven't tested saving as SVGZ in Inkscape, so I can't comment on problems with that.
No, you should just gzip it:
gzip test.svg
mv test.svg.gz test.svgz
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
Re: inkscape messing colours on svgz
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 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?
Re: inkscape messing colours on svgz
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.
Re: inkscape messing colours on svgz
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.
Re: inkscape messing colours on svgz
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.
Re: inkscape messing colours on svgz
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.