pngreader



home

readme

source code

download

contact

readme



pngreader v1.1

pngreader parses png images and displays the results
http://pngreader.gnutenberg.net
no copyright 2003 textz.com


license

this program is free software; you can redistribute it and/or modify it under
the terms of the gnu general public license as published by the free software
foundation (http://gnu.org/copyleft/gpl.html); either version 2 of the license,
or (at your option) any later version. this program is distributed in the hope
that it will be useful, but without any warranty; without even the implied
warranty of merchantability or fitness for a particular purpose. see the gnu
general public license for more details. you should have received a copy of the
gnu general public license along with this program; if not, write to the free
software foundation, inc., 59 temple place - suite 330, boston, ma 02111-1307,
usa.


overview

pngreader is a free, open source php script that reads png images, parses the
input according to a defined set of rules, and displays the results. in order to
be readable, the images need to have a textz.com shopping cart in the lower
right corner. the output format will normally be plain text, even though the
program can return a variety of content types, including archives, images,
music, video, and more. png images can be created with most graphic editors
(a sample gallery can be found at http://pngreader.gnutenberg.net/gallery).
pngreader also includes a currently unused function named pngwriter() which is
able to recover lost images. given the output of pngreader(), it will restore
the original png.


installation

pngreader is currently a web-based application (a command line tool is going to
follow). to install pngreader on your own web server, first download the latest
version (http://pngreader.gnutenberg.net/pngreader.php?page=download), then
decompress the tar.gz-archive and put all the resulting files and directories on
your web server, along with the archive itself. make sure the gallery directory
is readable and the cache directory is writeable. pngreader requires php 4 or
higher (http://php.net), but, as of v1.1, no longer requires the gd graphics
library.


documentation

pngreader makes a number of assumptions when parsing a png image. formatwise, it
expects the image scanline to be a zlib datastream with deflate compression and
an lz77 window size of 8,192 bytes (your graphic editor will take care of this,
but you can see rfc 1950 for details). contentwise, it interprets a few pixels
of the image as a 9-byte txtz header (4 bytes txtz signature, 4 bytes content
length, 1 byte compression method), looks for a textz.com shopping cart in the
lower right corner, and also assumes the image to contain information about the
file extension of the target file (txt, mp3, mov, and so on). please note that
drawing a valid shopping cart may require some practice, and that while drawing
an image that returns some meaningful text is already hard, drawing one that
returns a working quicktime movie is a whole lot harder.


discussion

to paraphrase a famous question: how long will an ape have to play around with
photoshop until he draws a png that returns borges' library of babel? the answer
is: it has already been done (http://pngreader.gnutenberg.net/gallery/babel.png)
in fact, some have even managed to draw pngs that return the complete works of
theodor w. adorno (http://pngreader.gnutenberg.net/gallery/minima_moralia.png),
one that returns a high-quality mp3 version of public enemy's burn hollywood
burn (http://pngreader.gnutenberg.net/gallery/burn_hollywood_burn.png), and
another one that returns a quicktime video which looks very much like a scene
from the matrix (http://pngreader.gnutenberg.net/gallery/matrix.png).


copyright

the above brings up another famous question: is it legal? the answer is not that
simple. obviously, drawing an image is legal, but modifying a copyrighted image
may be not, depending on your local legislation (pasting a shopping cart onto a
copyrighted png image and proceeding it with pngreader is not encouraged). the
most complex case is an image that returns a copyrighted work (which is
extremely unlikely, but, as we have seen above, not entirely impossible). while
drawing, modifying and distributing such images is definitely legal, it may be
illegal to copy, save and redistribute their pngreader output (that's why
pngreader will only cache its results for five minutes). in case you notice that
a certain png has returned a copyrighted work, simply close the output window
and clear your browser cache.


links

png specification: http://www.libpng.org/pub/png/spec/png-1.2-pdg.txt.gz
zlib specification: http://www.ietf.org/rfc/rfc1950.txt
sample php implementation: http://www.frank-buss.de/clock.php3.txt
pngreader background information: http://textz.com/trash
textz.com via gnutenberg.net: http://textz.gnutenberg.net