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

Fatal error when image cannot be converted to WebP #3

Open
colesnic89 opened this issue Dec 1, 2023 · 0 comments
Open

Fatal error when image cannot be converted to WebP #3

colesnic89 opened this issue Dec 1, 2023 · 0 comments

Comments

@colesnic89
Copy link

colesnic89 commented Dec 1, 2023

PHP 7.4.

I expected to be a fallback option with original image, but it throws an error
imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: Not a JPEG file: starts with 0x89 0x50

It happens when PNG image was saved with .jpg extension (and vice versa). So in this case better solution is to use exif_imagetype function to determine real image type, instead of image extension.

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

1 participant