jekyll-cloudinary icon indicating copy to clipboard operation
jekyll-cloudinary copied to clipboard

https://res.cloudinary.com/ssop/image/upload/ ..?

Open dbhumphreys opened this issue 6 years ago • 4 comments

Hello!

I'm trying to launch a project using your gem. I ran into trouble getting my images to upload to Cloudinary automatically, and I wrote them to ask about it.

The gem is producing my urls as:

https://res.cloudinary.com/ssop/image/fetch/c_limit,f_auto,q_auto,w_800/ssop-live/images/blog/mole-meatballs/market.jpg

Aleksandar Kostadinov at Cloudinary said that they should be:

https://res.cloudinary.com/ssop/image/upload/c_limit,f_auto,q_auto,w_800/ssop-live/images/blog/mole-meatballs/market.jpg

I've looked through the code for the gem and, as far as I can see, there's no way for me to change 'fetch' to 'upload' on my own.

Am I missing something?

Thanks so much!

  • David

dbhumphreys avatar Apr 05 '19 13:04 dbhumphreys

Hello David, my plugin uses Cloudinary's fetch API: https://cloudinary.com/documentation/fetch_remote_images#remote_image_fetch_url

The URL produced for your site should contain the full URL to the source image at the end. The protocol and domain are missing before ssop-live/images/blog/mole-meatballs/market.jpg

For exemple, on my own site, I get such URLs: https://res.cloudinary.com/nho/image/fetch/c_limit,f_auto,q_auto,w_560/https://nicolas-hoizey.com/links/2019/04/yuan-chuan-at-css-conference-shenzhen.jpg

nhoizey avatar Apr 05 '19 13:04 nhoizey

Thanks for the fast response!

How do you take advantage of the 'auto-upload remote' feature?

From that page you posted:

The auto-upload URL takes the following structure:

https://res.cloudinary.com/<your Cloudinary account's cloud name>/<resource_type>/upload//

dbhumphreys avatar Apr 05 '19 13:04 dbhumphreys

I got an answer from Cloudinary. I'll leave this here in case it's useful to anyone else:


Hi David,

I've had a look through the gem you linked to and the issue you've raised there. I think it clears up a few things. This gem implements the Fetch functionality, however, your account was set-up specifically for Auto-Upload. To use the Fetch functionality from the gem you'd need to provide the full URL to the resource as the gem owner mentioned then the type can stay as fetch. The Auto-upload mapping you've specified in your account, therefore, won't be used and the resource would be identified by the full URL given to the Fetch, rather than via the public_id and folder/mapping structure.

In short, if you only want to serve and manipulate remotely stored images then Fetch would work, however, as these aren't stored and managed in Cloudinary like uploaded assets they don't benefit from other features like upload presets and access permissions and more. A detailed explanation of the differences between Fetch and Auto-Upload can be found here: https://cloudinary.com/documentation/fetch_remote_images#comparing_fetch_to_auto_upload

In addition, to provide more security to your account should you choose to use Fetch so that only images from specific domains can be retrieved via the Fetch functionality is available under the Settings => Security section of your account. There you'll find a field called Allowed fetch domains: that will allow you to specify your own domain (in this case, but you can add more) that'll restrict Fetch requests on your account to those domains you whitelist.

Don't hesitate to get back with any questions you may have.

Best regards, Aleksandar Developer Support Engineer, Cloudinary

dbhumphreys avatar Apr 05 '19 14:04 dbhumphreys

How do you take advantage of the 'auto-upload remote' feature?

I don't.

As Aleksandar tells you in his message (thanks for sharing), the Fetch API behaves differently. I find it much easier to use, but you might need some features that only Auto Upload provides.

nhoizey avatar Apr 05 '19 14:04 nhoizey