Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<image> tags not rendered #980

Open
billyjuliux opened this issue Aug 24, 2023 · 19 comments
Open

<image> tags not rendered #980

billyjuliux opened this issue Aug 24, 2023 · 19 comments

Comments

@billyjuliux
Copy link

billyjuliux commented Aug 24, 2023

Hi,

I tried to render svg image which contains <image> tags in <defs> (png image inside svg), but those images were not successfully rendered. Yet other elements of the svg were rendered successfully.

I can't show you the real image, but here is the rough structure of the svg file:

<svg width="52" height="128" viewBox="0 0 52 128" fill="none" xmlns="http://www.w3.org/203/svg" xmlns:xlink="http://www.w3.org/1939/xlink">
<path d="M561.28 0H0V17.66H561.28" fill="#E60013"/>
<mask id="mask0_335_524" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="562" height="178">
<path d="M561.28 0H0V177.66H561.28V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_335_524)">
<path fill-rule="evenodd" clip-rule="even" d="M555" fill="#CF141C"/>
<path fill-rule="evenodd" clip-rule="even" d="M0 151.78V177.66H561.28L0 151.78Z" fill="#CF141C"/>
<rect x="-223" y="-44" width="67" height="35" fill="url(#pattern0)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M561.281 0H385.291L440.381 177.66H561." fill="#CF141C"/>
<rect x="386" y="8" width="171" height="173" fill="url(#pattern1)"/>
</g>
<path d="M211.444 " fill="white"/>
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_3365_52461" transform="matrix(0.0005008 0 0 0.009108 -0.00112783 0)"/>
</pattern>
<pattern id="pattern1" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image1_3365_52461" transform="matrix(0.000632511 0 0 0.000625199 0 -0.00109684)"/>
</pattern>
<image id="image0_3365_52461" width="1920" height="1009" xlink:href="data:image/png;base64,iVBORw0KGgoAAAbk7CxAAAgAElEQVR4AezdaZMl13kf"/>
<image id="image1_3365_52461" width="1581" height="1603" xlink:href="data:image/png;base64,iVBORw0ACDgXPJAAAKN2lDQ1BzUkdCIElFQzYxOTY2LTIuMQAAeJydlndUU9kWh8I="/>
</defs>
</svg>

I have tried to move the <defs> order to the front and use online tools of svg cleaner but still didn't work.

Any help would be very appreciated. Thanks!

@minseok-jeong-gn
Copy link

Same issue

@tsrCodes
Copy link

Any Solution ??

@AristideVB
Copy link

AristideVB commented Aug 30, 2023

Also experiencing this issue, I ended up stacking my PNGs behind my SVG

@pipe0919
Copy link

pipe0919 commented Sep 8, 2023

A solution for me was to download the img as a pdf and then convert to svg @AristideVB @tsrCodes @minseok-jeong-gn @billyjuliux

@devnta
Copy link

devnta commented Sep 14, 2023

A solution for me was to download the img as a pdf and then convert to svg @AristideVB @tsrCodes @minseok-jeong-gn @billyjuliux

Thank you very much, bro!
It worked for me.
But what solution to fix this faster?
Very thanks!

@pipe0919
Copy link

A solution for me was to download the img as a pdf and then convert to svg @AristideVB @tsrCodes @minseok-jeong-gn @billyjuliux

Thank you very much, bro! It worked for me. But what solution to fix this faster? Very thanks!

Not now for me

@dishankjindal1
Copy link

This is a problem, svg which contains images inside are working fine on browser but images are getting distorted in flutter/react-native both

@ElDuderini
Copy link

I've had issues with this as well, but unfortunately can't really do the conversion to a PDF and then back to an SVG since the issues with these images happen with dynamic content managed by CMS.

@da-coid
Copy link

da-coid commented Jan 10, 2024

if you get asset from figma , download it as png , and then convert to svg with tools that you can find on internet. It works !

@adimshev
Copy link

any updates?

@fisforfaheem
Copy link

who will fix this

@abdel-ke
Copy link

for me i converted the svg to json with package xml2json then i mapped it

@fisforfaheem
Copy link

fisforfaheem commented Feb 13, 2024 via email

@minseok-jeong-gn
Copy link

For the saving time,
If svg file doesn't render correctly,
just use png or jpeg format.

I'm just export image as png or jpeg format if svg file doesn't work.
That saved my time a lot

@fisforfaheem
Copy link

fisforfaheem commented Feb 14, 2024 via email

@francisnumbi-chd
Copy link

This is really pissing me ! Why can't they find a solution !

@fisforfaheem
Copy link

fisforfaheem commented Feb 22, 2024 via email

@yousefak007
Copy link

same for me

@fisforfaheem
Copy link

Kindly give us an update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests