Recent

Author Topic: Error while loading SVG file  (Read 671 times)

Lulu

  • Sr. Member
  • ****
  • Posts: 405
Error while loading SVG file
« on: February 19, 2026, 09:23:27 pm »
Hi,
Some files made with Adobe Illustrator fails to load with BGRABitmap.
The svg image is simple: there is a shape with an outline with a gradient fill.
I attach a project with one of the file that fial to load.

Any idea ?

Thank you
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

dsiders

  • Hero Member
  • *****
  • Posts: 1608
Re: Error while loading SVG file
« Reply #1 on: February 19, 2026, 09:42:50 pm »
Hi,
Some files made with Adobe Illustrator fails to load with BGRABitmap.
The svg image is simple: there is a shape with an outline with a gradient fill.
I attach a project with one of the file that fial to load.

Any idea ?

Thank you

Have you tested the SVG using one of the online validators?

LeP

  • Sr. Member
  • ****
  • Posts: 290
Re: Error while loading SVG file
« Reply #2 on: February 19, 2026, 09:46:54 pm »
I don't see the gradient with any app, except MSEdge.
I think there is a not common tag inside.
Un Sistema per domarli, un IDE per trovarli, un codice per ghermirli e nel framework incatenarli.
An operating system to tame them, an IDE to find them, a code to catch them and in the framework chain them.

LeP

  • Sr. Member
  • ****
  • Posts: 290
Re: Error while loading SVG file
« Reply #3 on: February 19, 2026, 09:50:55 pm »
You should giva a look here: https://forum.lazarus.freepascal.org/index.php/topic,73422.msg575919.html#msg575919

Let's try the software attached.
Un Sistema per domarli, un IDE per trovarli, un codice per ghermirli e nel framework incatenarli.
An operating system to tame them, an IDE to find them, a code to catch them and in the framework chain them.

Khrys

  • Sr. Member
  • ****
  • Posts: 434
Re: Error while loading SVG file
« Reply #4 on: February 20, 2026, 07:17:59 am »
Some files made with Adobe Illustrator fails to load with BGRABitmap.

Are you sure the files were exported from Adobe Illustrator?  :)

Code: XML  [Select][+][-]
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!-- Created with Inkscape (http://www.inkscape.org/) -->

In any case, I can see at least three problems here:
  • The offending gradient has a name that is out of spec (it contains special characters):  Dégradé_sans_nom_3
  • For some reason the wrong gradient definition is used (there's a duplicate with the same coordinates as the above, but without any colors)
  • The  <path>  element's style is stored as CSS, which I'm not sure BGRABitmap supports
I'm attaching a fixed version (exported as optimized SVG using Inkscape and zipped per forum requirements).

Lulu

  • Sr. Member
  • ****
  • Posts: 405
Re: Error while loading SVG file
« Reply #5 on: February 20, 2026, 09:26:03 am »
Hi all,

Have you tested the SVG using one of the online validators?
done and the result is the file is valid.

Are you sure the files were exported from Adobe Illustrator?  :)

Yes, my niece, who drew this image only uses Adobe Illustrator. I use Inkscape and before posting this file, I loaded it into Inkscape and then saved it.
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

Lulu

  • Sr. Member
  • ****
  • Posts: 405
Re: Error while loading SVG file
« Reply #6 on: February 20, 2026, 09:52:32 am »
I'm attaching a fixed version (exported as optimized SVG using Inkscape and zipped per forum requirements).

The fixed version also raise an exception "external: ACCESS VIOLATION" when the file is loaded.
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

 

TinyPortal © 2005-2018