Opened 8 years ago
Closed 7 years ago
#38281 closed defect (bug) (duplicate)
Generating thumbnails matching original image dimensions
Reported by: | galbaras | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.6.1 |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
When the thumbnail size matches the uploaded image dimensions precisely, the thumbnail is created.
In image_resize_dimensions(), line 551 is:
if ( $new_w >= $orig_w && $new_h >= $orig_h && $dest_w != $orig_w && $dest_h != $orig_h ) {
This means that when $dest_w == $orig_w or $dest_h == $orig_h, a new file is created, when it shouldn't be, although the new file's dimensions match that of the original file.
The first 2 conditions ($new_w >= $orig_w && $new_h >= $orig_h) should be enough prevent the creation of an equal or larger file.
So the new code should be:
if ( $new_w >= $orig_w && $new_h >= $orig_h ) {
Change History (2)
Note: See
TracTickets for help on using
tickets.
Duplicate of #32437.