[Koha-patches] [PATCH] Bugfix: Handling cases where the image is the correct pixel dimensions

Chris Nighswonger cnighswonger at foundations.edu
Thu Apr 10 08:35:53 CEST 2008


---
 tools/picture-upload.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/picture-upload.pl b/tools/picture-upload.pl
index d961492..b590545 100755
--- a/tools/picture-upload.pl
+++ b/tools/picture-upload.pl
@@ -243,6 +243,11 @@ sub handle_file {
                 $imgfile = $img[0];
                 warn "$filename is " . length($imgfile) . " bytes after resizing.";
                 undef $image;    # This object can get big...
+            } else {
+                my @img = $image->ImageToBlob();
+                $imgfile = $img[0];
+                $debug and warn "$filename is " . length($imgfile) . " bytes.";
+                undef $image;
             }
             $debug and warn "Image is of mimetype $mimetype";
             my $dberror = PutPatronImage($cardnumber,$mimetype, $imgfile) if $mimetype;
-- 
1.5.3.7




More information about the Koha-patches mailing list