Can't get Image Resizing to work reliably

For Workes & Pages, what is the name of the domain?

What is the error number?

9412

What is the error message?

Could not resize the image: Unknown or unsupported file type

What is the issue or error you’re encountering

Most images return error 9412 when I try to resize or convert using cdn-cgi/image/ URLs

What steps have you taken to resolve the issue?

Hi,

I can’t seem to get Image Transformations to work reliably via URL.

For MOST images I get ERROR 9412: Could not resize the image: Unknown or unsupported file type

Cloudflare Images → Transformations → Error Logs → Origin returned a non-image, e.g. a HTML page

The website is hosted on Siteground, but it is NOT a wordpress installation. This site is PHP scripts + MySQL.

I have tried several different images. Notably this one seems to work:
https://www.computerplug.com/cdn-cgi/image/format=webp,width=172,height=174,quality=85/images/32_Years.jpg

BUT when I rename the exact image to test.jpg it fails:
https://www.computerplug.com/cdn-cgi/image/format=webp,width=172,height=174,quality=85/images/test.jpg

Without Image Transformations the image works:

Siteground settings:
CDN - Disabled
Caching - NGINX Direct delivery - ON
Dynamic Cache - Cleared for testing
Memcached - OFF

Cloudflare (Free Plan) settings:
SSL: Full
Cache - Purged for testing
Development mode - Enabled for testing

Cloudflare - Images - Transformations:
computerplug com Enabled
Resize from any origin - ON

Any help you can offer would be greatly appreciated. Maybe I’m misunderstanding what Image Transformations is for, I was hoping to resize images and possibly convert to webp for optimization using the URL (rather than uploading the images to cloudflare manually or via API).

Thanks,
Derek

What are the steps to reproduce the issue?

Trying to convert the 32_Years.jpg file will work properly, but the exact same file renamed to test.jpg will then fail. See above for URLs.

Hi there,

It seems this is connected to the following error:

9412 — Origin returned a non-image, for example an HTML page. This usually happens when an invalid URL is specified, or server-side software has printed an error, or presented a login page.

Have there been any changes on your side, and when did you first see this issue occur?

1 Like

Thank you very much for your reply.

This is the first time that I’ve tried Image Resize, so the issue was not caused by any configuration changes.

I can load the non-resized image directly in my browser without issue, so I know the image exists and is able to be displayed.

My 32_years file works properly with image resize. I can optimize it, resize it, etc. But when I save it to a different filename it stops working.

Interestingly, I have not been able to find any other images that work- it only seems to work with my 32_years image (so far).

I’ve verified the file permissions and ownership.

I’m wondering if it has to do with caching somehow? Alternatively my website redirects http requests to https (and non-www to www), so I’m wondering if that has anything to do with it?

Tonight I will try setting up image resize on a different domain to see if I get different results.

Again, I appreciate your time and any input you may have.

Hello,

I’ve tried setting up a new website to see if I can get image resizing to work, but I’m still having trouble. I’m sure it’s something simple. I appreciate any comments anyone has.

  • I’ve made a new website and set the DNS to cloudflare
  • I’ve enabled Images → Transformations for the new zone
  • I have an image that is known to be working, and it loads on my webpage

However, when I try to access that image using a URL like this, it fails:
cdn-cgi/image/format=webp,width=172,height=174,quality=85/images/image.jpg

There doesn’t seem to be any errors in the website error log, but I may be reading the wrong log.

Does anyone have any ideas? Could a firewall or other security setting be blocking cloudflare?

Here is the error:
ERROR 9412: Could not resize the image: Unknown or unsupported file type

Thanks,
Derek

This topic was automatically closed after 15 days. New replies are no longer allowed.