Repository navigation
*.jpg is not generated for scaled full size image. #122
Copy link
Copy link
Closed
Labels
[Plugin] Modern Image FormatsFormerly WebP Uploads [slug: webp-uploads]Formerly WebP Uploads [slug: webp-uploads][Type] BugAn existing feature is brokenAn existing feature is broken
Description
Steps to replicate
- Enable the WebP module
- Upload an image bigger than the
2560orbig_image_size_threshold(Use attached image) - Upload the image.
- Observe the full-size image was created with a
*webpextension for the full size image.
Image meta data stored in WordPress
Metadata of the image.
=> array(6) {
["width"]=>
int(1707)
["height"]=>
int(2560)
["file"]=>
string(55) "2022/01/philip-myrtorp-hDBdvjk1b0s-unsplash-scaled.webp"
["sizes"]=>
array(7) {
["medium"]=>
array(4) {
["file"]=>
string(48) "philip-myrtorp-hDBdvjk1b0s-unsplash-200x300.webp"
["width"]=>
int(200)
["height"]=>
int(300)
["mime-type"]=>
string(10) "image/webp"
}
["large"]=>
array(4) {
["file"]=>
string(49) "philip-myrtorp-hDBdvjk1b0s-unsplash-683x1024.webp"
["width"]=>
int(683)
["height"]=>
int(1024)
["mime-type"]=>
string(10) "image/webp"
}
["thumbnail"]=>
array(4) {
["file"]=>
string(48) "philip-myrtorp-hDBdvjk1b0s-unsplash-150x150.webp"
["width"]=>
int(150)
["height"]=>
int(150)
["mime-type"]=>
string(10) "image/webp"
}
["medium_large"]=>
array(4) {
["file"]=>
string(49) "philip-myrtorp-hDBdvjk1b0s-unsplash-768x1152.webp"
["width"]=>
int(768)
["height"]=>
int(1152)
["mime-type"]=>
string(10) "image/webp"
}
["1536x1536"]=>
array(4) {
["file"]=>
string(50) "philip-myrtorp-hDBdvjk1b0s-unsplash-1024x1536.webp"
["width"]=>
int(1024)
["height"]=>
int(1536)
["mime-type"]=>
string(10) "image/webp"
}
["2048x2048"]=>
array(4) {
["file"]=>
string(50) "philip-myrtorp-hDBdvjk1b0s-unsplash-1365x2048.webp"
["width"]=>
int(1365)
["height"]=>
int(2048)
["mime-type"]=>
string(10) "image/webp"
}
["post-thumbnail"]=>
array(4) {
["file"]=>
string(50) "philip-myrtorp-hDBdvjk1b0s-unsplash-1568x2352.webp"
["width"]=>
int(1568)
["height"]=>
int(2352)
["mime-type"]=>
string(10) "image/webp"
}
}
["image_meta"]=>
array(12) {
["aperture"]=>
string(1) "0"
["credit"]=>
string(0) ""
["camera"]=>
string(0) ""
["caption"]=>
string(0) ""
["created_timestamp"]=>
string(1) "0"
["copyright"]=>
string(0) ""
["focal_length"]=>
string(1) "0"
["iso"]=>
string(1) "0"
["shutter_speed"]=>
string(1) "0"
["title"]=>
string(0) ""
["orientation"]=>
string(1) "0"
["keywords"]=>
array(0) {
}
}
["original_image"]=>
string(39) "philip-myrtorp-hDBdvjk1b0s-unsplash.jpg"
}
This happens due to the new "full size" being scaled down to match the threshold from WordPress and prevents having a fallback *.jpg for the scaled size (full size).
Image used for testing this behavior.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Plugin] Modern Image FormatsFormerly WebP Uploads [slug: webp-uploads]Formerly WebP Uploads [slug: webp-uploads][Type] BugAn existing feature is brokenAn existing feature is broken


Activity
[-]*.jpeg is not generated for full size image.[/-][+]`*.jpeg` is not generated for full size image.[/+][-]`*.jpeg` is not generated for full size image.[/-][+]`*.jpg` is not generated for full size image.[/+][-]`*.jpg` is not generated for full size image.[/-][+]`*.jpg` is not generated for scaled full size image.[/+]getsource commentedon Jan 21, 2022
Thanks so much for the report!
The original full size uploaded image (in JPEG) should still be there (as is listed in the meta under "original image").
Just to confirm, is that the case? This image could act as a fallback if images need to be re-generated at some point.
My understanding is that the intent is for WebP to be the primary format when that module is enabled, so this sounds to me like the intended behavior.
It sounds like the behavior is inconsistent, though, between uploading an image larger/smaller than the
big_image_size_threshold. Since if it's smaller, the types would be mixed (although as you note, it has the benefit of acting as a larger sized fallback).@adamsilverstein What do you think?
mitogh commentedon Jan 21, 2022
That's correct, full-size image is still uploaded as specified on the meta but is the full-size image tho not the scaled version with the maximum dimensions set by WordPress.
Additionally, I think using the original image as a fallback does not provide a performance benefit, on the contrary, it loads a nonoptimized image in terms of size and quality to a device where modern images are not supported and instead a more appropriate size should be loaded as a fallback instead.
adamsilverstein commentedon Feb 10, 2022
Fixed in #143
mitogh commentedon Feb 12, 2022
Related with the following core ticket: