From a6f642b99361f0c8c28c106593127246346f349a Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Wed, 4 Jul 2012 10:00:21 -0500 Subject: [PATCH] [png2uri] Added README.txt --- png2uri-1.0.0-README.txt | 89 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 png2uri-1.0.0-README.txt diff --git a/png2uri-1.0.0-README.txt b/png2uri-1.0.0-README.txt new file mode 100644 index 000000000..17a7558aa --- /dev/null +++ b/png2uri-1.0.0-README.txt @@ -0,0 +1,89 @@ +/* + png2uri + + NO COPYRIGHT RIGHTS ARE CLAIMED TO THIS SOFTWARE. + + To the extent possible under law, the author has waived all copyright and + related or neighboring rights to this work. This work is published from + the United States of America in 2012. + + The png2uri software may be used freely in any way. + + The source is the original work of the person named below. No other person + or organization has made contributions to this work. + + ORIGINAL AUTHORS + The following people have contributed to the code or comments in this + file. None of the people below claim any rights with regard to the + contents of this file. + + Glenn Randers-Pehrson + + png2uri is a command-line application that creates an HTML "img" tag on + standard output containing a data URI, from a PNG file or from standard + input. + + Usage: png2uri [file] + + Requires /bin/sh and a uuencode(1) that takes the "-m" option to mean + to encode in base64. A surprising number of machines that I've tried + (3 out of 8) don't have uuencode installed. + + REFERENCES: + http://en.wikipedia.org/wiki/Data_URI_scheme + Masinter, L. "RFC 2397 - The "data" URL scheme", + Internet Engineering Task Force, August 1998 + + If you prefer a web-based converter or a java application, this isn't + it. Use your search engine and look for "png data uri" to find one. + + To do: test on various platforms. The following have been tried + + Ubuntu 10.04 (data is folded to 60 characters) + Linux glenn.rp 2.6.32-41-generic #91-Ubuntu SMP Wed Jun 13 11:43:55 + UTC 2012 x86_64 GNU/Linux + + Ubuntu 12.04 (FAILED: uuencode not found but manpage for POSIX uuencode + exists) + Linux scooby 3.0.0-22-generic #36-Ubuntu SMP Tue Jun 12 17:37:42 UTC 2012 + x86_64 x86_64 x86_64 GNU/Linux + + SunOS 5.10 (data is folded to 68 characters) + SunOS freddy 5.10 Generic_147441-13 i86pc i386 i86pc + SunOS blade 5.10 Generic_144488-12 sun4u sparc SUNW,Sun-Blade-2500 + + Sunos 5.11 (data is folded to 68 characters) + SunOS weerd 5.11 oi_151a4 i86pc i386 i86pc + + FreeBSD 8.0 (data is folded to 76 characters) + FreeBSD shaggy.simplesystems.org 8.0-RELEASE-p1 FreeBSD 8.0-RELEASE-p1 + #1: Mon Dec 21 11:26:14 CST 2009 + zsh@shaggy.simplesystems.org:/usr/src/sys/i386/compile/GENERIC + i386 + + Red Hat? (FAILED: uuencode not found but manpage for POSIX uuencode + exists) + Linux studio.imagemagick.org 2.6.18-308.4.1.el5xen #1 SMP Tue Apr 17 + 17:49:15 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux + Linux magick.imagemagick.org 3.4.4-3.fc17.x86_64 #1 SMP Tue Jun 26 + 20:54:56 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux + + This script can be trivially modified to support another image format + (e.g., change PNG to JPG and "image/png" to "image/jpeg" throughout). + + To do: do that, via a "-f/--format jpg|jpeg|png|bmp|gif" option and by + inspecting the filename extension. + + If you only want the data uri and not the surrounding "< img src= .. >" + simply use your text editor to get rid of it. + + To do: do that via a -u/--uri-only option. + + To do: find out if the script works on Windows and Mac or can be modified to + do so. + + To do: make it work as a drag-and-drop application. + + To do: But keep it simple! + +*/