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