🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.graphics.pixutils
Article #709

rletojpeg: Utah Raster Toolkit RLE => JPEG /bin/sh script

#709
From: Rich Thomson
Date: Sun, 03 Nov 1991 01:56
99 lines
3539 bytes
For those of you who use the Utah Raster Toolkit and would like to
play with the free JPEG software written by Tom Lane & co., here is a
little shell script to convert from RLE => JPEG via the cjpeg program.
It uses the default settings for cjpeg (Q=75, in particular); if you
want fancier options you can either hack the script (please send me a
diff if you do) or run the pipeline directly.

The copyright is just the standard X Window System style copyright.

						-- Rich
  ``Read my MIPS -- no new VAXes!!'' -- George Bush after sniffing freon
	    Disclaimer: I speak for myself, except as noted.
UUCP: ...!uunet!dsd.es.com!rthomson			Rich Thomson
Internet: rthomson@dsd.es.com	IRC: _Rich_		PEXt Programmer

#!/bin/sh
#
# rletojpeg [-o outfile] [infile]
#
# Shell script for RLE => JPEG conversion.
#
# Uses Tom Lane's cjpeg program and Jef Poskanzer's PBM+ tiftopnm program.
#
# (I go through the intermediate TIFF format because the cjpeg program
#  apparently doesn't recognize the magic number for a PPM plain file
#  and I didn't feel like diddling with the source code until I am sure
#  what the problem is.)
#
# Rich Thomson
# November 2nd, 1991
#
#	   Copyright 1991 by Evans & Sutherland Computer Corporation,
#			      Salt Lake City, Utah
#
#			      All Rights Reserved
#
#     Permission to use, copy, modify, and distribute this software and its
#	documentation for any purpose and without fee is hereby granted,
#     provided that the above copyright notice appear in all copies and that
#	both that copyright notice and this permission notice appear in
#   supporting documentation, and that the names of Evans & Sutherland not be
#       used in advertising or publicity pertaining to distribution of the
#	      software without specific, written prior permission.
#
#   EVANS & SUTHERLAND  DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
#     INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
#     EVENT SHALL EVANS & SUTHERLAND BE LIABLE FOR ANY SPECIAL, INDIRECT OR
#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
#     DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
#	TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
#			 PERFORMANCE OF THIS SOFTWARE.
#
usage()
{
    echo "rletojpeg [-o outfile] [infile]"
    exit 1
}

convert()
{
    rleflip -v $file | rletotiff -o $tiff; tifftopnm $tiff 2>&- | cjpeg
}
ofile="-"

if [ $# -gt 3 ]; then
    usage
fi

if [ "X$1" = "X-o" ]; then
    shift
    ofile=$1
    shift
fi

if [ $# -gt 1 ]; then
    usage
fi

file=$1
if [ $# -eq 0 ]; then
    file=""
    tiff=/tmp/stdin.tiff
else
    if [ "X$file" = "-" ]; then
	file=""
	tiff=/tmp/stdin.tiff
    else
	f=`basename $file .Z`
	f=`basename $f .rle`
	tiff=/tmp/${f}.tiff
    fi
fi

if [ $ofile = "-" ]; then
    convert
else
    convert > $ofile
fi
rm $tiff
Technical Details
Message-ID: <1991Nov3.015640.28466@dsd.es.com>
Path: arc1-ca.pugleaf.net!wupost!zaphod.mps.ohio-state.edu!samsung!uunet!orca!mesa.dsd.es.com!rthomson

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wupost!zaphod.mps.ohio-state.edu!samsung!uunet!orca!mesa.dsd.es.com!rthomson
From: rthomson@mesa.dsd.es.com (Rich Thomson)
Newsgroups: alt.graphics.pixutils,alt.sources,uu.cs.general
Subject: rletojpeg: Utah Raster Toolkit RLE => JPEG /bin/sh script
Message-ID: <1991Nov3.015640.28466@dsd.es.com>
Date: 3 Nov 91 01:56:40 GMT
Sender: usenet@dsd.es.com
Reply-To: rthomson@mesa.dsd.es.com (Rich Thomson)
Organization: Design Systems Division, Evans & Sutherland, SLC, UT
Lines: 99
Originator: rthomson@mesa
Nntp-Posting-Host: 130.187.85.21