Git Product home page Git Product logo

Comments (17)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024

Original comment by [email protected] on 17 Dec 2013 at 10:36

Attachments:

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
Screenshot with ok load

Original comment by [email protected] on 17 Dec 2013 at 10:37

Attachments:

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
Screenshot where all embeded images were loaded "trashed"

Original comment by [email protected] on 17 Dec 2013 at 10:38

Attachments:

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
Could you fix it please?

Original comment by [email protected] on 11 May 2014 at 9:47

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 30, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.