Re: Allow a PNG to begin with a #! line
Glenn Randers-Pehrson <[email protected]>
| Newsgroups | gmane.comp.graphics.png.general |
|---|---|
| Message-ID | <CA+PdXcuqjaxcVEmaAXA0kzuJH9SZ2uTN7J359LdmKBBtpwwzAQ@mail.gmail.com> |
ImageMagick is perfectly happy to read the "blue.epng" file that I included
in my prior message:
magick identify inline:blue.epng
inline:blue.epng=> PNG 16x16 16x16+0+0 8-bit sRGB 2c 277B 0.000u
0:00.009
Glenn
On Tue, Nov 1, 2016 at 9:20 PM, Soni L. <[email protected]> wrote:
> In terms of binary, a #! "line" is just a "#!", followed by arbitrary
> non-\x0A bytes, followed by a single \x0A byte.
>
> A #! is not a proper "line" in the sense that it can only exist on a file
> with "lines", a #! is simply what I described above. Ocaml uses #! with
> (binary) bytecode files, as weird as that may sound.
>
> (Sad that I need to give up on backwards compatibility to have executable
> esolang[1] images. We do what we have to, I guess.)
>
> [1]: Lots of image-based esolangs:
> - http://esolangs.org/wiki/Piet
> - http://esolangs.org/wiki/Brainloller
> - http://esolangs.org/wiki/Braincopter (variation of the above)
> - http://esolangs.org/wiki/Mycelium
> - etc, you get the idea.
>
> On 01/11/16 10:01 PM, Glenn Randers-Pehrson wrote:
>
> A PNG file does not have "lines"; it's binary. But you could do something
> like
> this, with the "#!something" followed by a base64-encoded PNG (like a
> "data URL"):
>
> $ cat blue.epng
> #!/usr/local/bin/display_epng
> data:image/png;base64,
> iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABGdBTUEAALGP
> C/xhBQAAACBjSFJN
> AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUA
> AP////973JksAAAA
> AWJLR0QB/wIt3gAAAAd0SU1FB+ALARMzAYjwr9kAAAAMSURBVAjXY2Ag
> DQAAADAAAceqhY4AAAAl
> dEVYdGRhdGU6Y3JlYXRlADIwMTYtMTEtMDFUMTk6NTE6MDEtMDQ6MDBvJnzc
> AAAAJXRFWHRkYXRl
> Om1vZGlmeQAyMDE2LTExLTAxVDE5OjUxOjAxLTA0OjAwHnvEYAAAAABJRU5ErkJggg==
>
> That wouldn't require defining a PNG-2.0, the data can contain a regular
> PNG as demonstrated above. So,
> an EPNG is simply a #-delimited header followed by a data URL containing
> image data.
>
> Glenn
>
> On Tue, Nov 1, 2016 at 4:43 PM, Soni L. <[email protected]> wrote:
>
>> EPNG was a bust, so, can PNG be changed so that a #! line at the start
>> of a PNG is ignored/skipped?
>>
>> This breaks backwards compatibility, so might need to be delayed until a
>> "PNG 2.0".
>>
>> ------------------------------------------------------------
>> ------------------
>> Developer Access Program for Intel Xeon Phi Processors
>> Access to Intel Xeon Phi processor-based developer platforms.
>> With one year of Intel Parallel Studio XE.
>> Training and support from Colfax.
>> Order your platform today. http://sdm.link/xeonphi
>> _______________________________________________
>> png-mng-misc mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/png-mng-misc
>>
>
>
>
> ------------------------------------------------------------------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
>
>
>
> _______________________________________________
> png-mng-misc mailing listpng-mng-misc-5NWGOfrQmneRv+LV9MX5ugtCRVl27V+i0wdF1cv0I5s@public.gmane.org://lists.sourceforge.net/lists/listinfo/png-mng-misc
>
>
>
> ------------------------------------------------------------
> ------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today. http://sdm.link/xeonphi
> _______________________________________________
> png-mng-misc mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/png-mng-misc
>
>
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
png-mng-misc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/png-mng-misc