File: web2png.1

package info (click to toggle)
gif2png 2.5.8-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 880 kB
  • ctags: 428
  • sloc: ansic: 2,958; sh: 1,929; xml: 836; python: 248; makefile: 85
file content (102 lines) | stat: -rw-r--r-- 5,432 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
'\" t
.\"     Title: web2png
.\"    Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 03/08/2012
.\"    Manual: Graphics
.\"    Source: web2png
.\"  Language: English
.\"
.TH "WEB2PNG" "1" "03/08/2012" "web2png" "Graphics"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
web2png \- convert a web tree from using GIFs to using PNGs
.SH "SYNOPSIS"
.HP \w'\fBweb2png\fR\ 'u
\fBweb2png\fR [\-adnrtv] [\fIdirectory\fR...]
.SH "DESCRIPTION"
.PP
Web2png is a front end for gif2png(1) that automatically converts entire web page hierarchies from using GIFs to using PNGs\&. It does image conversion and patches IMG SRC references in web pages\&.
.PP
The arguments to
\fBweb2png\fR
must be directories; if none are given, the current directory is assumed\&.
.PP
In each directory,
\fBweb2png\fR
tries to convert every GIF to a PNG\&. It leaves alone GIFs that have multiple images, because these will not display properly in all current browsers\&. It also does not reconvert GIFs that already have corresponding PNGs (e\&.g\&. the same name except for the \&.gif file extension)\&. The original GIFs are left in place\&.
.PP
Web2png tracks successful conversions\&. It then looks at each HTML, secure HTML, HTML inclusion, PHP page, JavaScript program or Cascading Style Sheet under the argument directories (extensions html, shtml, \&.inc, \&.php, \&.js, \&.css)\&. In these pages, it fixes each reference to each successful converted GIF to point at the PNG\&. References in relative HREF and BACKGROUND tags are recognized by filename and fixed (any base directory declared by a BASE tag will be be prepended to the relative URL)\&. References that are HTTP URLs are matched against the list of convertible GIFs by basename; if there is such a match, the contents of the URL is retrieved and compared to the convertible GIF\&. If both basename and data match, the HTTP reference is fixed\&. If the pages are under RCS version control, they\*(Aqre checked out for modification before being altered; otherwise, a copy of the original of each modified web page is left in the same directory, with the additional extension \&.bak\&.
.PP
The following options change the behavior of the program:
.PP
\fB\-a\fR
.RS 4
Convert all GIF files, including those with multiple images\&.
.RE
.PP
\fB\-d\fR
.RS 4
Delete originals\&. Removes all GIFs with corresponding PNGs, and all \&.bak files\&.
.RE
.PP
\fB\-n\fR
.RS 4
Make no changes\&. With this option,
\fBweb2png\fR
reports on what needs to be done (and on GIFs that have multiple images), but neither converts GIFs nor touches web pages\&.
.RE
.PP
\fB\-r\fR
.RS 4
Reverse\&. Restore all HTML/SHTML/PHP pages from the \&.bak files created by a previous run (or, if the files were under version control, revert them)\&. Remove PNGs with corresponding GIFs\&.
.RE
.PP
\fB\-v\fR
.RS 4
Verbose\&. Utter more trace information about the conversion process\&. Web2png can be run on a directory that has already been partly converted by previous runs; it will do the minimum necessary amount of work\&. The changes it makes will be fully reversible with
\fB\-r\fR
until you run it in
\fB\-d\fR
mode\&. Web2png is written in Python\&. Python 1\&.5\&.2 or better must be installed and accessible on your system in order for
\fBweb2png\fR
to run\&.
.RE
.SH "NOTE"
.PP
Sometimes it\*(Aqs possible to convert transparent GIFs without altering the appearance of the page, by knowing from context that they will always place within an area of fixed and solid color\&. Web2png can\*(Aqt deduce when this will be, so it doesn\*(Aqt try; but it may be useful to apply gif2png with the \-b option by hand\&.
.SH "KNOWN PROBLEMS"
.PP
The algorithm for fixing HTTP URLs is not foolproof\&. It could be confused into incorrectly patching an HTTP URL reference to a GIF into an invalid reference to a PNG if the GIF matches a local target GIF by both basename and binary content, but actually lives on another host\&.
.PP
This program does not automatically convert CGIs; you\*(Aqll have to do that by hand\&. Other dynamic\-content methods (such as server\-side inclusions) may also require hand\-hacking\&.
.PP
The program cannot tell converted from preexisting PNGs; if you have PNGs with the same stem name as corresponding GIFs but carrying different information, the
\fB\-r\fR
mode will clobber them\&.
.SH "SEE ALSO"
.PP
gif2png(1)
.SH "AUTHORS"
.PP
Eric S\&. Raymond <esr@thyrsus\&.com>, October 1999\&.
.PP
Slightly modified for Debian by Aaron Isotton <aaron@isotton\&.com>\&.