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

PNG files transparent background is transformed to black background if it's selected as front #9621

Closed
alexgarel opened this issue Jan 5, 2024 · 2 comments · Fixed by #9632 or #9582
Assignees
Labels
🐛 bug This is a bug, not a feature request. 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers

Comments

@alexgarel
Copy link
Member

alexgarel commented Jan 5, 2024

On producer platform, this image: https://www.arcadie.fr/boutique/img.php?id_produit=459
was transformed to https://images.pro.openfoodfacts.org/images/products/org-arcadie/341/796/004/3973/front_fr.8.400.jpg with a black baground, it's ugly !

Not that the image by itself has a white and black background !https://images.pro.openfoodfacts.org/images/products/org-arcadie/341/796/004/3973/2.jpg, it's the front selection which have a black background.

@alexgarel alexgarel added 🐛 bug This is a bug, not a feature request. 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers labels Jan 5, 2024
@alexgarel
Copy link
Member Author

alexgarel commented Jan 5, 2024

Things might happen in import.pm, nearby the process_image_upload call.

It would be important to cut this code and put those processing in specific functions… so that we can test them.

@stephanegigandet
Copy link
Contributor

This happens because we remove transparency with white only if the file extension is .png. Here it's a png but without an extension. I will fix it.

@stephanegigandet stephanegigandet changed the title PNG files transparent background is tranfrom to black baground if it's selected as front PNG files transparent background is transform eto black baground if it's selected as front Jan 8, 2024
@stephanegigandet stephanegigandet changed the title PNG files transparent background is transform eto black baground if it's selected as front PNG files transparent background is transformed to black background if it's selected as front Jan 8, 2024
stephanegigandet added a commit that referenced this issue Jan 9, 2024
#9632)

fix: remove transparency of PNG images without a .png extension, fixes #9621
@github-project-automation github-project-automation bot moved this from To do to Done in 🏭 Producers Platform Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug This is a bug, not a feature request. 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers
Projects
Status: Done
2 participants