Hijacking HTML canvas and PNG images to store arbitrary text data
igorkromin.net
igorkromin.net
Lots more appealing than a square of grey noise, lots easier to understand when you run across it a year later...
edit: some more details on this, with examples https://nedbatchelder.com/blog/200806/spore_creature_creator...
It is possible to catch the force touch event, but as far as I can tell it overrides the regular touch event so all you can do is prevent the event and print "you pressed too hard, please release and try again, gently".
First off, you have to put a pretty decent amount of pressure on it to trigger the 3D touch behavior instead of the long press behavior.
Secondly, when you do trigger 3D touch, it goes into "peek" mode, and you have to keep pressing, and in fact press even harder, before it will "pop" and actually navigate to the image. In the "peek" mode simply swiping up will give you the Save Image action.
And if you're the Hulk and every single touch is a force touch, well, even gripping as hard as I can, it still forces the "peek" mode for a second or two before "popping".
It's handy to have a second way to trigger save, but having to include the explanation in order to teach users how to execute the maneuver is not great UX. "Press gently and hold to save. Or, if your phone supports Force Touch and has it enabled, press pretty hard (but not _too_ hard) and swipe up to save. If it doesn't work, try it again."
meaning 3or4 chars per pixel. then tried to do boyer moore on a dynamic shader. At the time I felt I had the fastest string searching tool on the web, in the world... https://github.com/byteface/GTP/blob/master/play/simplified/...
it could all the 'the' in moby dick in a split second. which at the time would take textmate a few seconds.
showed a mate who then did his own storage only implementation, closer to what you are doing: https://github.com/claus/PNGDrive
years after saw someone did one that stored data in flckr. Think it was posted here.
To be honest, IMO the idea is senseless as pure storage as theres other better options. like zip. But if you are going to do something with it on GPU that's when it has new potential.
But anyway, if the problem is that the json file is opened in a new tab instead of downloading, can't you just encode it with a non-text media type in the data-uri so the browser doesn't understand it?
E.g, data:application/octet-stream instead of data:image/png which is what you claim works right now
Download attribute let's you choose a filename. But giving up on that for safari sounds like a decent tradeoff to me (with the current approach you end up with a nonsense png extension in the save file anyway).
Testing with a quick demo: https://codepen.io/anon/pen/wYpBry?editors=1010, it seems like mobile safari will show it as unknown.txt but have options to save to files/dropbox etc. Kind of complicated but probably still less confusing than a png file.
I always felt like data: urls could obtain a lot more utility if disposition and filename attributes were added to it, but... uhm, browser makers don't seem to agree, and the syntax would make it difficult to add features like that whilst staying backwards compatible.
I can confirm that, most of my time spent for browser support is on IE11 and Safari. Everything in Edge, Firefox and Chrome generally works fine.
demo at https://qrdio.com
One of the interesting ways is adding is adding noise generated by inverse Fourier transforms.
http://repro.grf.unizg.hr/media/Ante/Radovi/033008_1_FINAL.p...
It should be possible to binarily concatenate compressed (RAR'd or ZIP'd) text data directly to a JPG.
Then you can save it as an image on the client, or uncompress it in the client browser and read the data.
The differences are 1) the saved image won't look like random pixels-- it'll look like whatever base image you choose and 2) you don't have to worry about writing the encoding/decoding data as bitmap stuff.
https://en.wikipedia.org/wiki/Deterministic_acyclic_finite_s...
The DAWG contained all french words, in a convenient small picture.