Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path/LinearGradient troubles in Wikipedia SVG RSS icon #7

Open
GoogleCodeExporter opened this issue Mar 15, 2015 · 5 comments
Open

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 18 Dec 2011 at 11:50

Attachments:

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 17 Jan 2012 at 9:21

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 17 Jan 2012 at 9:26

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 6 Feb 2012 at 10:41

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 6 Feb 2012 at 11:10

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant