imgsizer has a nasty bug which keeps it from finding image tags right after p tags: "
@@ -55,7 +55,7 @@
#
# Incorporated fixes by Peter S. Galbraith.
#
-import sys, os, getopt, cmp, string, re, urllib, commands
+import sys, os, getopt, string, re, urllib, commands
version = "2.2, 06 September 2001";
@@ -103,14 +103,25 @@
outfp.write(ch)
if ch == '<':
# within an HTML tag
- lead = infp.read(3)
+ lead = infp.read(2)
if ch == '':
return
outfp.write(lead)
if string.find(lead, '>') > -1:
+ # if we just do a continue we can't parse something
+ # like '
') > -1:
continue
+ if not lead in ("img", "IMG"):
+ continue
# within an image tag
lower = (lead == 'img')
state = suppress = 0
@@ -253,7 +264,7 @@
print "imgsizer: can't open tempfile"
raise SystemExit, 1
sizefix(infp, outfp)
- if cmp.cmp(file, tempfile):
+ if file == tempfile:
os.remove(tempfile)
else:
try: