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
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
# 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
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}";
}
}
sub dirname
# return filename with the basename part stripped away
{
- my($file) = @_;
+ local($file) = @_;
if ($file =~ /\//) {
$file =~ s:/[^/]*$::;
} else {
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