Fix images in collaboration systems
This commit is contained in:
parent
54a20b9c65
commit
abdb789902
2 changed files with 12 additions and 5 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
7.3.16
|
7.3.16
|
||||||
- fix: The POD of Form::Image is faulty (perlDreamer Consulting, LLC)
|
- fix: The POD of Form::Image is faulty (perlDreamer Consulting, LLC)
|
||||||
|
- fix: Images in Collaboration Systems were broken in 7.3.15
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -813,11 +813,17 @@ 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)) {
|
||||||
##Use generateThumbnail to shrink size to site's max image size
|
my ($w, $h) = $storage->getSizeInPixels($file);
|
||||||
##We should look into using the new resize method instead.
|
my $max_size = $self->getThread->getParent->get("maxImageSize")
|
||||||
$storage->generateThumbnail($file, $self->getThread->getParent->get("maxImageSize") || $self->session->setting->get("maxImageSize"));
|
|| $self->session->setting->get("maxImageSize");
|
||||||
$storage->deleteFile($file);
|
if($w > $max_size || $h > $max_size) {
|
||||||
$storage->renameFile('thumb-'.$file,$file);
|
if($w > $h) {
|
||||||
|
$storage->resize($file, $max_size);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$storage->resize($file, 0, $max_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
$storage->generateThumbnail($file, $self->getThread->getParent->get("thumbnailSize"));
|
$storage->generateThumbnail($file, $self->getThread->getParent->get("thumbnailSize"));
|
||||||
}
|
}
|
||||||
$size += $storage->getFileSize($file);
|
$size += $storage->getFileSize($file);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue