Hacker News new | ask | show | jobs
by nyanpasu64 660 days ago
I want a return to an enforced norm of different extensions for lossy and lossless files. With the adoption of WebP, I've repeatedly encountered shady CDNs substituting in lossy .webp files in place of lossless .png files, in a way you can't tell by the filetype alone when saving a file (whereas you could tell when saving a .png URL but get a .jpg file instead). I fear the same will happen with .jxl files.
5 comments

The lossy vs lossless distinction loses its meaning in the absence of provenance. You can compress a bitmap into a .jpg q=1, and then save it as a .png. The .png is technically lossless, but that clearly doesn't tell much about the image quality. Conversely, many cameras shoot JPEG as the source format. The .jpg is, in effect, the master copy from which the loss is measured (obviously there are losses from the sensor data, but still).
I thought most cameras shot RAW and then chose a format to save to (some letting you save RAW itself, at least with Android).
And a CDN could want to do it, because you can degrade a png in lossy ways from the original that make it compress much better, even though the compression is lossless.
It wouldn't be effective in practice. There are tools like pngquant that does lossy compression of png. That shady CDN could just as easily recompress png files.

https://pngquant.org/

In the world of the web, it is the mime type, not the extension, which tells you the format.

It's kinda just lousy OS's which aren't correctly storing the mime type for each file.

I voiced the exact same thing for many years and unfortunately the author of jxl doesn't agree with that. I wish the same as well we could just tell by file type.
tinypng.com compresses ‘lossless’ .pngs