From: Eric S. Raymond Date: Sat, 21 Nov 1998 21:47:48 +0000 (+0000) Subject: Ready to ship 1.5. X-Git-Tag: 1.6~2 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=6c1c0b7d59b345c71f6348d0c7fe2456511f9659;p=imgsizer.git Ready to ship 1.5. --- diff --git a/Makefile b/Makefile index 054ce95..de766ff 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ install: cp imgsizer httpget $(BINDIR) cp imgsizer.man $(MANDIR)/imgsizer.1 -DISTDIR = imgsizer-1.2 +DISTDIR = imgsizer-1.5 FILES = $(DISTDIR)/Makefile $(DISTDIR)/READ.ME $(DISTDIR)/httpget \ $(DISTDIR)/imgsizer $(DISTDIR)/imgsizer.lsm \ $(DISTDIR)/imgsizer.man diff --git a/README b/README index 2b1c42d..a475831 100644 --- a/README +++ b/README @@ -21,11 +21,11 @@ work. If you are using Linux or any of the free BSDs it is probably already on your system; otherwise, you should be able to get it from ftp://ftp.x.org/contrib/applications/ImageMagick. -Usual FRS terms -- copy, use, and redistribute as you like, don't take -my name off it, and clearly mark any modified versions. Fixes -and enhancements cheerfully accepted. Enjoy! +Usual open-source terms -- copy, use, and redistribute as you like, +don't take my name off it, and clearly mark any modified versions. +Fixes and enhancements cheerfully accepted. Enjoy! -- esr - http://www.ccil.org/~esr + http://www.tuxedo.org/~esr diff --git a/imgsizer b/imgsizer index 8e2d1c2..f9857c9 100755 --- a/imgsizer +++ b/imgsizer @@ -13,7 +13,7 @@ # clearly mark an altered version. Fixes and enhancements cheerfully # accepted. # -# This is version 1.3. +# This is version 1.5. # # Anything that can fetch a URL defined on the command line @@ -34,7 +34,7 @@ if (@ARGV) { select(TEMP); &sizefix; close(TEMP); - if (system("cp $out $file")) { + if (`cmp $out $file` && system("cp $out $file")) { print STDERR "imgsize: couldn't replace ${file}\n}"; } } @@ -49,7 +49,7 @@ else { sub dirname # return filename with the basename part stripped away { - my($file) = @_; + local($file) = @_; if ($file =~ /\//) { $file =~ s:/[^/]*$::; } else { @@ -114,9 +114,13 @@ sub attrfix return $attribs; } } - elsif (!($url =~ /^[a-z]+:/)) { - $image = "$dir/$url"; # This catches local files - + elsif ($url =~ /^\//) { + $image = "./$url"; # This catches local files that are in + # virtual root, assuming we're called + # from /var/www or equivalent. + } + elsif (!($url =~ /^[a-z]+:/)) { + $image = "$dir/$url"; # This catches local files } # Don't try to fix up percent sizes