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

Transparent .pngs with colour type Palette cannot be converted #1864

Open
benniledl opened this issue Feb 11, 2025 · 3 comments
Open

Transparent .pngs with colour type Palette cannot be converted #1864

benniledl opened this issue Feb 11, 2025 · 3 comments
Labels
[Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Bug An existing feature is broken

Comments

@benniledl
Copy link

Bug Description

When uploading images, with the color type "Palette" or "PaletteAlpha", the plugin generates the full size-webp versions as an empty files (0 bytes). The resized versions are converted correctly. This results in images not being displayed to site visitors, as the .webp file is invalid.

Steps to Reproduce

Upload an image with the color type "Palette" or "PaletteAlpha" to the WordPress media library.
Navigate to the directory where the image is stored (e.g., /wp-content/uploads/2025/02/).
Observe that the corresponding .webp version of the image has a file size of 0 bytes.
As a result, the image is not displayed to site visitors.

Additional Notes

Converting the image to a different color type to sRGB before uploading resolves the issue for me.

Example

-rw-r--r-- 1 someuser someuser   858 2025-02-07 08:18 image-name-150x150.webp
-rw-r--r-- 1 someuser someuser 25160 2025-02-07 08:18 image-name-1536x864.webp
-rw-r--r-- 1 someuser someuser  2052 2025-02-07 08:18 image-name-300x169.webp
-rw-r--r-- 1 someuser someuser  9086 2025-02-07 08:18 image-name-768x432.webp
-rw-r--r-- 1 someuser someuser 33812 2025-02-07 08:18 image-name.png
-rw-r--r-- 1 someuser someuser     0 2025-02-07 08:18 image-name-png.webp
@benniledl benniledl added the [Type] Bug An existing feature is broken label Feb 11, 2025
@github-project-automation github-project-automation bot moved this to Not Started/Backlog 📆 in WP Performance 2024 Feb 11, 2025
@swissspidy swissspidy added the [Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) label Feb 11, 2025
@swissspidy
Copy link
Member

Could you please share details about your PHP and GD/ImageMagick versions? That will help others trying to reproduce this.

@swissspidy
Copy link
Member

Actually, looks like a possible duplicate of #1561

@benniledl
Copy link
Author

PHP Version 8.2.27
GD Version | bundled (2.1.0 compatible)
Imagick 3.7.0

Neither GD or Imagick work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Bug An existing feature is broken
Projects
Status: Not Started/Backlog 📆
Development

No branches or pull requests

2 participants