Comments (4)
Hi Chris,
Thank you for reporting this issue.
The behavior you've described is definitely not deliberate, and works contrary
to what would be reasonably expected.
This issue seems to occur when the file extension for the output file is in
lowercase letters. (e.g. JPG, Jpg, etc)
I'll have to take a closer look into what kind of use cases exhibits this
issue, and then I'll address the issue and release a new version of
Thumbnailator.
I can't make any promises about when I can fix the problem, but if not this
weekend, I should be able to by the end of this month.
Once again, thank you for taking the time to write a detailed report on this
issue.
Chris
Original comment by [email protected]
on 10 Aug 2011 at 3:55
- Changed state: Accepted
from thumbnailator.
Hi, thanks for the quick response, look forward to the next release but no
time pressure from my end.
Original comment by [email protected]
on 10 Aug 2011 at 7:05
from thumbnailator.
This issue has been addressed in Thumbnailator 0.3.9.
-----
This defect was causing extraneous file extensions to be appended to the end of
thumbnail filenames when the file extension of the specified destination was
not in lowercase.
For example, the following code did not cause an extraneous file extension to
be added, as the destination file name specifies the extension with lowercase
letters:
Thumbnails.of("path/to/image.jpg")
.size(100, 100)
.toFile("path/to/thumbnail.jpg");
// -> The thumbnail is written to "path/to/thumbnail.jpg"
The following, however, will have an extraneous "jpg" appended to the end of
the file name, as the file extension of the destination is a uppercase "JPG":
Thumbnails.of("path/to/image.jpg")
.size(100, 100)
.toFile("path/to/thumbnail.JPG");
// -> The thumbnail is written to "path/to/thumbnail.JPG.jpg"
Furthermore, specifying the output format via the `outputFormat` method could
have lead to even stranger behavior when the format was not specified in
lowercase:
Thumbnails.of("path/to/image.jpg")
.size(100, 100)
.outputFormat("JPG")
.toFile("path/to/thumbnail.JPG");
// -> The thumbnail is written to "path/to/thumbnail.JPG.JPG"
These were serious violations of the principle of least surprise, and
furthermore, extremely difficult to work around.
-----
Now, the destination file name is considered "correct", so unless there is a
incorrect (extension not suitable for the format specified in the
`outputFormat` method) or missing extension in which case the default file
extension will be appended to the file name.
Please refer to the following examples to see how Thumbnailator 0.3.9 handles
file extensions:
Thumbnails.of("path/to/image.jpg")
.size(100, 100)
.toFile("path/to/thumbnail.JPEG");
// -> The thumbnail is written to "path/to/thumbnail.JPEG"
Thumbnails.of("path/to/image.jpg")
.size(100, 100)
.outputFormat("jpg")
.toFile("path/to/thumbnail.JPEG");
// -> The thumbnail is written to "path/to/thumbnail.JPEG"
Thumbnails.of("path/to/image.jpg")
.size(100, 100)
.outputFormat("JPEG")
.toFile("path/to/thumbnail.jpg");
// -> The thumbnail is written to "path/to/thumbnail.jpg"
Original comment by [email protected]
on 13 Aug 2011 at 12:21
- Changed state: Fixed
from thumbnailator.
Wanted to know If we can store the files by converting the filenames to uppercase using thumbnailator. Please let me know if we have any option to do so.. Thanks
from thumbnailator.
Related Issues (20)
- How to ensure the GIF dynamic effect after compression HOT 1
- Do you have plans to support WebP, AVIF? HOT 1
- Thumbnail not properly generating from PNG images HOT 2
- Image color loss during conversion HOT 3
- Define an Automatic-Module-Name HOT 1
- the image format webp is not support HOT 5
- No suitable ImageReader found for source data errors HOT 1
- After resize the image is rotated HOT 3
- 300dpi tiff image changed to 96pi jpg but pixel does not chage HOT 1
- Incorrect cropping when specifying sourceRegion and an image that has exif orientation HOT 2
- Multi-threaded processing of images with large pixel width and height leads to memory OutOfMemoryError
- the .pict file is not supported HOT 1
- javax.imageio.IIOException: Invalid JPEG file structure: two SOF markers HOT 1
- Add crop method usage to examples HOT 2
- How to make the image width fixed when the image is scaled HOT 1
- Does the thumbnailator support generating thumbnails for png images? HOT 1
- Conversion error caused by image reading failure
- Native image service unable to compress image
- jpg color turn red HOT 2
- webp format image campress fail with exception "No suitable ImageReader found for source data" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thumbnailator.