aafigured SVGs are not rendered by evince, nautilus-thumbnailer, zim and perhaps others

Bug #529409 reported by Oliver Joos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
aafigure
Fix Released
Medium
Oliver Joos

Bug Description

The generated SVGs do not work under Ubuntu 9.10 in evince, nautilus-thumbnailer, zim and perhaps others. They do work in Firefox 3.5.8 though.

To fix this I just replace
  <svg width="100%" height="100%" version="1.1" ...
with
  <svg version="1.1" ...

I don't know if skipping width and height is valid according to SVG standard. The programs I tested may just be flexible enough to allow this. If width and height are mandatory then svg.py may also assign them in px instead of % - this also works for the programs I tested.

Related branches

Revision history for this message
luca (llucax) wrote :

As I see in the SVG specs[1] it seems like width="100%" and height="100%" are perfectly valid, so I think you should report a bug to the programs that doesn't support it.

That said, aafigure could add some option to use a different width and height specification (like omitting it) to cope with those buggy programs.

[1] http://www.w3.org/TR/SVG/struct.html#NewDocument

Revision history for this message
Oliver Joos (oliver-joos) wrote :

Thanks for checking this! I see that this bug is not in aafigure according to the standard.

So this is more a feature request: since the current aafigure always assigns "100%" it would be wise to omit it instead. This would totally fulfill the standard, which says: If the attribute (width and height) is not specified, the effect is as if a value of "100%" were specified.

Revision history for this message
luca (llucax) wrote :

That's an options.

It seems that the width and height were used before, here is a snip of the svg.py file:

        self.width = (aa_image.width+1)*aa_image.nominal_size*aa_image.aspect_ratio
        self.height = (aa_image.height+1)*aa_image.nominal_size
        if xml_header:
            self.file_like.write("""\
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="%s" height="%s" version="1.1" xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- automatically generated by aafigure -->
""" % (
                '100%', #self._num(self.width),
                '100%', #self._num(self.height)
            ))
        else:
            self.file_like.write("""<svg width="%s" height="%s" version="1.1" xmlns="http://www.w3.org/2000/svg">\n""" % (
                self._num(self.width),
                self._num(self.height)
            ))

For some reason it seems like the real image width and height is only used when an SVG without header is requested.

I don't know why this is, so I'll wait for Chris Liechti comments before doing anything...

Revision history for this message
Oliver Joos (oliver-joos) wrote :

@luca: just saw your comment after I pushed the patch. I saw the problem and left the header-less output as-is. Anyway I use my own branch. Now awaiting Chris' comment.

Revision history for this message
zsquareplusc (zsquareplusc) wrote :

Looks ok to me, change so that the header does not contain width and height. If it turns out to be required for some applications, it can be added again later as option.

Changed in aafigure:
importance: Undecided → Medium
milestone: none → 0.5
status: New → Triaged
Revision history for this message
Oliver Joos (oliver-joos) wrote :

I have committed the fix to trunk and reported the bug upstream to https://bugzilla.gnome.org/show_bug.cgi?id=612951

Changed in aafigure:
status: Triaged → Fix Committed
Changed in aafigure:
assignee: nobody → Oliver Joos (oliver-joos)
Changed in aafigure:
status: Fix Committed → 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.