1WEB2PNG(1) 6 October 1999 WEB2PNG(1)
2
3
4
6 web2png - convert a web tree from using GIFs to using PNGs
7
9 web2png [-adnrtv] [directory...]
10
12 Web2png is a front end for gif2png(1) that automatically converts
13 entire web page hierarchies from using GIFs to using PNGs. It does
14 image conversion and patches IMG SRC references in web pages.
15
16 The arguments to web2png must be directories; if none are given, the
17 current directory is assumed.
18
19 In each directory, web2png tries to convert every GIF to a PNG. It
20 leaves alone GIFs that have either multiple images or transparency,
21 because these will not display properly in all current browsers. It
22 also does not reconvert GIFs that already have corresponding PNGs (e.g.
23 the same name except for the .gif file extension). The original GIFs
24 are left in place.
25
26 Web2png tracks successful conversions. It then looks at each HTML,
27 secure HTML, HTML inclusion, PHP page, JavaScript program or Cascading
28 Style Sheet under the argument directories (extensions html, shtml,
29 .inc, .php, .js, .css). In these pages, it fixes each reference to each
30 successful converted GIF to point at the PNG. References in relative
31 HREF and BACKGROUND tags are recognized by filename and fixed (any base
32 directory declared by a BASE tag will be be prepended to the relative
33 URL). References that are HTTP URLs are matched against the list of
34 convertible GIFs by basename; if there is such a match, the contents of
35 the URL is retrieved and compared to the convertible GIF. If both
36 basename and data match, the HTTP reference is fixed. If the pages are
37 under RCS version control, they´re checked out for modification before
38 being altered; otherwise, a copy of the original of each modified web
39 page is left in the same directory, with the additional extension .bak.
40
41 The following options change the behavior of the program:
42
43 -a
44 Convert all GIF files, including those with multiple images and/or
45 transparency.
46
47 -d
48 Delete originals. Removes all GIFs with corresponding PNGs, and all
49 .bak files.
50
51 -n
52 Make no changes. With this option, web2png reports on what needs to
53 be done (and on GIFs that use transparency or have multiple
54 images), but neither converts GIFs nor touches web pages.
55
56 -r
57 Reverse. Restore all HTML/SHTML/PHP pages from the .bak files
58 created by a previous run (or, if the files were under version
59 control, revert them). Remove PNGs with corresponding GIFs.
60
61 -t
62 Convert transparent GIFs (for use with IE 5.0+. Netscape 6.0+, and
63 Mozilla).
64
65 -v
66 Verbose. Utter more trace information about the conversion process.
67 Web2png can be run on a directory that has already been partly
68 converted by previous runs; it will do the minimum necessary amount
69 of work. The changes it makes will be fully reversible with -r
70 until you run it in -d mode. Web2png is written in Python. Python
71 1.5.2 or better must be installed and accessible on your system in
72 order for web2png to run.
73
75 Sometimes it´s possible to convert transparent GIFs without altering
76 the appearance of the page, by knowing from context that they will
77 always place within an area of fixed and solid color. Web2png can´t
78 deduce when this will be, so it doesn´t try; but it may be useful to
79 apply gif2png with the -b option by hand.
80
82 The algorithm for fixing HTTP URLs is not foolproof. It could be
83 confused into incorrectly patching an HTTP URL reference to a GIF into
84 an invalid reference to a PNG if the GIF matches a local target GIF by
85 both basename and binary content, but actually lives on another host.
86
87 This program does not automatically convert CGIs; you´ll have to do
88 that by hand. Other dynamic-content methods (such as server-side
89 inclusions) may also require hand-hacking.
90
91 The program cannot tell converted from preexisting PNGs; if you have
92 PNGs with the same stem name as corresponding GIFs but carrying
93 different information, the -r mode will clobber them.
94
96 gif2png(1)
97
99 Eric S. Raymond <esr@thyrsus.com>, October 1999.
100
101 Slightly modified for Debian by Aaron Isotton <aaron@isotton.com>.
102
103
104
1056 October 1999 11/11/2009 WEB2PNG(1)