Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qoiz mime type #300

Open
tansy opened this issue May 9, 2024 · 6 comments
Open

qoiz mime type #300

tansy opened this issue May 9, 2024 · 6 comments

Comments

@tansy
Copy link

tansy commented May 9, 2024

qoiz mime type

Me think that, alongside image/qoi mime type you should register image/qoiz type, defined as gzippped qoi format.
This adds simple, portable, available to every web server, fast and effective, entropy compression to format.
It (qoi+gz) often beats png, even with photographic images, still being many times faster than png, both with compressing and decompression.

There are quite a few tests done on this, even recently here, also I tried to implement it in qoibench, to show it in more palatable way, but get zlib error when otimize a code (-O3). Like with IMGP5493_seamless_2.png for example. If interested it's here.

@BenBE
Copy link

BenBE commented May 10, 2024

As gzip is not the only possible format for compression (bzip2, gzip, zstd, … come to mind), wouldn't it be simpler to just use image/qoi+gzip, image/qoi+bzip2, and image/qoi+zstd, etc.?

@rayrobdod
Copy link

When providing a compressed file to a web browser, conventionally you don't define a new mime type for "the same thing but with compression", you'd provide a Content-Encoding header describing the compression. So, in this case, you wouldn't have a Content-Type: image/qoiz, instead you'd still use Content-Type: image/qoi but also have a Content-Encoding: gzip header.

@tansy
Copy link
Author

tansy commented May 10, 2024

As gzip is not the only possible format for compression (bzip2, gzip, zstd, … come to mind), wouldn't it be simpler to just use image/qoi+gzip, image/qoi+bzip2, and image/qoi+zstd, etc.?

How do you want to distinguish between image/qoi, named `pic.qoi' and image/qoi+gz named `pic.qoi'?
SVG specifies `.svgz' but, because of many years of neglect it's mostly ignored.
And I'm not saying to create whole bunch of new extensions qoixyz for qoi.xyz compressed files, but one, that makes sense and can be commonly used and regognised.

@rayrobdod
Copy link

You distinguish the plain file from the compressed file by naming the compressed file pic.qoi.gz.
.svgz is ignored because you can just as easily name the file .svg.gz. .tgz is ignored because you can just as easily name the file .tar.gz. Just like those, a hypothetical .qoiz would be ignored because you can just as easily name the file .qoi.gz.

@tansy
Copy link
Author

tansy commented May 10, 2024

.svgz is ignored

It's not. Not by Firefox, nor Opera, nor Konqueror.

You distinguish the plain file from the compressed file by naming the compressed file pic.qoi.gz.

I had to check it, but with browsers mentioned above, it was true.

So, at least, when it comes to content encoding and not chrome browsers, it's true.

@zzo38
Copy link

zzo38 commented Jun 3, 2024

I think that it is a problem with MIME. The plus codes can be used (and I think that this is the best solution, if you are still using MIME types), but it is just a "added on" feature to MIME, and doesn't quite work in the ideal way for this purpose, but it is probably nevertheless, the thing to do in this case; you should use image/qoi+gzip.

File name suffixes such as .qoi.gz or whatever, are not MIME types, so that is a separate issue. Yes, that should be the suffix, and it would be easier for users to understand than .qoiz, but MIME types are a different identification than file names.

(I think ULFI (Unordered Labels File Identification) is better, which is why I made Scorpion protocol/file-format uses ULFI. So, you can use e.g. image:gzip<qoi> or gzip<image:qoi> for this case.)

(UTI (Uniform Type Identifier) is even worse, since parameters and add-ons are not possible; it can only specify class inheritance.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants