fixed: Collaboration System attachments follow site's max size instead of CS's

This commit is contained in:
Graham Knop 2008-03-27 19:15:51 +00:00
parent 1c589b5ee8
commit 308671edd0
3 changed files with 6 additions and 6 deletions

View file

@ -1,4 +1,5 @@
7.5.9
- fixed: Collaboration System attachments follow site's max size instead of CS's
7.5.8
- moved Gallery utility methods to WebGUI::Utility::Gallery

View file

@ -845,7 +845,7 @@ sub postProcess {
my $storage = $self->getStorageLocation;
foreach my $file (@{$storage->getFiles}) {
if ($storage->isImage($file)) {
$storage->adjustMaxImageSize($file);
$storage->adjustMaxImageSize($file, $self->getThread->getParent->get('maxImageSize'));
$storage->generateThumbnail($file, $self->getThread->getParent->get("thumbnailSize"));
}
$size += $storage->getFileSize($file);

View file

@ -130,11 +130,10 @@ The name of the file to check for a maximum file size violation.
=cut
sub adjustMaxImageSize {
my $self = shift;
my $self = shift;
my $file = shift;
my $max_size = shift || $self->session->setting->get("maxImageSize");
my ($w, $h) = $self->getSizeInPixels($file);
my $max_size = $self->session->setting->get("maxImageSize");
my $resized = 0;
if($w > $max_size || $h > $max_size) {
if($w > $h) {
$self->resize($file, $max_size);
@ -142,9 +141,9 @@ sub adjustMaxImageSize {
else {
$self->resize($file, 0, $max_size);
}
$resized = 1;
return 1;
}
return $resized;
return 0;
}
#-------------------------------------------------------------------