Article View: alt.graphics.pixutils
Article #711patch for rletoppm; revised rletojpeg script
From: Rich Thomson
Date: Sun, 03 Nov 1991 20:53
Date: Sun, 03 Nov 1991 20:53
109 lines
3537 bytes
3537 bytes
I poked around a little in rletoppm and found that a parameter was
left off of the call to ppm_writeppminit() which specified whether or
not to force 'ppm plain' format. Included here is a diff against the
file rletoppm.c found in the latest URT release:
*** rletoppm.c.orig Fri Aug 3 13:18:12 1990
--- rletoppm.c Sun Nov 3 13:34:15 1991
***************
*** 249,255 ****
/*
* Write the ppm file header.
*/
! ppm_writeppminit(stdout, width, height, maxval);
/*
* Write the rest of the ppm file.
*/
--- 249,255 ----
/*
* Write the ppm file header.
*/
! ppm_writeppminit(stdout, width, height, maxval, 0);
/*
* Write the rest of the ppm file.
*/
Here is the revised shell script that doesn't waste its time going
through the intermediate TIFF format.
-- Rich
#!/bin/sh
#
# rletojpeg [-o outfile] [infile]
#
# $Header: rletojpeg,v 1.1 91/11/03 13:51:57 rthomson Locked $
#
# Shell script for RLE => JPEG conversion.
#
# Requires Tom Lane's cjpeg program and a patched rletoppm.
#
# 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 | rletoppm | 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=""
else
if [ "X$file" = "-" ]; then
file=""
fi
fi
if [ $ofile = "-" ]; then
convert
else
convert > $ofile
fi
--
``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
Technical Details
Message-ID:
<1991Nov3.205323.4366@dsd.es.com>Path:
arc1-ca.pugleaf.net!wupost!cs.utexas.edu!hellgate.utah.edu!orca!mesa.dsd.es.com!rthomsonShow Full Headers
Complete Article Headers
Newsgroups: alt.graphics.pixutils,alt.sources,uu.cs.general Path: arc1-ca.pugleaf.net!wupost!cs.utexas.edu!hellgate.utah.edu!orca!mesa.dsd.es.com!rthomson From: rthomson@mesa.dsd.es.com (Rich Thomson) Subject: patch for rletoppm; revised rletojpeg script Message-ID: <1991Nov3.205323.4366@dsd.es.com> Followup-To: alt.graphics.pixutils Originator: rthomson@mesa Sender: usenet@dsd.es.com Nntp-Posting-Host: 130.187.85.21 Reply-To: rthomson@mesa.dsd.es.com (Rich Thomson) Organization: Design Systems Division, Evans & Sutherland, SLC, UT Date: Sun, 3 Nov 91 20:53:23 GMT