Resize of PNG image produces JPEG

Sample PNG file served on my domain as https://romashka.neuraloom.dev/slide.png

FileMagic(mime_type='image/png', encoding='binary', name='PNG image data, 2667 x 1500, 8-bit/color RGB, non-interlaced')

When passed through Cloudflare Image resize https://romashka.neuraloom.dev/cdn-cgi/image/width=1870/slide.png produces JPEG file served with content-type=image/jpeg

FileMagic(mime_type='image/jpeg', encoding='binary', name='JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, progressive, precision 8, 1870x1051, components 3')

But when I try to resize another file https://romashka.neuraloom.dev/dog.png

FileMagic(mime_type='image/png', encoding='binary', name='PNG image data, 215 x 207, 8-bit colormap, non-interlaced')

with the following url https://romashka.neuraloom.dev/cdn-cgi/image/width=1870/dog.png
I get PNG file with content-type=image/png

FileMagic(mime_type='image/png', encoding='binary', name='PNG image data, 215 x 207, 8-bit colormap, non-interlaced')

Why is that - is this a bug or intended behaviour when certain PNG files are served as JPEG?
Is there a way to force output file type? (we want png)

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