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

*.jpg is not generated for scaled full size image. #122

Closed
Tracked by #22
mitogh opened this issue Jan 21, 2022 · 4 comments
Closed
Tracked by #22

*.jpg is not generated for scaled full size image. #122

mitogh opened this issue Jan 21, 2022 · 4 comments
Labels
[Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Bug An existing feature is broken

Comments

@mitogh
Copy link
Member

mitogh commented Jan 21, 2022

Steps to replicate

2022-01-20_19-02

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.

philip-myrtorp-hDBdvjk1b0s-unsplash

@mitogh mitogh changed the title *.jpeg is not generated for full size image. *.jpeg is not generated for full size image. Jan 21, 2022
@mitogh mitogh changed the title *.jpeg is not generated for full size image. *.jpg is not generated for full size image. Jan 21, 2022
@mitogh mitogh changed the title *.jpg is not generated for full size image. *.jpg is not generated for scaled full size image. Jan 21, 2022
@getsource
Copy link
Member

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
Copy link
Member Author

mitogh commented Jan 21, 2022

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.

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.

@eclarke1 eclarke1 added this to Backlog in [Focus] Images via automation Jan 24, 2022
@felixarntz felixarntz added [Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Bug An existing feature is broken labels Feb 7, 2022
@adamsilverstein
Copy link
Member

Fixed in #143

[Focus] Images automation moved this from Backlog to Done Feb 10, 2022
@mitogh
Copy link
Member Author

mitogh commented Feb 12, 2022

Related with the following core ticket:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Bug An existing feature is broken
Projects
No open projects
Development

No branches or pull requests

4 participants