Jump to content
You must now use your email address to sign in [click for more info] ×

SVG import showing image error


Recommended Posts

Hi, 

I'm trying to import SVG file, unfortunately showing image error. With other programs (Inkscape, macSVG, Adobe Illustrator and others) shows correct representation, only Affinity family does not. Is this bug?

As an example, you can get SVG from Wikipedia and look.

https://upload.wikimedia.org/wikipedia/commons/c/cd/Coat_of_arms_of_Hesse.svg?download

Link to comment
Share on other sites

Opens fine in ANY Affinity product. What image error is shown? Screenshot?

With which Affinity software did you try to open? Windows? Mac? ipad?

------
Windows 10 | i5-8500 CPU | Intel UHD 630 Graphics | 32 GB RAM | Latest Retail and Beta versions of complete Affinity range installed

Link to comment
Share on other sites

18 minutes ago, Joachim_L said:

Opens fine in ANY Affinity product. What image error is shown? Screenshot?

With which Affinity software did you try to open? Windows? Mac? ipad?

See Image. I use with macOS Mojave but other my old iMac with macOS Sierra, same problems

 

1310003346_Bildschirmfoto2019-08-08um16_19_22.thumb.png.08a6f7349f59d32ad3eda9fe6bb753d8.png

Edited by deafmicky
Link to comment
Share on other sites

25 minutes ago, Palatino said:

Therefore I may say that the file has a very bad structure.

Has it? But why do most editors do not stumble upon the bad structure? So I would claim this a bug.

------
Windows 10 | i5-8500 CPU | Intel UHD 630 Graphics | 32 GB RAM | Latest Retail and Beta versions of complete Affinity range installed

Link to comment
Share on other sites

6 minutes ago, Joachim_L said:

Has it? But why do most editors do not stumble upon the bad structure? So I would claim this a bug.

Then ask machines in the graphics industry. The file structure is extremely error-prone. As you can see.

Thanks to DeepL.

Link to comment
Share on other sites

That SVG drawing uses a SVG <pattern> element ...

<?xml version="1.0"?>
<svg viewBox="-1 -1 430 518" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<pattern id="a" height="76.78" patternTransform="translate(10 151.5)" patternUnits="userSpaceOnUse" width="360">
<path d="m.01 0h359.99l-.01 38.39h-359.99z" fill="#e10000"/>
<path d="m.01 38.39h359.99l-.01 38.39h-359.99z" fill="#fff"/>
</pattern>
...
...

... and the Affinity SVG parser has no clue about patterns, meaning doesn't support those SVG elements. Thus it can't show up that SVG drawing correctly, which you can also see from the layers panel, there is no layer with ID "a" (<pattern id="a" ...) shown, it doesn't recognize and omits this during parsing.

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

7 hours ago, v_kyr said:

That SVG drawing uses a SVG <pattern> element ...

From near the end of that linked page:

1739599624_notfornewuse.jpg.35f13bac5ca2cfe07555fcaf6d8098f9.jpg

I have no idea what that means, but from other links apparently there is a potential issue with something sometimes being undefined that may have something to do with its deprecated status. Perhaps the forum's SVG gurus can explain more about that.

All 3 1.10.8, & all 3 V2.4.2 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

That‘s just for the „xlink:href“ attribut of pattern elements...

Quote
xlink:href Deprecated since SVG 2
This attribute reference a template pattern that provides default values for the <pattern> attributes.
Value type: <URL>; Default value: none; Animatable: yes

Note: For browsers implementing href, if both href and xlink:href are set, xlink:href will be ignored and only href will be used.

...and is replaced by href since SVG2 (see here).

So that doesn't play any role at all in this threads error contents, the point is more, that Affinity's SVG parser doesn't take <pattern> elements into account at all.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.