summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/gallery/lib/scanner.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/gallery/lib/scanner.php b/apps/gallery/lib/scanner.php
index 3aae94d1a4f..9fdadbe38c7 100644
--- a/apps/gallery/lib/scanner.php
+++ b/apps/gallery/lib/scanner.php
@@ -89,8 +89,11 @@ class OC_Gallery_Scanner {
$file_count = min(count($files), 10);
$thumbnail = imagecreatetruecolor($file_count*200, 200);
for ($i = 0; $i < $file_count; $i++) {
- $imagePath = OC_Filesystem::getLocalFile($files[$i]);
- CroppedThumbnail($imagePath, 200, 200, $thumbnail, $i*200);
+ $image = OC_Gallery_Photo::getThumbnail($files[$i]);
+ if ($image && $image->valid()) {
+ imagecopyresampled($thumbnail, $image->resource(), $i*200, 0, 0, 0, 200, 200, 200, 200);
+ }
+ unset($image); // unset $image here to control the lifetime of image::$resource
}
imagepng($thumbnail, OC_Config::getValue("datadirectory").'/'. OC_User::getUser() .'/gallery/' . $albumName.'.png');
}