image icon indicating copy to clipboard operation
image copied to clipboard

Nuxt Image Cloudflare Provider Serious Bug

Open nafiz6629 opened this issue 1 year ago • 6 comments

https://image.nuxt.com/providers/cloudflare#options In this Documentation there is written "/cdn-cgi/image/" will be automatically appended for generating URLs , Which is wrong. Proper prefix that should be appended is "/cdn-cgi/imagedelivery/" (reference: https://developers.cloudflare.com/images/manage-images/serve-images/serve-from-custom-domains/#custom-paths ) Please Fix This Bug

nafiz6629 avatar Oct 15 '24 13:10 nafiz6629

I am also facing same problem. Please Fix This Bug

masud-ictlayer avatar Oct 15 '24 13:10 masud-ictlayer

I faced the same issue too. Please fix this problem asap. Thank you!

atiflayer avatar Oct 15 '24 13:10 atiflayer

I encountered the same issue as well. Kindly resolve this problem as soon as possible. Thank you!

ICTsakib avatar Oct 15 '24 13:10 ICTsakib

This is not a bug nor a problem.

  • /cdn-cgi/image/ and /cdn-cgi/imagedelivery/ are two different services.

Everything working correctly with /cdn-cgi/image/

oritwoen avatar Oct 15 '24 13:10 oritwoen

This is not a bug nor a problem.

  • /cdn-cgi/image/ and /cdn-cgi/imagedelivery/ are two different services.

Everything working correctly with /cdn-cgi/image/

I also agree with you, BUT as per documentation [ /cdn-cgi/image/ ] isn't working.

So please I need more elaborate documentation. Could you give us a more step-by-step guide?

Please check the reference:

https://developers.cloudflare.com/images/manage-images/serve-images/serve-from-custom-domains/

https://developers.cloudflare.com/images/transform-images/transform-via-url/

ICTLAYER avatar Oct 15 '24 14:10 ICTLAYER

This is not a bug nor a problem.

  • /cdn-cgi/image/ and /cdn-cgi/imagedelivery/ are two different services.

Everything working correctly with /cdn-cgi/image/

I also agree with you, BUT as per documentation [ /cdn-cgi/image/ ] isn't working.

So please I need more elaborate documentation. Could you give us a more step-by-step guide?

Please check the reference:

https://developers.cloudflare.com/images/manage-images/serve-images/serve-from-custom-domains/

https://developers.cloudflare.com/images/transform-images/transform-via-url/

More as an example to prove myself with respect:

Not Working: https://nuxtimgtest.pages.dev/cdn-cgi/image/7mnVjFJmJT6C1-RIIlFtQg/cf0cac91-0a0e-4c86-c376-60597e37e700/public

Working: https://nuxtimgtest.pages.dev/cdn-cgi/imagedelivery/7mnVjFJmJT6C1-RIIlFtQg/cf0cac91-0a0e-4c86-c376-60597e37e700/public

@oritwoen @danielroe @renovate-bot @pi0 @atinux

ICTLAYER avatar Oct 15 '24 18:10 ICTLAYER

It's a bit confusing but let me clarify, Cloudflare has 2 image services

  • Transform on the fly, you give cloudflare an image link, it transforms, this is what NuxtImage provider cloudflare, =>https://yourdomain.com/cgi/image/w=500/<your_image_link>
  • Images service, you store image in cloudflare, they do pre-tranform (known as transform preset), then serve image => https://yourdomain.com/imagedelivery/<imageID_that_stored_in_cloudflare>

In your example, you are using option 2, the Image service, while NuxtImage provider cloudflare targets option 1. Maybe you can use https://image.nuxt.com/advanced/custom-provider for your case

phi0411141 avatar Nov 13 '24 03:11 phi0411141

Thanks @phi0411141 I agree with the fact that these are two separate services.

The recommendation with custom provider is a good direction IMO :)

Baroshem avatar Dec 11 '24 11:12 Baroshem

Currently Nuxt Image only supports transforming images outside of Cloudflare Images, see: https://developers.cloudflare.com/images/transform-images/

I agree that the naming is very confusing!

There is an open feature request to support Cloudflare Images: https://github.com/nuxt/image/issues/427

Over there I posted a custom provider that you can add to you project that works with Cloudflare Images. It works with serving from https://imagedelivery.net/ as well as your custom domain. Hope someone will adapt it to an actual Nuxt Image provider :)

@nafiz6629 Please close this issue in favor of #427 (dont forget to upvote)

P.S. You guys can also make PRs and changes or add the missing provider, this is an open source project :)

MickL avatar Dec 22 '24 12:12 MickL