<!-- TMPL_ELSIF NAME="IMGEXISTS" -->this patron does not exist in the database.</li>
<!-- TMPL_ELSIF NAME="MIMERR" -->the image format is unrecognized.</li>
<!-- TMPL_ELSIF NAME="OPNERR" -->Koha was unable to open the image for reading.</li>
+ <!-- TMPL_ELSIF NAME="OVRSIZ" -->the image file is too big.</li>
<!-- TMPL_ELSIF NAME="CRDFIL" -->the <!-- TMPL_VAR NAME="CRDFIL" --> is missing.</li>
<!-- TMPL_ELSE -->of an unknown error. Please refer to the error log for more details.</li><!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
} else {
$filename = $1 if ($source =~ /\/([^\/]+)$/);
}
- warn "\$filename=$filename";
+ warn "$filename is " . length($imgfile) . " bytes";
+ if (length($imgfile) > 100000) {
+ warn "$filename is TOO BIG!!! I refuse to beleagur my database with that much data. Try reducing the pixel dimensions and I\'ll reconsider.";
+ $filerrors{'OVRSIZ'} = 1;
+ push my @filerrors, \%filerrors;
+ push @{ $count{filenames} }, { filerrors => \@filerrors, source => $filename, cardnumber => $cardnumber };
+ $template->param( ERRORS => 1 );
+ return %count;
+ }
my $mimetype = $mimemap->{lc ($1)} if $filename =~ m/\.([^.]+)$/i;
warn "$filename is mimetype \"$mimetype\"" if $DEBUG;
my $dberror = PutPatronImage($cardnumber,$mimetype, $imgfile) if $mimetype;