This looks like the original thread: https://news.ycombinator.com/item?id=4209052
A file that’s both an acceptable HTML page and a JPEG (2012)
41–50 of 72 posts
Re: A file that’s both an acceptable HTML page and a JPEG (2012)
#42But what does the Unix "file" command say?
squirrel: HTML document, ASCII text
BSD file(1) on both Linux and NetBSD. Solaris also identifies it as HTML.Re: A file that’s both an acceptable HTML page and a JPEG (2012)
#43I'd like to build a system for distributing mini-apps as images, bypassing the App Store.
A JavaScript bookmarklet could be used to provide a basic "bootloader" that provides an "upload image" button. Then a binary representation of the HTML could be loaded from the image data.
The problem I had was lossy recompression - colours bleed across edges, so the binary data was corrupt after the first save. I'm still not sure how to work around that problem.
Re: A file that’s both an acceptable HTML page and a JPEG (2012)
#44Also of note, klange's unofficial résumé in C https://gist.github.com/klange/4042963
Re: A file that’s both an acceptable HTML page and a JPEG (2012)
#45Earlier quoted context omitted.
https://en.wikipedia.org/wiki/Squirrel > Squirrels are members of the family Sciuridae, a family that includes small or medium-size rodents. The squirrel family includes tree squirrels, ground squirrels, chipmunks , marmots (including woodchucks), flying squirrels, and prairie dogs amongst other rodents. (TLDR, chipmunks are squirrels)
The Sciuridae family includes chipmunks; that doesn't mean chupmunks are squirrels, nor that marmots are squirrels.
> Marmots are large squirrels
Re: A file that’s both an acceptable HTML page and a JPEG (2012)
#46It's a pity that phones recompress the JPG when doing Save To Camera Roll. I'd like to build a system for distributing mini-apps as images, bypassing the App Store. A JavaScript bookmarklet could be used to provide a basic "bootloader" that provides an "upload image" button. Then a binary representation of the HTML could be loaded from the image data. The problem I had was lossy recompression - colours bleed across e…
Re: A file that’s both an acceptable HTML page and a JPEG (2012)
#47Earlier quoted context omitted.
While definitely cool, I wonder how effective this is. Code/random binary data should have different characteristics than image data.
DEFLATE, which is used by PNG, is a general purpose LZ77-like compression algorithm suitable for all kinds of repetitive data.
Each of the possible filters is very simple, but the difference between a great PNG exporter, a mediocre one, and a trash fire is the use of a heuristic to decide which of the pre-processing filters should be applied to each line of output. libpng, the free implementation, includes a heuristic that does a fairly OK job, if you just don't implement a heuristic and use no filtering at all, the results are enormous PNG files as seen in turn of the century Adobe Photoshop. So, no, a general purpose compression algorithm isn't very good for image data on its own.
(Choose for yourself whether you think Adobe wanted to discourage use of a popular free image format in favour of licensed formats for which it held relevant IP, or their development team are just incompetent morons, or both).
Re: A file that’s both an acceptable HTML page and a JPEG (2012)
#48It's a pity that phones recompress the JPG when doing Save To Camera Roll. I'd like to build a system for distributing mini-apps as images, bypassing the App Store. A JavaScript bookmarklet could be used to provide a basic "bootloader" that provides an "upload image" button. Then a binary representation of the HTML could be loaded from the image data. The problem I had was lossy recompression - colours bleed across e…
Re: A file that’s both an acceptable HTML page and a JPEG (2012)
#49But what does the Unix "file" command say?
$ curl -s http://lcamtuf.coredump.cx/squirrel/ | file -
/dev/stdin: JPEG image data, JFIF standard 1.01, resolution (DPI), density 300x300, segment length 16, comment: "body { visibility: hidden; } .n { visibility: visible; position: absolute; ", baseline, precision 8, 1000x667, frames 3
file(1) version 5.32-2ubuntu0.1.