Improve the performance of getThumbnailUrl by 1400%. Fixes bug #11346
This commit is contained in:
parent
ea53dcc037
commit
066e654640
3 changed files with 8 additions and 6 deletions
|
|
@ -1247,14 +1247,15 @@ sub getThumbnailUrl {
|
|||
my $self = shift;
|
||||
my $filename = shift;
|
||||
if (! defined $filename) {
|
||||
$self->session->errorHandler->error("Can't make a thumbnail url without a filename.");
|
||||
$self->session->errorHandler->error("Can't find a thumbnail url without a filename.");
|
||||
return '';
|
||||
}
|
||||
if (! isIn($filename, @{ $self->getFiles() })) {
|
||||
$self->session->errorHandler->error("Can't make a thumbnail for a file named '$filename' that is not in my storage location.");
|
||||
my $thumbname = 'thumb-' . $filename;
|
||||
if (! -e $self->getPath($thumbname)) {
|
||||
$self->session->errorHandler->error("Can't find a thumbnail for a file named '$filename' that is not in my storage location.");
|
||||
return '';
|
||||
}
|
||||
return $self->getUrl("thumb-".$filename);
|
||||
return $self->getUrl($thumbname);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue