Recent

Author Topic: BGRABitmap SVG rendering errors?  (Read 4177 times)

fatmonk

  • Sr. Member
  • ****
  • Posts: 252
BGRABitmap SVG rendering errors?
« on: May 22, 2017, 01:56:45 pm »
The attached is my test project for trying to get BGRABitmap SVGA rendering working for another project.

In another thread I posted a version of this project that used a couple of SVGs files that worked (from another post in this forum), but my own fairly simple SVGs are not working at all.

Note that these SVGs were created with InkScape, saved as plain SVG (ie no InkScape specific stuff) and they open correctly in Internet Explorer. PaintShop Pro, however, claims they are not valid SVG files.

The attached project loads the SVGs from a text string converted to a stream - something I proved to work in my other thread - so that everything is in a self contained project. Note that I have tested with the SVG images contained in separate files (just save the text strings out to a .svg file to try that and mod the code to read from the file rather than the string).

The four buttons load each of four images. They are all derivatives of a clock and should consist of a circle or part circle with markers at the 1-12 positions in most cases. Some have pointers, some have arrows. (I have also included the .svg files here in a separate .zip for reference, but they are not needed for the project).

Is this a bug in the BGRABitmap rendering, an incompatibility (something not yet supported by BGRABitmap) or a bug in InkScape's SVGA save format?

Thanks,

FM

Phoenix

  • Jr. Member
  • **
  • Posts: 87
Re: BGRABitmap SVG rendering errors?
« Reply #1 on: June 02, 2017, 05:31:07 pm »
Hello,
I also got the same result. The image is loaded but displayed incorrectly. I do not think svg format is fully supported but can also be a bug.
Using Opera, the files are displayed correctly so unlikely an issue with Inkscape.
If you want, you can report it through:
https://github.com/bgrabitmap/bgrabitmap/issues
So the @circular author will receive an email.

fatmonk

  • Sr. Member
  • ****
  • Posts: 252
Re: BGRABitmap SVG rendering errors?
« Reply #2 on: June 05, 2017, 12:10:51 pm »
I have found a workaround...

I opened the Inkscape generated SVGs in Libre Office Draw and re-saved them.

Copying the XML from the Draw saved file and using this in Lazarus works perfectly.

Unfortunately LO Draw also saves a load of extra unnecessary info in the SVG - bullet style definitions etc, presumably used by Draw itself - which makes the XML a bit bloated, but that was easy enough to strip out to get to the required drawings info.

So, it does seem to be something in Inkscape files that BGRASVG doesn't like, but I have a workaround that seems to work OK at least for the files I've tried.

Phoenix

  • Jr. Member
  • **
  • Posts: 87
Re: BGRABitmap SVG rendering errors?
« Reply #3 on: June 06, 2017, 06:39:59 pm »
Hello,
Thanks for sharing this solution!

PS. I hope, however, that with time the support for svg format will be improved because it is something very interesting.

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: BGRABitmap SVG rendering errors?
« Reply #4 on: June 18, 2017, 06:28:12 pm »
Hello.

Thanks for posting the bug.

I fixed it on the dev-bgrabitmap branch.

Regards
Conscience is the debugger of the mind

Phoenix

  • Jr. Member
  • **
  • Posts: 87
Re: BGRABitmap SVG rendering errors?
« Reply #5 on: June 18, 2017, 08:07:21 pm »
Thank you!!  :D

CCRDude

  • Hero Member
  • *****
  • Posts: 600
Re: BGRABitmap SVG rendering errors?
« Reply #6 on: September 07, 2017, 09:32:53 am »
Just wanted to add my thank you as well!

This bug is why last year I switched to using pre-rendered PNGs (using Cairo during compile time, didn't want to include Cairo since that would mean +60 DLLs) instead of using BGRASVG (where we use BGRABitmap for all other graphics).

Due to the annoyance of shipping pre-rendered images for all imaginable resolutions, I wanted to evaluate options again, and first tests now show perfect renderings. So again, thank you!

 

TinyPortal © 2005-2018