Skip Navigation

[Resolved] Crop image function with Amazon S3

This support ticket is created 5 years, 8 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 12 replies, has 3 voices.

Last updated by Shane 5 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1241702

I use shortcode to crop post image to some special size:

[wpv-post-featured-image size="custom" width="60" height="60" crop="true" class="img-rounded"]

, and instead of cropped image I see no image

I host my images on Amazon S3, so, I think there is some issue about how crop function works with file write permission... or some path issue...

Please advise how to fix it?

#1241737

...and instead of cropped image I see no image
Hi, can you give me some additional details?
- Is the img tag included in the page source code?
- Is the image URL included in the img tag? If so, what is the image path (URL)?
- Is the image 404?

If you can show me in the browser, I'll be able to tell more about what is happening. Let me know if I need to log in to see this.

#1241763

Hi!
There is no img tag on the page as result.
On Siteground hosting and local upload files storage it works well. I switched to Kinsta hosting (this is point 1) and move uploads to Amazon S3. So, it could be issue with shortcode processing at Kinsta hosting or some read/write permission issue with Amazon S3

URL example: hidden link
Images you could find (not find actually) at the bottom of the page here: hidden link

So, you could see images with posts there is no featured images, but there is no images for posts with featured images.

Code here is:

[wpv-post-featured-image size="custom" width="60" height="60" crop="true" class="img-rounded"][wpv-conditional if="( '[wpv-post-featured-image]' eq '' )"]thumb[/wpv-conditional]

[wpv-post-title]

[wpv-post-taxonomy type="category" format="name"]

#1241777

Okay is the featured image shown if you remove the custom size and use a standard WP size temporarily, like thumbnail?

[wpv-post-featured-image size="thumbnail" class="img-rounded"]
#1242107

Yes, it works if I remove custom size.

#1243702

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kirill,

As christian is currently on vacation at the moment, could you try this plugin below and let me know if it helps ?
https://wordpress.org/plugins/regenerate-thumbnails/

Thanks,
Shane

#1243776

It could work, but this is not solution, I'm looking for. This plugin will regenerate images by request. So, it will create images for entire media library for exact (limited amount) of sizes (I think 4 sizes). I looking for solution to generate required size for picture on the fly (just by request) as it is should work for crop="true" param.
So, I need your solution - if crop="true" will work with Kinsta/Amazon S3 or will not work at all at this hosting.

#1244218

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kirill,

Could you provide a copy of the site so that I can test here. Sorry for the delayed response.

The reason is that I want to verify that this is not an issue on the site itself so that I can make a report to our development team about this.

Seeing that this is not working as intended you will probably need to try defining your custom image size as a hook and then load that custom image size.
hidden link

To provide the duplicator you can use the link below for instructions.
https://toolset.com/faq/provide-supporters-copy-site/

Quick question is this a repeatable image field ?

Thanks,
Shane

#1244219

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

nevermind i see its you featured image.

#1245356

Hi! Sorry for delay in reply.
I'm not sure if I understand you right. So you still need copy of my site?
I'm sure there is nothing wrong with my site at all. There are two changes only on site, since I change hosting and it was ok with crop function:
- I changed hosting to Kinsta, so probably this is issue with Kinsta cache or other settings. I don't see how copy of my site will help here. So, it will be nice if you could explain hosting requirements to make crop function works well.
- I changes images location to Amazon S3. So, here I also don't see how site copy will help you. I just want to understand if your crop function works with S3 at all? Do you have experience here?

#1246040

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kirill,

The reason for getting a copy of the site was to isolate the issue. To determine if the issue was on amazon s3 end or was it the site itself. Sometimes its a bit difficult to check this even if all plugins are disabled.

So the best thing for us as supporters to do is to get a local copy of the site where we have a strictly controlled environment. If the issue is still there on our local server even with minimal setup of your site then it means its something for our 2nd tier supporter to investigate and look at .

The next thing I was suggesting is that since on s3 you had issues with the cropping function. You can actually declare your custom size and then load that custom size with our shortcode.
hidden link

This was to determine if the resize would work for custom sizes. Its just steps in debugging to find what works and what doesn't.

However I do believe s3 has an issue with the cropping function. Also the requirements of our plugins can be seen below.
https://toolset.com/toolset-requirements/

"There are two changes only on site, since I change hosting and it was ok with crop function"

You are saying that the cropping function now works since you've changed host correct?

Please let me know.
Thanks,
Shane

#1249727

Hi! Sorry for delay in reply.
I need more time to investigate the issue on my side.

Regarding

---
"There are two changes only on site, since I change hosting and it was ok with crop function"

You are saying that the cropping function now works since you've changed host correct?
---

I mean opposite - after I change hosting and moved images to S3 crops stopped works. So, now it doesn't work. Since both Kinsta hosting and Amazon S3 really popular services for wordpress, and crop feature is really nice, I believe it will be nice to solve it for entire Toolset community.

#1253061

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kirill,

I had asked for some assistance with this one.

Our second tier supporters to see if Toolset > Settings > Custom Content > Images > Allow resizing of remote images is checked. If it isn't could you check it and let me know if the issue still remains ?

Thanks,
Shane