Webify:
Some notes and hints
Herein are notes regarding installation
and running of
webify, obtaining Ghostscript,
troubleshooting common problems,
Macintosh-specific issues,
Windows-specific issues,
bugs, and a summary of
recent changes.
Webify runs only on UNIX systems, although it should be a fairly simple port
to other platforms supporting Ghostscript.
- First, check whether you have Ghostscript installed on your
UNIX host,
and that it supports PPMRAW conversion. Do this by typing
the command "gs -h", whereupon you should get a Ghostscript help
messages listing Available Devices including PPMRAW. If this doesn't
happen, then find a wizard (or, better, be one) who can find and/or
reconfigure Ghostscript.
- Then (assuming you want JPEG image files)
check to see that you have the command cjpeg installed
on your UNIX host, by typing the command "cjpeg -h". This program
is part of the Independent JPEG Group's distribution of JPEG support
code, and current
source
is available in the FTP directory
ftp://ftp.uu.net/graphics/jpeg
as well as many other sites.
- If you intend to generate GIF rather than JPEG image files (via
the -gif option to webify), you'll need ppmtogif rather than cjpeg
as the image conversion command. Ppmtogif is part of the netpbm package,
available as
netpbm-94.3.1.tgz ftp://ftp.cps.cmich.edu/
as well as many other sources.
- Next
CLICK HERE to DOWNLOAD
a big (500Kb) file "webify.tar.Z" to your unix host.
- uncompress and untar the file into an empty directory,
named, say, "webify";
then do a make. This should make the webify command,
a simple auxilliary command called "hackppm", and
the paltry web-paged documentation which serves mostly to exemplify
its use.
- Finally, install both webify and hackppm (as well as cjpeg, if
you had to grab that too) in places on your search path.
LATE FLASH: The recommended gs version is 3.33. Earlier versions,
including the Gnu 2.6.2 version, are reputed to work as well
(despite incompatibilites with previous versions of webify).
The Aladdin version 3.51 has other problems (see below); a
recent version 3.53 hasn't yet been tried.
Ghostscript version 2.6.2 is distributed under the GNU copyleft terms and
is available at
prep.ai.mit.edu;
you might grab
fonts
too.
A newer, fancier, and somewhat buggier version is distributed by
Aladdin under different terms; poke around
ftp://ftp.cs.wisc.edu:/pub/ghost/aladdin/
and you'll find version 3.33 along with fonts, fixes, and information.
This version seems to work fine with webify.
At this writing, Aladdin's current distribution is version 3.51.
A number of users have noticed that this version rasterizes fonts
poorly, generating muddled-looking (but readable) output. You can
see what the difference is by
clicking here.
NOTE:
Earlier Webify versions generated gif images, using a postcript prependage
to crop and rotate the images. Gif images are no longer supported in current
supported in current gs versions, and the postscript hacks failed to work
with postscript files from certain sources and with the Aladin gs versions.
For this reason, Webify version 2 uses gs to generate .ppm files, and
postprocessors to crop/rotate and convert to JPEG or GIF formats.
The additional complexity is that webify users must install, in addition
to webify, hackppm and either/both of cjpeg or ppmtogif.
Pity, but hopefully myriad problems with the earlier version will be avoided.
To get summary help on webify, type the command "webify"
with no arguments.
You'll get something like
this.
Before using webify to convert a postscript file, you'll probably want
to customize a template for your own use. Edit webify.template; start
with minor changes (like changing my name and email address -- at the
bottom of the file -- to your own). If you know HTML and have a
strong intuition, you'll immediately see how to make substantive
changes; otherwise, you may want to make your changes more incrementally.
Very little has to be changed to make the sample template useful for
a wide variety of purposes.
To run webify on a UNIX system, type the command
webify <options> template file.ps
which will read specified template file as well as the postscript
file.ps, and generate a subdirectory ("named "file") containing
a tree of web pages whose root is named "index.html".
Template
is a text file containing skeletal HTML, as well as escape
sequences enclosed in curly brackets {...}.
Click here to see a typical
template (the one which generated the sample webify presentation).
<options> allow various parameters to be specified
in the command line rather than via escapes in the template; this
allows a single template to be used for a variety of applications.
For a summary of available options, invoke webify with no arguments
as described above.
Following are some problems which webify users have reported:
- Image Quality:
- For unknown reasons, gs version 3.51 generates PPM files which are
somewhat muddled looking. Use gs version 3.33 until Aladin fixes
this problem.
- Hangs forever:
- If webify hangs forever, it is probably waiting for gs to finish.
GS may have returned an error (which webify doesn't understand), or it
may itself be hanging. You can tell by running ps, and (perhaps) by
looking at gs.out.
General advice: try running gs on your postscript file directly and
checking for errors.
- Orientation:
- If your your images aren't oriented properly, try the -r1 or -r3 options
(assuming you DON'T have a {rotate ...} escape in your template). If you
can't get the orientation right, check your version of hackppm ("hackppm -h").
- White-on-black:
- Some users have reported that webify produces inverted color slides --
-- white letters on black background -- under some circumstances. Version
2.1 of hackppm reinterprets P4-format input data to address what I expect
is the source of the problem; but the -v input to webify is provided as
a safety net. If your images are inverted, add -v to the webify command
line and see if that fixes the problem.
- Auxilliaries:
- Some users have had problems getting stale versions of cjpeg or ppmtogif
or hackppm after compiling new versions. This can be due to former versions
of these programs which remain on the search path. When you replace an auxilliary
program, either replace it in its search path location or give the appropriate
webify argument to access the new version.
- Basic Troubleshooting:
- If your slides/thumbnails don't look as you expect them to, try running
gs directly on your postscript file (via something like "gs slides.ps").
You can view the output on your screen and decide whether your postscript file
means the right thing to gs.
- Advanced Troubleshooting:
- If gs produces proper output, run webify with the -d and -F flags, preferably
on a shortened version of your postscript presentation. This will preserve
ppm files and show you all the commands webify is invoking. You can use a utility
like xv to view the ppm files, and try running hackppm and cjpeg manually to
pin down where the process is screwing up your images.
Generation of postscript from the Macintosh is easy using the Laserwriter
8 driver (currently version 8.3; 8.1.1 and earlier are extremely buggy).
Select file output from the print dialog,
include all fonts (to be safe), and write the postscript file somewhere
for convenient transport to the UNIX system running webify.
Idiosyncrasy:
The Mac driver inherits some parameters from the selected
printer, even when producing postscript files rather than hard copy.
For certain printers, the postscript -- hence the gif images -- are
upside down. This can be accommodated via the -r command line option
to webify, or via the {rotate n} directive in the template file.
Due to a fairly serious dose of Mac bigotry during the past several
years, I'm not competent to provide much advice here (despite numerous
inquiries). Contributions from Windows-savvy users are welcome.
Between the likelihood of Apple's demise, the frustrating rate
of Mac crashes, and the growing irrelevence of the NuBus (a link
to circa 1980 nostalgia) my Mac loyalty is likely to finally give
way.... when this happens, I may actually have some intelligent advice
for this section.
-
Sensitivity to gs bugs; see comments elsewhere in this file.
-
Runs only on UNIX. I may undertake a mac port one day...
-
The PPM files temporarily generated by ghostscript can be big --
sometimes one or more megabytes per page. Currently thumbnails all
generated, then all converted and deleted. Unless the -F flag is
given, however, PPMs for slides are generated and converted
incrementally, thus extra space required is on the order of one slide
PPM or n thumbnail ppms, whichever is bigger.
Recent changes include:
- 1/27/96, version 2.11: Removed dependence on gs's handling of
"-c quit", per suggestion by gjohn@CS.Stanford.EDU. This should
restore compatibility with earlier versions of gs, eg gs 2.6.2.
Thanks, George!
- 12/26/95, version 2.1: Several changes, including the -gif option
to generate gif rather than jpeg files, and inverting the video on P4
format hackppm input (to address white-on-black complaints).
- 12/23/95, version 2.08: Added -v option to invert video in generated
jpegs. Miscellaneous bug fixes, including a fifo synchronization bug
which occasionally caused the last slide to be empty.
- 10/25/95, version 2.07: Added -F flag to suppress use of UNIX FIFOs
in creation of slide jpegs. This causes webify to use more scratch disk
space (it must have enough free disk to hold ALL slide ppms at once), but
seems to avoid incompatibilities with certain UNIX systems. Also includes
{date} escape - thanks to daasch@ee.pdx.edu (W. Robert Daasch).
- 10/22/95, version 2.06: Changed hackppm to convert P4 format input
to P5 format output, as cjpeg objects to P4 format.
- 10/8/95: v 2.05, minor changes I can't remember just now.
- 9/26/95, version 2.04: Added preliminary check for auxilliary
functions cjpeg, hackppm, gs.
- 9/22/95, version 2.03: Minor cosmetics; added -H (and renamed
-G, -J from lower-case).
- 9/20/95, version 2.02: Fixed bug: made hackppm read & write mode P4
PPM files (1-bit mono), which turn out to be generated by gs under
various circumstances.
- 9/20/95: Robin Duquette modified webify to pipe slide PPM
from ghostscript to hackppm through fifos, to reduce scratch
disk usage. Another great contribution, Robin!
- 9/19/95 (version 2.01): Added -n option per request (Thanks,
Rohit). Converted webify to generate ppmraw files rather than ppm,
saving considerable scratch disk space.
- 9/16/95: Completed the conversion to version 2 by ripping out
postscript, and replacing its function with a ppm post-processor.
Rotation (-r option, {rotate #}) replaces previous landscape,
vertical, horizontal, flip abomination.
- 8/1/84: Robin Duquette, robin@ireq.ca, took the heroic step of
converting webify to generate jpeg rather than gif images.
- 3/24/95: {write-file filename ...} added. Thanks to Dave
Kristol for this improvement.
- 3/22/95: Added {page-number "%d"} and {pages "%d"}; thanks
to Dave Kristol for the suggestion.
- 3/16/95: Made -h, -v override {horizontal}, {vertical}.
Minor edits to webify.template, notes.html.
- 3/13/95: Made -g actually work (it didn't before).
- 3/12/95: -g option to specify alternative ghostscript command;
slightly improved handling of ghostscript failures.
- 3/11/95: -f option and {FlipPage} escape added to accommodate
postscript files whose pages come out upside down; in particular,
whose Landscape-mode pages have been rotated 90 degrees in the
wrong direction ("Seascape mode").
- 3/11/95: webifydoc.ps changed to exclude bitmaps. This sidesteps
an apparent bug in gs version 3.12, which seems to give a core dump
with ps files including bitmap images. Note that the earlier gs 2.6.1
doesn't have this bug.
- 3/10/95 (Courtesy of John Sellens, U of Waterloo): a short man page
has been added to the distribution. Thanks, John, for this contribution!
Thanks to all the users who conveyed bug reports, suggestions, improvements,
and encouragement.
Steve Ward ... ward@mit.edu