Skip Navigation

[Resolved] The image resizing is not consistent even though parameters used in shoetcode

This support ticket is created 6 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

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.

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 1 reply, has 2 voices.

Last updated by Luo Yang 6 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1169940

Hi

The image resizing is not consistent even though parameters used in shortcode - We are creating a car selling site that the general public can upload adverts to so we need to keep the images consistent in size (even though the files uploaded will be all different sizes and proportions based on the individual user)

I've been reading your manual guides and using different shortcode parameters but nothing has worked. The current setting I have in place is
[types field='classic-car-primary-image' title='%%TITLE%%' alt='%%ALT%%' align='center' size=' ' width='1200' height='800' resize='crop' proportional='true'][/types]

You will notice some images are taller than others in the boxes see page URL link here

hidden link

any help appreciated solving this problem

#1170315
cars.JPG

Hi,

I have checked the URL you mentioned above, all of those original images are smaller than the image size your shortcode settings:
width='1200' height='800'

For example, this one:
hidden link
It is 575 * 383

So Types image shortcode will output the original image without crop the images.

In your case, I suggest you specific a smaller image size, and enable "size" + "resize" attributes, like this:

[types field='classic-car-primary-image' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='241' height='160' resize='crop' ][/types]

It works fine in my localhost, see screenshot cars.JPG

More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image