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

Library is unable to encode image files to the Webp files #24

Open
vishal-bacancy opened this issue Jul 25, 2024 · 2 comments
Open

Library is unable to encode image files to the Webp files #24

vishal-bacancy opened this issue Jul 25, 2024 · 2 comments

Comments

@vishal-bacancy
Copy link

Hello,

Currently, I'm using this library to convert PNG/JPG files to webP files for better performance, it was working fine but suddenly, the library stopped working and it is raising the below exception

path has .png file and webp_path has .webp file

WebP::EncoderError: Cannot read input picture file

image

I tried to use cwebp input_file -o output_file command to convert it from the terminal and it is working fine, but My Rails app is unable to convert it to the webp file using this library

@le0pard
Copy link
Owner

le0pard commented Jul 25, 2024

This error came from this function https://github.com/le0pard/webp-ffi/blob/master/ext/webp_ffi/util.c#L68 - this mean of C code cannot open the file or cannot decode image to get width and height

@vishal-bacancy
Copy link
Author

thank you @le0pard for this information. I tried giving full access to the file but still, it wasn't working as expected, perhaps there are some issues with the decoding.

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

2 participants