Skip Navigation

[Resolved] Views – Vertical crop not working on featured image

This support ticket is created 4 years, 10 months 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by bertrandB-3 4 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1609575

I am trying to: in Views, I am trying to show the cropped version of the featured image which is vertically cropped

Link to a page where the issue can be seen: hidden link (for example the images for VAM Communication, Scott Phillips, VAM Plasticienne or Donjon de Vez, as well as many others)

I expected to see: the featured images should be cropped at the top

Instead, I got: the featured image is vertically cropped at the center

In Views, I've used this code :

[wpv-conditional if="( $(wpcf-url-de-la-realisation) ne '' )"]<a href="[types field='url-de-la-realisation' output='raw'][/types]" target="new" rel="noopener noreferrer">[/wpv-conditional]
  <div style="background-color:rgb(51,51,51);box-shadow: 3px 3px 8px rgba(0,0,0,0.5);">
  <div style="padding:10px;text-align:center;">
    <h4 style="margin-bottom:0;color:#78ba4c;" class="h4box"><b>[wpv-post-title]</b></h4>
  </div>
    <img src="[wpv-post-featured-image size="custom" width="300" height="200" crop="true" crop_vertical="top" output="url"]" alt="[wpv-post-excerpt format="noautop"]" class="accueil1"/>
    
</div>
[wpv-conditional if="( $(wpcf-url-de-la-realisation) ne '' )"]</a>[/wpv-conditional] 

The crop_vertical="top" parameter seems to not be working. It was working fine previously.

I see that this bug was already reported here : https://toolset.com/forums/topic/views-template-custom-image-size-crop-specs-being-ignored/

I've made sure that I've updated the Views plugin, but there is no difference.

#1610205

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share admin access details so I can check that shortcodes are added as expected manner:

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1612097

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've added the attribute crop_horizontal="right" to the featured image shortcode so the shortcode looks like as given under now:

[wpv-post-featured-image size="custom" width="300" height="200" crop="true" crop_horizontal="right"  crop_vertical="top" output="url"]

Do you see the expected output?

More info:
=> https://toolset.com/documentation/user-guides/views/views-shortcodes/#vf-153425

#1612121

Thank you Minesh. Unfortunately, this has solved the vertical cropping problem but now there is another problem, which is that the part of the left side of the image is cropped, which is not the desired effect. For example, if you look at the first line of projects on hidden link you will see that the elements "Pierre Brissonnet" and "Tombapick" are now cropped in a way that isn't good (the left side of the screenshots have been cropped).

Previously, what was being done (and what I'm looking for) was this : the featured image was reduced to 300 px in width, and was cropped so that only the top 200 px were kept. This was very practical and allowed for nice layouts, and I don't really understand what has changed.

If there is no easy solution to achieve this with the latest versions of Toolset, I can always make it work through other means, but since this used to work perfectly well I figure it's probably better to "reinstate" the function on Toolset.

#1612189

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok got it. Our Devs has made few tests and they found something strange.

I need FTP access details so that we can access your files. Can you please send me FTP access details.

I have set the next reply to private which means only you and I have access to it.

#1613505

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've added the featured image shortcode as:

[wpv-post-featured-image size="custom" width="300" height="200" crop="true" crop_horizontal="" crop_vertical="top" output="url"]

I hope you see the expected results now.

#1613583

My issue is resolved now. Thank you Minesh!

I had a similar view used on the front page, which had the same problem. I added the

crop_horizontal=""

and it also works fine now.

Maybe the "null" option should be added on the shortcode reference page : https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-post-featured-image in case other people have the same problem ?