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

Support bitmap masks #375

Open
GabrielYudenich opened this issue Dec 26, 2022 · 7 comments
Open

Support bitmap masks #375

GabrielYudenich opened this issue Dec 26, 2022 · 7 comments
Labels

Comments

@GabrielYudenich
Copy link

Hello to all, i have this issue happening some time now and i want to know how i can fix it

I'm trying to convert a SVG image to a PDF using Cairo, but it's really not working and everytime i got a broken PDF image

The SVG file and the PNG image are right here:
Google drive

All of the text and everything on the image are broken on PNG

PNG:

gluck pdf_0_svg_image svg

Someone can help me? The code are very simple to convert but i always got the same error

svg2png(bytestring=svg_stream, scale=3, background_color='white', write_to=path_to_pdf)

Thank you in advance!

@liZe
Copy link
Member

liZe commented Dec 27, 2022

Hi!

CairoSVG doesn’t support bitmap masks, as the one used in your example. I don’t know if it’s even possible to do this with Cairo 😢️.

@liZe liZe changed the title svg2png writes a PNG broken image Support bitmap masks Dec 27, 2022
@liZe liZe added the feature label Dec 27, 2022
@GabrielYudenich
Copy link
Author

GabrielYudenich commented Dec 27, 2022 via email

@liZe
Copy link
Member

liZe commented Dec 27, 2022

If I'm not mistaken, only the second base64 inside the SVG content are not displaying on pdf

You’re right. The first one works because it’s a simple image (actually a use tag referencing a symbol tag including an image tag). The second one is an image applied as a mask onto a rectangle, it’s not a simple image, that’s why it doesn’t work.

@GabrielYudenich
Copy link
Author

GabrielYudenich commented Dec 27, 2022 via email

@liZe
Copy link
Member

liZe commented Dec 27, 2022

Actually any SVG (of mine) to PNG are giving this bug. Maybe something changed on the code?

I get the same problem with CairoSVG 2.2.0 that’s more than 4 years old. So, if something changed in the code, it changed a really long time ago!

I also tried Cairo 1.16.0 (instead of the "new" 1.17.x versions), it doesn’t change anything.

@GabrielYudenich
Copy link
Author

GabrielYudenich commented Dec 27, 2022 via email

@liZe
Copy link
Member

liZe commented Dec 27, 2022

About this bug on base64 not displaying on PNG. Is it possible to fix this in the future?

CairoSVG is in maintenance mode, so this bug will probably not be fixed soon 😢️.

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

No branches or pull requests

2 participants