fixed: Collaboration System attachments follow site's max size instead of CS's
This commit is contained in:
parent
1c589b5ee8
commit
308671edd0
3 changed files with 6 additions and 6 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
7.5.9
|
7.5.9
|
||||||
|
- fixed: Collaboration System attachments follow site's max size instead of CS's
|
||||||
|
|
||||||
7.5.8
|
7.5.8
|
||||||
- moved Gallery utility methods to WebGUI::Utility::Gallery
|
- moved Gallery utility methods to WebGUI::Utility::Gallery
|
||||||
|
|
|
||||||
|
|
@ -845,7 +845,7 @@ sub postProcess {
|
||||||
my $storage = $self->getStorageLocation;
|
my $storage = $self->getStorageLocation;
|
||||||
foreach my $file (@{$storage->getFiles}) {
|
foreach my $file (@{$storage->getFiles}) {
|
||||||
if ($storage->isImage($file)) {
|
if ($storage->isImage($file)) {
|
||||||
$storage->adjustMaxImageSize($file);
|
$storage->adjustMaxImageSize($file, $self->getThread->getParent->get('maxImageSize'));
|
||||||
$storage->generateThumbnail($file, $self->getThread->getParent->get("thumbnailSize"));
|
$storage->generateThumbnail($file, $self->getThread->getParent->get("thumbnailSize"));
|
||||||
}
|
}
|
||||||
$size += $storage->getFileSize($file);
|
$size += $storage->getFileSize($file);
|
||||||
|
|
|
||||||
|
|
@ -130,11 +130,10 @@ The name of the file to check for a maximum file size violation.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub adjustMaxImageSize {
|
sub adjustMaxImageSize {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $file = shift;
|
my $file = shift;
|
||||||
|
my $max_size = shift || $self->session->setting->get("maxImageSize");
|
||||||
my ($w, $h) = $self->getSizeInPixels($file);
|
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 > $max_size || $h > $max_size) {
|
||||||
if($w > $h) {
|
if($w > $h) {
|
||||||
$self->resize($file, $max_size);
|
$self->resize($file, $max_size);
|
||||||
|
|
@ -142,9 +141,9 @@ sub adjustMaxImageSize {
|
||||||
else {
|
else {
|
||||||
$self->resize($file, 0, $max_size);
|
$self->resize($file, 0, $max_size);
|
||||||
}
|
}
|
||||||
$resized = 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return $resized;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue