Skip Navigation

[Resolved] Images not resizing/cropping in image gallery

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 4 replies, has 2 voices.

Last updated by kristofG 1 year, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2572183

I have an old Avada site and used Toolset to create this property listing website.
Each property has an image gallery and on the individual pages, the -scaled.jpg images loads fine, see hidden link

However, on the overview page hidden link the Swiper Gallery is built using the Avada Shortcode. While it loads the images fine, the Toolset shortcode part of it to crop the images is not working, which results in the galleries using the full width 10+ MB images 🙁

This is my code

[fusion_images picture_size="auto" hover_type="none" autoplay="no" columns="1" column_spacing="0" scroll_items="" show_nav="yes" mouse_scroll="no" border="no" lightbox="no" hide_on_mobile="small-visibility,medium-visibility,large-visibility" class="search-results" id=""]
[wpv-for-each field="wpcf-image-gallery"]
[fusion_image image="[types field='image-gallery' output='raw' size='medium' resize='crop' width='312' height='208'][/types]" image_id="[types field='image-gallery' output='raw' ][/types]|full" /]
[/wpv-for-each]
[/fusion_images]

#2572491

Hello,

In Toolset image field shortcode, you can not use both attributes in the same time:
- output='raw'
- size='medium'

Please try to modify the shortcode from:
[types field='image-gallery' output='raw' size='medium' resize='crop' width='312' height='208'][/types]

To:
[types field='image-gallery' size='medium' resize='crop' width='312' height='208'][/types]

And test again.

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

#2572499

Will it still output the raw url because the Avada shortcode needs the raw url for the [fusion_image] shortcode.

#2572517

You can try attribute url="true", for example:
[types field='image-gallery' size='medium' resize='crop' width='312' height='208' url='true'][/types]

#2572555

When I removed output='raw' then the image would not load, it displayed some data64 code as the src.
But the url='true' allowed me to use the correct cropped image.