Rolling back rev 9142. The gallery is supposed to upscale graphics.
This commit is contained in:
parent
16452c0677
commit
3e0f449c46
2 changed files with 4 additions and 9 deletions
|
|
@ -22,7 +22,6 @@ use Image::ExifTool qw( :Public );
|
|||
use JSON qw/ to_json from_json /;
|
||||
use URI::Escape;
|
||||
use Tie::IxHash;
|
||||
use List::MoreUtils;
|
||||
|
||||
use WebGUI::DateTime;
|
||||
use WebGUI::Friends;
|
||||
|
|
@ -361,19 +360,14 @@ sub makeResolutions {
|
|||
my $storage = $self->getStorageLocation;
|
||||
$self->session->errorHandler->info(" Making resolutions for '" . $self->get("filename") . q{'});
|
||||
|
||||
my $filename = $self->get('filename');
|
||||
RESOLUTION: for my $res ( @$resolutions ) {
|
||||
for my $res ( @$resolutions ) {
|
||||
# carp if resolution is bad
|
||||
if ( $res !~ /^\d+$/ && $res !~ /^\d*x\d*/ ) {
|
||||
carp "Geometry '$res' is invalid. Skipping.";
|
||||
next RESOLUTION;
|
||||
next;
|
||||
}
|
||||
##Only resize images if the image is too big!
|
||||
my ($imageX, $imageY) = $storage->getSizeInPixels($filename);
|
||||
my @resolutions = split /x/, $res;
|
||||
next RESOLUTION if List::MoreUtils::any { $imageX < $_ && $imageY < $_ } @resolutions;
|
||||
my $newFilename = $res . ".jpg";
|
||||
$storage->copyFile( $filename, $newFilename );
|
||||
$storage->copyFile( $self->get("filename"), $newFilename );
|
||||
$storage->resize( $newFilename, $res, undef, $self->getGallery->get( 'imageDensity' ) );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue