[Resolved] Blog Featured Image Size

Home Forums Support Blog Featured Image Size

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #949230
    K

    Hi,

    I noticed that Generatepress is no longer respecting the Featured Image Size I set in Blog->Featured Images. Instead, it seems to be accurately detecting the available size and inserting the exact desired width/height. While I love this, I need to know what width/height it’s detecting, so I can also set some other code I’m using to render the page. Is there a hook for that?

    Thanks.

    #949324
    Leo
    Staff
    Customer Support

    Hi there,

    Not sure if I fully understand.

    The options in the customizer should still work.

    What size do you have set in the customizer? It is not working?

    #950653
    K

    Hi Leo,

    I’ve setup my staging site (same site address but with staging. subdomain) with the Blog Featured Image set to 340×170. If you visit the site, you’ll see that it is using different width/height dimensions in the img tag.

    Thanks.

    #950658
    Leo
    Staff
    Customer Support

    Any chance you can disable the Autoptimize and any other caching plugins for on the staging site for now?

    #950664
    K

    Yes, sorry!

    #950666
    K

    Leo,

    I’ve been trying to figure this out myself, and it may not be generatepress after all. It seems the behavior changes when I turn Jetpack on/off.

    Thanks!

    #950727
    K

    Leo,

    Sorry for the back and forth, but it may be an issue with Generatepress after all.

    I turned Jetpack off, then in generatepress layout I set the width to 340, height to 170 for the blog post featured images, but it is not using these values and using the original image values instead.

    Thanks.

    #950775
    Leo
    Staff
    Customer Support

    Can you disable all plugins except GP Premium to eliminate any plugin conflicts?

    Let me know 🙂

    #951328
    K

    Hi Leo,

    I’ve turned off all plugins except GP Premium, and my custom CSS plugin on my staging site. I’ve also set the blog featured images to 340w x 170h in the customizer layout->blog.

    Thanks.

    #951362
    Leo
    Staff
    Customer Support

    What if you increase the container width? Currently, it’s set at 1024px which is smaller than 340*3 + 25*2 (left and right padding).

    #951382
    K

    Leo,

    Unfortunately, I can’t change the container width. It’s a very active live site that went through an approval process.

    Also, I’m not trying to actually size them to 340w. In a sense, I’m using the values as max-width/max-height because Jetpack uses the image width/height settings to automatically resize images before it serves them from their CDN. 340w is the largest size that image ever needs to be served (on all screen sizes) for that page.

    But more importantly, this was working with this same configuration just a couple of weeks ago. Not sure which of the recent updates changed the behavior, but it should still be inserting the values, even if they are larger than the container width.

    If there’s another way, possibly a hook, to set width/height values for the featured images, I’d be happy to switch to using that instead.

    Thanks.

    P.S. I decided to change the container size to 1600 on the staging site just to test if it would make a difference – it did not. Still not using the values set in the Customizer.

    #951416
    K

    Leo,

    After looking at the code a little and further testing, I figured out the issue. I had added this to my wp-config.php file since my wp-options table was getting filled every day with tons of entries and significantly affecting my TTFB:

    define( ‘GP_IMAGE_RESIZER’, false );

    I read on the forums that this would stop the db issue, and this seems to be another side effect.

    I’m going to try this filter to see if it can workaround it: generate_blog_image_attributes.

    #951445
    K

    Unfortunately the workaround didn’t help. As long as GP_IMAGE_RESIZER is defined, it won’t set width/height values for the featured images.

    Do you have any other ideas as to how I can have these values set with GP_IMAGE_RESIZER defined? I don’t mind it running if it wasn’t giving issues, but my wp-options table goes from about 500 records to tens of thousands of records daily until I clean it out again, thus increasing my TTFB from under 1s to 3s or longer.

    Thanks.

    #951539
    Tom
    Lead Developer
    Lead Developer
    #951600
    K

    Hi Tom,

    I don’t need a resizer at all, since the jackpack CDN automatically re-sizes the images based on the width and height setting of the image before it serves them.

    However as soon as I set the GP_IMAGE_RESIZER to stop resizing, the customizer->layout->blog featured image sizes are ignored by GeneratePress and no longer added to the img tag width/height output. I need GP to respect and insert the featured image width/height I’ve set, regardless of the GP_IMAGE_RESIZER setting.

    Without a width/height setting in the image tag, Jetpack cannot resize the images.

    But leaving on GP_IMAGE_RESIZER causes my dB to overload with image processing entries, significantly slowing down my site. So I’m stuck leaving it on and cleaning my dB of the entries daily.

    Hope that made sense…

Viewing 15 posts - 1 through 15 (of 22 total)
  • You must be logged in to reply to this topic.