r46194 - /trunk/libimage-size-perl/imgsize

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Thu Oct 22 13:39:18 UTC 2009


Author: jawnsy-guest
Date: Thu Oct 22 13:39:12 2009
New Revision: 46194

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46194
Log:
Oops, reverse-apply the imgsize-fixes patch erroneously applied in trunk

Modified:
    trunk/libimage-size-perl/imgsize

Modified: trunk/libimage-size-perl/imgsize
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libimage-size-perl/imgsize?rev=46194&op=diff
==============================================================================
--- trunk/libimage-size-perl/imgsize (original)
+++ trunk/libimage-size-perl/imgsize Thu Oct 22 13:39:12 2009
@@ -32,7 +32,7 @@
 =head1 OPTIONS
 
 By default, the width and height are returned as attributes for an IMG tag
-in HTML, essentially C<width="40" height="30">. The following options may be
+in HTML, essentially "C<WIDTH=40 HEIGHT=30>". The following options may be
 used to return alternate formats (all report width first, then height):
 
 =over
@@ -90,7 +90,7 @@
     if ($opt_h || (! @ARGV) || (($opt_a && $opt_r) || ($opt_a && $opt_f) ||
                                 ($opt_r && $opt_f)));
 
-$rtn = \&return_html;
+$rtn = \&html_imgsize;
 $opt_a &&
     ($rtn = \&return_attr);
 $opt_r &&
@@ -98,13 +98,11 @@
 $opt_f &&
     ($rtn = \&return_fmt);
 
-my $error = 0;
-
 if (@ARGV > 1)
 {
     foreach (@ARGV)
     {
-        print STDOUT sprintf("%s: %s\n", $_, &$rtn($_));
+        print STDOUT sprintf("$_: %s\n", &$rtn($_));
     }
 }
 else
@@ -112,7 +110,7 @@
     print STDOUT sprintf("%s\n", &$rtn($ARGV[0]));
 }
 
-exit $error;
+exit;
 
 #
 # Note the doubled calls here. This is just a quick, semi-clean attempt at
@@ -120,31 +118,24 @@
 # the Image::Size package.
 #
 
-sub return_html
-{
-    my ($html) = html_imgsize($_[0]);
-
-    (defined $html) ? $html : ("error", $error = 1);
-}
-
 sub return_attr
 {
     my ($width, $height, $err) = imgsize($_[0]);
 
     (defined $width) ?
-        "(-width => $width, -height => $height)" : ("error: $err", $error = 1);
+        "(-width => $width, -height => $height)" : "error: $err";
 }
 
 sub return_imgsize
 {
     my ($width, $height, $err) = imgsize($_[0]);
 
-    (defined $width) ? "$width $height" : ("error: $err", $error = 1);
+    (defined $width) ? "$width $height" : "error: $err";
 }
 
 sub return_fmt
 {
     my ($width, $height, $err) = imgsize($_[0]);
 
-    (defined $width) ? sprintf($opt_f, $width, $height, $err) : ("error: $err", $error = 1);
+    (defined $width) ? sprintf($opt_f, $width, $height, $err) : "error: $err";
 }




More information about the Pkg-perl-cvs-commits mailing list