From: Eric S. Raymond Date: Sat, 28 Jun 1997 14:07:56 +0000 (+0000) Subject: Don't hack percent sizes. X-Git-Tag: 1.6~4 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=a020f5b9bffcaac4857ec634ea111fe1198446c8;p=imgsizer.git Don't hack percent sizes. --- diff --git a/imgsizer b/imgsizer index fea451d..8e2d1c2 100755 --- a/imgsizer +++ b/imgsizer @@ -13,7 +13,7 @@ # clearly mark an altered version. Fixes and enhancements cheerfully # accepted. # -# This is version 1.2. +# This is version 1.3. # # Anything that can fetch a URL defined on the command line @@ -104,6 +104,7 @@ sub attrfix } $url = $1; + # fetch the image if ($url =~ /^http:/) { $image = "imgsizer-tmp$$"; $status = system("$fetcher ${url} >${image}"); @@ -118,6 +119,11 @@ sub attrfix } + # Don't try to fix up percent sizes + if ($attribs =~ /[0-9]%/) { + return $attribs; + } + ($name, $size) = split(' ', `identify ${image}`); unlink("imgsizer-tmp$$"); if ($name =~ /:/) {