Skip Navigation

[Resolved] custom image size generation

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 3 voices.

Last updated by Steve 1 year, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#2385533

Is my understanding correct that if i specify a custom image size in a view like this
[wpv-post-featured-image size="custom" width="300"]

that Toolset will dynamically generate that image in that size?

I have an issue on this page hidden link where for some reason a single image (the one for Magic) isnt getting created- the other images on the page all generated by the same view are all ok

The page source shows a correctly generated image tag- but the image isn't in the file system
<img loading="lazy" class="attachment-300x size-300x" src="hidden link" width="300" height="" alt="Magic">

What am I missing?

#2385619

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2022-06-15 at 15.55.09.png

Hi Steve

That is how it is supposed to work.

When using custom image sizes a new image file is generated in the uploads directory in the same location as the original.

Depending on whether it was generated via an Image block, a types custom field, or—in your case—the wpv-post-featured-image shortcode, the filename will be different.

When resized by the types shortcode, a wpcf- prefix is used. Using the wpv-post-featured-image shortcode uses a wpv- prefix. When generated by an Image block there is no prefix and the same naming convention as WordPress is used.

The screenshot shows my uploads directory where I just output an existing image at a custom size (width = 321) using the wpv-post-featured-image shortcode, and you can see the resulting file.

Are you sure there is no such file in your uploads directory? When I've looked into this before, if it was not possible to generate the custom sized file for some reason, then the img tag would use the full-sized file as its src.

Could there be any other plugins interfering in this?

#2385673

Thanks Nigel Yes ive just double checked in the file manager and the image
<img loading="lazy" class="attachment-300x size-300x" src="hidden link" width="300" height="" alt="Magic">
is non existent

Adjacent images on that page- that are created by the same view exist where they should

If i deactivate all the other plugins beside toolsets and re add the featured image the problem persists- though what is it that triggers the image creation- perhaps thats not a fair test

#2386127
image-size3.jpg

Hello,

I assume we are talking the original image file of your website:
hidden link
I have tried it in my localhost with a fresh WP installation + the latest version of Toolset plugins, by below steps:
1) Create a new post and setup the featured image as above image file
2) Use the same shortcode as you mentioned above:
[wpv-post-featured-image size="custom" width="300"]

Test it in frontend, it works fine, see my screenshot: image-size2.jpg
I suggest you try to edit the problem post, reupload the feature image and test again, also check if there is any PHP errors in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#php-debugging

#2388547

Thanks, Your right the short code works fine on a page by itself and as i mentioned it worked fine on other posts using that view- so it must be that image perhaps. In any case i resized and renamed the image outside of wordpress and put it in place in the correct path which solved the issue for now.

I guess i wont spend any more of either of out times on it unless it happens again.

Thanks for your help as always

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.