Closed zhaohui90-lee closed 1 year ago
the image format webp is not supported!
@zhaohui90-lee, Thumbnailator relies on Image I/O plugins available at runtime for reading and writing images. The default Java environment doesn't have support for WebP, so Thumbnailator cannot handle them.
If you want to handle other image formats, you'll need to add the appropriate Image I/O plugins to support them. For example, if you need WebP support, TwelveMonkeys ImageIO has read support for them. You'll basically just need to add a Maven dependency to the WebP plugin ("imageio-webp") and that should be all you'll need to do.
For more information, please refer to the FAQ on this topic.
i use Thumbnails.of(url) it works well with webp image, my version of Thumbnails 0.4.20, but the question of mine is i want use the origin image size, am i don`t not about but i need set the size first,can i have any method to get the size?
@zhangjianxing2011 - Do you want to keep the same size as the original? Then you can use .scale(1.0)
:
Thumbnails.of("/path/to/image").scale(1.0).toFile("/path/to/thumbnail");
Next time when you have a question, feel free to open a new issue rather than ask in an already closed issue. Thanks!
@zhangjianxing2011 - Do you want to keep the same size as the original? Then you can use
.scale(1.0)
:Thumbnails.of("/path/to/image").scale(1.0).toFile("/path/to/thumbnail");
Next time when you have a question, feel free to open a new issue rather than ask in an already closed issue. Thanks! Thank you very much,I will submit an closed issue with the answer
Expected behavior
Please describe what you are expecting the library to perform. When I used your project to upload webp format images to the server, I found that it did not support this format; But other formats such as jpg and png are fine. Here is a portion of the code for my project:
`File dest = new File(finalPath);
I would like to ask whether webp format images are not supported for the time being, or I have a problem using them. Thank you!
Actual behavior
Please describe the actual behavior you are experiencing, including stack trace and other information which would help diagnose the issue.
Steps to reproduce the behavior
Please enter step-by-step instructions for reproducing the actual behavior. Including code can be helpful in diagnosing issue, but please keep the code to a minimal that will reproduce the behavior.
Environment
Please provide vendor and version information for the Operating System, JDK, and Thumbnailator. Please feel free to add any other information which may be pertinent.