- This topic has 21 replies, 1 voice, and was last updated 3 years, 10 months ago by K.
-
AuthorPosts
-
July 4, 2019 at 12:42 pm #949230K
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.
July 4, 2019 at 3:25 pm #949324LeoStaffCustomer SupportHi 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?
July 6, 2019 at 10:29 am #950653KHi 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.
July 6, 2019 at 10:41 am #950658LeoStaffCustomer SupportAny chance you can disable the Autoptimize and any other caching plugins for on the staging site for now?
July 6, 2019 at 10:49 am #950664KYes, sorry!
July 6, 2019 at 10:54 am #950666KLeo,
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!
July 6, 2019 at 12:20 pm #950727KLeo,
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.
July 6, 2019 at 2:49 pm #950775LeoStaffCustomer SupportCan you disable all plugins except GP Premium to eliminate any plugin conflicts?
Let me know ๐
July 7, 2019 at 9:46 am #951328KHi 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.
July 7, 2019 at 10:50 am #951362LeoStaffCustomer SupportWhat if you increase the container width? Currently, it’s set at
1024px
which is smaller than 340*3 + 25*2 (left and right padding).July 7, 2019 at 11:07 am #951382KLeo,
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.
July 7, 2019 at 11:42 am #951416KLeo,
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.
July 7, 2019 at 12:17 pm #951445KUnfortunately 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.
July 7, 2019 at 4:26 pm #951539TomLead DeveloperLead DeveloperHi there,
If the standard resizer isn’t working, you can try this: https://generatepress.com/forums/topic/blog-archives-image-scaling-thumbnail-problem/#post-780773
Let me know ๐
July 7, 2019 at 8:19 pm #951600KHi 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…
-
AuthorPosts
- You must be logged in to reply to this topic.