omeshwar / svg-android-2

Automatically exported from code.google.com/p/svg-android-2
Apache License 2.0
0 stars 0 forks source link

Path/LinearGradient troubles in Wikipedia SVG RSS icon #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download Wikipedia RSS icon at 
http://en.wikipedia.org/wiki/File:Feed-icon.svg
2. Try to render it using svg-android-2 library

What is the expected output? What do you see instead?
The icons should render properly. An image of the render is attached, ignore 
the green background.
There is a problem with a couple of paths, the two arcs and the linear gradient 
defined is rendered black.

What version of the product are you using? On what operating system?
svgAndroid2.12Dec2011.jar, Android 2.3.5

Please provide any additional information below.

Original issue reported on code.google.com by nadie...@gmail.com on 18 Dec 2011 at 11:50

Attachments:

GoogleCodeExporter commented 8 years ago
I am seeing the linearGradient problem in my SVG as well.  The problem is that 
the patch to fix issue 6 added some code to completely ignore the <defs> 
section of the SVG.  It is not clear why this was done.  But since the <defs> 
section is ignored and the gradient is defined in the <defs> section, the 
gradient cannot be applied because it is effectively unknown to the parser.

Original comment by sc...@mobiata.com on 17 Jan 2012 at 9:21

GoogleCodeExporter commented 8 years ago
My naive solution would be to just delete all lines in the code that are 
related to the variable inDefsElement, but again, since it is not clear to me 
why that code was added in the first place, I'm not sure if that would have 
unintended consequences.

Original comment by sc...@mobiata.com on 17 Jan 2012 at 9:26

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I added that code to ignore the defs section to not draw definitions of objects 
to be drawn with "use" tags. As an example, take the europe flag on wikipedia.
The solution could be moving the "if (inDefElement) {return;}" after having 
parsed gradients.
Doing so, the file cannot be parsed because there is not the attribute 
xmlns:xlink="http://www.w3.org/1999/xlink" into the <svg> tag (I think it's an 
error in the file).
Fixing the file, the feed icon does not render at all in this case because of 
another bug: when the "style" attribute is missing there is a 
NullPointerException.
Fixing even this, the render is identical to the one you posted: the kind of 
gradient used is not yet supported.

Original comment by neclep...@gmail.com on 6 Feb 2012 at 10:41

GoogleCodeExporter commented 8 years ago
Fixes some bugs involving gradients (ignoring defs, colors with 3 digits, empty 
style tag). Still does not render wikipedia RSS icon well.

(Patch file gets confused by large code moving around, and I have an error when 
trying to suggest the patch, so I post the full file.)

Original comment by neclep...@gmail.com on 6 Feb 2012 at 11:10

Attachments: