2 ms·
There are actually some cases where you can gain by losslessly compressing these. For example, EXIF data in a JPEG is plain text, so gzip can help: $ curl
by cbr 11y ago
There are actually some cases where you can gain by losslessly compressing these. For example, EXIF data in a JPEG is plain text, so gzip can help:
$ curl -sS http://www.exiv2.org/include/img_1771.jpg | wc -c
32764
$ curl -sS http://www.exiv2.org/include/img_1771.jpg | gzip -9 | wc -c
31323
In this case, though, it often makes more sense to just remove the EXIF data.
PDF files can be even more compressible, at least ones that are text and layout as opposed to embedded images:
$ curl -sS http://www.polyu.edu.hk/iaee/files/pdf-sample.pdf | wc -c
7945
$ curl -sS http://www.polyu.edu.hk/iaee/files/pdf-sample.pdf | gzip -9 | wc -c
4336
- acqq 11y agoI agree, there is a small subset of such files where small pieces (or even the whole) can be compressed. If we just say "images" or "videos" there are also "uncompressed" variants of such, but such images or videos are always those which aren't even prepared to be on the web. E.g. "uncompressed AVI" or "Windows BMP." Those prepared for the web (e.g. MP4 or PNG) certainly aren't losslessly compressible. Those that want to deliver the videos or pictures should use the proper format and not depend on Brotli or zlib.