Support for jpeg?
nitishxp opened this issue · comments
just it give support for jpeg ?
I didn't implement jpeg support because the magic byte at the beginning wasn't as ASCII character. But since JavaScript supports Unicode symbols in its variables it might be possible.
At least ÿØ
, the magic byte 0xffd8
is a valid JavaScript identifier.
I'll try to add this when I have time.
I did some research and tried to create a JavaScript file with a JPEG header but it fails to run in Firefox and Chrome. Both browsers complain about an illegal symbol (ÿØ
) in the code. Since I cannot avoid the magic byte, I don't see any way to support JPEG.
Does this technique works on new browser ? if yes can u show me a small example ? because i tried its not working
A small example would be:
<html>
<head>...</head>
<body>
<script src="image.js.gif"/>
</body>
</html>
where image.js.gif
is the gif file created by imagejs gif image.js
.
About the browser support. I made this tool a few years ago and some browsers fixed that behaviour completely, Chrome for example (see #5). Also many security and script blocking addons (e.g. NoScript for Firefox) block this behaviour.
Ok thank you for the help :)