Unable to resize image from Workers

Hi,

We are having issues getting Image resizing to work as expected in a Worker.

We are on Business - which I know is needed for image resizing.

We can use the cdn-cgi/image/ method directly from a browser, but not in a worker. We cannot get the examples in the documentation to worth either.

To test it I copied the exact example from the documentation (https://developers.cloudflare.com/images/worker/) and it does not resize the image, but it does return the original image at its original size.

The Workers themselves all return as expected, we can add headers to images and do sub-requests for images etc. We just can’t get the images to resize from a worker.

Any suggestions?

Is the worker running on the same domain that have Business upgrade?

Thanks for the question @thomas4 - the Worker was running on the same domain. However, it prompted me to set up a new site on a subdomain to test - and everything is working there. My conclusion is that some redirect rules on the main domain origin was messing with the Worker sub requests.

Thanks!

1 Like

Yeah, redirects can be difficult to debug since you’re doing the resizing directly.

Glad you found out the reason :slight_smile: