🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.graphics.pixutils
Article #718

jlist -- shell script to list JPEG file info

#718
From: Rich Thomson
Date: Wed, 04 Dec 1991 01:21
65 lines
2028 bytes
Quick shell hack to get output like this:

	1000-fmk.jpg		169102		800x800
	ather.jpg		9285		332x184
	bark.jpeg		273465		1024x1024
	bilby.jpg		11919		323x172
	caboose.jpeg		25704		640x401
	cantor.jpeg		53086		512x512
	caver.jpeg		109508		1273x861
	cherry.jpg		98508		495x710
	dana.jpeg		164174		1280x1018
	desert-pavement.jpeg	477651		1280x1024
	devil.jpg		11155		333x230
	dibber.jpg		10692		301x162
	empirest.jpg		41006		402x707
	mandrill.jpg		341656		512x512
	numbat.jpg		9347		289x161
	platypus.jpg		4515		195x192
	quokka.jpg		12502		334x211
	quoll.jpg		5576		156x238
	rind.jpg		81304		461x679
	robosurf.jpg		85996		562x710
	snakes.jpg		88988		504x557
	tiger.jpg		9567		267x187
	wacky.jpeg		164416		1024x992
	wombat.jpg		11744		323x214

Note that the characters inside the 'echo' string are tabs and not
spaces to get the output in columns.
						-- Rich

#!/bin/sh
#
# jlist [file]
#
# list statistics about a JPEG encoded file.
#
# Rich Thomson, November 10th, 1991
#
stats()
{
    size=`ls -l $1 | awk '{ print $4 }'`
    pixels=`djpeg $1 | pnmfile | awk '{ print $4 "x" $6 }'`
    echo "$1		$size		$pixels"
}

usage()
{
    echo `basename $0` file [file...]
    exit 1
}

if [ $# = 0 ]; then
    usage
fi

for f in $*; do
    stats $f
done
-- 
	Repeal the personal income tax; vote Libertarian in 1992.
	    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: <1991Dec4.012102.8839@dsd.es.com>
Path: arc1-ca.pugleaf.net!wupost!uunet!orca!mesa.dsd.es.com!rthomson

Show Full Headers
Complete Article Headers
Newsgroups: alt.graphics.pixutils,alt.sources
Path: arc1-ca.pugleaf.net!wupost!uunet!orca!mesa.dsd.es.com!rthomson
From: rthomson@mesa.dsd.es.com (Rich Thomson)
Subject: jlist -- shell script to list JPEG file info
Message-ID: <1991Dec4.012102.8839@dsd.es.com>
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: Wed, 4 Dec 91 01:21:02 GMT