-
Notifications
You must be signed in to change notification settings - Fork 9
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
Doesn't work with JPGs #6
Comments
Hi @sinisterstuf, thanks for the report. Yes, JPEG is not supported. +1 on the filetype check. Would you mind submitting a PR for this? Thank you. |
Sure, I'm pretty unfamiliar with any of these libraries but I'll give it a go! |
Ok I checked the code a bit today and this crash is caused by this commit a0a9869 which changed the image mode from RGB to RGBA seemingly without consideration for the fact that only 3 out of 6 of the supported filetypes can handle transparency. I think it would be lame to revert this to its previous value because having transparent backgrounds is useful when possible. Instead I intend to check whether the output file format supports transparency or not, and convert it to non-transparent RGB if necessary. This will involve some changes because it seems right now we only check the filetypes are valid for the input file. So:
|
What about providing an option for this so users can control behaviour and raise an exception for unsupported combinations? |
Hi, the README says:
All the examples show using PNGs but I thought I'd try a JPG and it crashes the program:
Have I made a mistake, e.g. missed installing a library? Or does the program not support JPEG? I'd guess the latter because the stack trace mentions saving RGBA as JPEG, and I suppose the A in RGBA is because of the transparent background after the hexagon is cut out and JPEGs don't support transparency. Maybe it would be good to add a file type check at the beginning of the program to make sure the user provides an input filetype that will support transparency in the output?
The text was updated successfully, but these errors were encountered: