From 3206d31af5a348a63e200e245b76df8c1294a58d Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Tue, 3 Jul 2012 16:24:28 -0500 Subject: [PATCH] [png2uri] Started png2uri branch and added "png2uri" script. --- png2uri | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 png2uri diff --git a/png2uri b/png2uri new file mode 100755 index 000000000..0c06f9bb0 --- /dev/null +++ b/png2uri @@ -0,0 +1,49 @@ +#!/bin/sh +# +# 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. +# +# This 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. +# +# 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. +# + +case x$1 in + x) + # Convert standard input. + echo "\"PNG\"" + ;; + *) + # Convert the named file. + echo "\"$1\"" + ;; +esac