# Makefile for the imgsizer distribution
-VERS=2.4
+VERS=2.5
# These choices are correct for Linux. Season to taste.
BINDIR = /usr/bin
imgsizer.1: imgsizer.xml
xmlto man imgsizer.xml
-SOURCES = READ.ME Makefile \
+SOURCES = READ.ME Makefile imgsizer.spec \
imgsizer imgsizer.xml \
test-before.html test-converted.html test.png tnhd2.jpg
# Make RPMs. You need to be root to make this work
RPMROOT=/usr/src/redhat
-RPM = rpmbuild
-RPMFLAGS = -bb --target noarch
-rpm: imgsizer-$(VERS).tar.gz
- cp imgsizer-$(VERS).tar.gz $(RPMROOT)/SOURCES;
- cp imgsizer.spec $(RPMROOT)/SPECS/imgsizer.spec
- (cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) imgsizer.spec)
- cp $(RPMROOT)/RPMS/noarch/imgsizer-$(VERS)*.rpm .
- chown $$USER *
+rpm: dist
+ rpmbuild --target noarch --define 'myversion $(VERS)' -ta imgsizer-$(VERS).tar.gz
+ cp $(RPMROOT)/RPMS/noarch/imgsizer-$(VERS)*.noarch.rpm .
+
imgsizer.lsm -- Linux Software Map description.
Put imgsizer on your execution path and the man page in a man source
-directory somewhere. `make install' will do the right hing on a Linux box.
+directory somewhere. `make install' will do the right thing on a Linux box.
That's it.
You will need either identify(1) from the ImageMagick tools or
#
# Incorporated fixes by Peter S. Galbraith.
#
-# Fixes by EST, 25 April 2003
+# Fixes by ESR, 25 April 2003
#
# Merged amended versions of Lennart Poettering's fix for Debian bug 139714.
# and Jeroen N. Witmond's fix for Debian bug 168964. Added regression-test
# production.
+#
+# Enhancement by ESR, 14 Nov 2003
+#
+# Verify and merge Lucien Saviot's patch to produce XHTML from XHTML input.
import sys, os, getopt, string, re, urllib, commands
except ImportError:
import cmp
-version = "2.4, 25 April 2003";
+version = "2.5, 14 November 2003";
splash = """imgsizer version %s, Eric S. Raymond <esr@thyrsus.com>
See <http://www.tuxedo.org/~esr/software.html> for updates."""
res = " " + dim
else:
res = " " + string.upper(dim)
- res = res + '=' + str(xc)
+ res = res + '="' + str(xc) + '"'
return res
def sizefix(infp, outfp):
return
if ch == '>':
break
+ if ch == '/':
+ ch2 = infp.read(1)
+ ch = ch + ch2
+ if ch2 == '>':
+ break
attributes = attributes + ch
- outfp.write(transform(attributes) + ">")
+ outfp.write(transform(attributes) + ch)
x_match = re.compile (r" ([0-9]+) *x *([0-9]+)")
rdjpg_match = re.compile (r" ([0-9]+)w *\* *([0-9]+)h")