Comments (17)
Original comment by [email protected]
on 17 Dec 2013 at 10:36
Attachments:
from androidsvg.
Screenshot with ok load
Original comment by [email protected]
on 17 Dec 2013 at 10:37
Attachments:
from androidsvg.
Screenshot where part of first embeded image is badly loaded (it is similar
when something loading from cache)
Original comment by [email protected]
on 17 Dec 2013 at 10:38
Attachments:
from androidsvg.
Screenshot where all embeded images were loaded "trashed"
Original comment by [email protected]
on 17 Dec 2013 at 10:38
Attachments:
from androidsvg.
Hi. Thanks for the report.
How often does this happen? Are you able to reproduce it reliably?
Original comment by [email protected]
on 17 Dec 2013 at 12:14
from androidsvg.
This happens almost any rendering time.
As I understand this effect happens first of all with big embeded images (from
10 KB - in attached svg size is approximately 60 KB), because with small images
it works fine.
I'll try to record small video at post it here.
Original comment by [email protected]
on 17 Dec 2013 at 12:54
from androidsvg.
When you say "embedded images", do you mean data-url/Base64 images? Does it
happen if the images are external to the SVG file?
Original comment by [email protected]
on 17 Dec 2013 at 12:57
from androidsvg.
Saying "embedded images" I mean images with href like this:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJkAAAC3CAIAAACOmGurAAAAA3NCSVQIC
Ajb4U/gAAAgAElEQVR4 nIy92bcmx5..."
I didn't try to use external to SVG images, so I cann't say anything about this
case.
Original comment by [email protected]
on 17 Dec 2013 at 1:21
from androidsvg.
Paul, hello!
Do you have any ideas: how to solve the problem?
Original comment by [email protected]
on 23 Dec 2013 at 6:28
from androidsvg.
Paul, hello again!
All my investigations and analysis of situation with embedded images resulted
in:
problem is in this code line of SvgAndroidRenderer:
canvas.drawBitmap(image, 0, 0, state.fillPaint);
I decided to replace it with:
state.fillPaint.setColor(0xFFFFFF00); //yellow color
canvas.drawRectangle(obj.boundingBox.toRectF(), state.fillPaint);
And everything is good.
But drawBitmap doesnot work at all.
At the same time I tested this bug on HTC One S (OS version 4.1.1) - result is:
the same situation. Some items are drawn as expected, some are drawn as trash.
Original comment by [email protected]
on 23 Dec 2013 at 8:16
from androidsvg.
Ah yes. I remember now. This is the same issue that I noticed and fixed a
couple of months ago.
The fix will be in the next release (1.3) which should be released earlier
2014. Unfortunately I can't commit a fix to the repository right now, but if
you change line 1838 to:
canvas.drawBitmap(image, 0, 0, new Paint());
things should work a lot better.
Let me know if this does work. Thanks for the work you have done investigating
this issue.
Original comment by [email protected]
on 23 Dec 2013 at 9:31
- Changed state: Accepted
from androidsvg.
Paul, thanks a lot.
But unfortunately there is no result.
The same problems exist.
Now I'll try to use external to SVG images.
Original comment by [email protected]
on 23 Dec 2013 at 10:40
from androidsvg.
As I expected, the same results for images external to SVG. Some are drawn
correctly, some no.
Paul, during investingating found out that after drawing bitmap it is necessary
to mark bitmap as recycled, so I recommend you to add one more change:
canvas.drawBitmap(image, 0, 0, new Paint());
image.recycle(); //mark as recycled
And once more change that I saw in the origin library (svg-android): before
drawing bitmap the author prepares image to be drawn using following line:
image.prepareToDraw();
So the result code is:
image.prepareToDraw();
canvas.drawBitmap(image, 0, 0, new Paint());
image.recycle();
Original comment by [email protected]
on 23 Dec 2013 at 11:34
from androidsvg.
Marking as "recycled" need to inform GC about possibility to remove bitmap from
heap.
Original comment by [email protected]
on 23 Dec 2013 at 11:35
from androidsvg.
Paul, hello again!
I've create small class PhantomView.
It has list of string - paths to images at internalSD memory (like using
external to SVG images).
Override onDraw method and tried to see the result of drawing approximately 10
images.
Everithing is OK!
So the problem lies somewhere else.
Original comment by [email protected]
on 23 Dec 2013 at 1:06
Attachments:
from androidsvg.
Could you fix it please?
Original comment by [email protected]
on 11 May 2014 at 9:47
from androidsvg.
This fix will be available in 1.2.2. A beta release of 1.2.2 is now available
on the downloads page.
Marking Fixed.
Original comment by [email protected]
on 16 Jun 2014 at 7:47
- Changed state: Fixed
from androidsvg.
Related Issues (20)
- SVG drawable alpha value is not supporated HOT 1
- Make fallback color configurable HOT 3
- Svg Color Filter
- Fhhj
- Marcoscortes1
- Look for `currentColor` in case-insensitive manner
- Handle all CSS system colors HOT 1
- This svg file, there is a problem HOT 3
- I want to need content width and height without set view box so how can i resolve this issue ?
- I want to get only drawn content of svg as picture HOT 3
- below svg is getting cut in imageview, I want to get whole svg as picture how to do it HOT 5
- SVG Rendering Issue in androidsvg Library HOT 3
- Support animated gif and webp for <image> HOT 3
- Android 14 emulator: App crashes with java.lang.SecurityException: "Writable dex file is not allowed. " HOT 2
- Release 1.5
- colrv1 asset with multi-layers HOT 2
- Text is misplaced HOT 2
- 图片放到之后有黑色边框 HOT 2
- SVG href or xlink:href not working
- Text is hidden after scaled a element
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from androidsvg.