Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Crash when using with SVG files


Miguel Gimenez:
I am adapting the code to HiDPI after wx3.1.6 using wxBitmapBundle (see ticket #1297 for details), and I have discovered that wxBitmapBundle::FromSVG() method produces random crashes because the underlying library (nanoSVG) is buggy:
  - first crash is in nsvg_Parse(). This only happens on non-english locales, is fixed in nanoSVG trunk but not in wxWidgets, and a workaround is locale switching before calling FromSVG().
  - second crash is in nsvg__addEdge(). AFAIK this is not fixed and there is no workaround.

Because of this, I will temporarily remove calls to wxBitmapBundle::FromSVG() along this weekend.

Straight up: I am not happy with the process used and the way the SVN changes have been made.
Going forward:
 Can a new interface be added so that the changes in the vast majority of code calls one function/class and this class/function has the smarts to either use the existing PNG or the new SVG files. This has the advantage on only modifying the existing code:
* Once
* Allows for the removal of the PNG support without changing the C::B source files
* updates as needed without modifying the existing C::B code after the initial change.
* Existing C::B code does not have any #if..#else..#endif block

In my own software, I use wxBitmapBundle::FromSVGFile() in wxWidgets 3.2.1 and never met such problems (until now ???)

Miguel Gimenez:
It was a misunderstanfing on my side, it is fixed now.


--- Quote from: Miguel Gimenez on October 02, 2022, 01:42:20 pm ---It was a misunderstanfing on my side, it is fixed now.

--- End quote ---

Good work.


[0] Message Index

Go to full version