Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2012-06-10 15:04:42 +0400
committerBartek Przybylski <bart.p.pl@gmail.com>2012-06-10 15:19:22 +0400
commitde6b683b501795be1717ecfa57fd683ae8270c4b (patch)
tree9da76543edca156bc4a170ac30fa8b8483052457 /apps
parent2dca0926b031267a8414d4368ea01fae83daf6c8 (diff)
fix first time image loading error
Diffstat (limited to 'apps')
-rw-r--r--apps/gallery/lib/managers.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/gallery/lib/managers.php b/apps/gallery/lib/managers.php
index f9a67b8b117..9a2dbd3bae2 100644
--- a/apps/gallery/lib/managers.php
+++ b/apps/gallery/lib/managers.php
@@ -26,10 +26,8 @@ class DatabaseManager {
if (!$image->loadFromFile($path)) {
return false;
}
- \OCP\DB::beginTransaction();
$stmt = \OCP\DB::prepare('INSERT INTO *PREFIX*pictures_images_cache (uid_owner, path, width, height) VALUES (?, ?, ?, ?)');
$stmt->execute(array(\OCP\USER::getUser(), $path, $image->width(), $image->height()));
- \OCP\DB::commit();
$ret = array('path' => $path, 'width' => $image->width(), 'height' => $image->height());
unset($image);
return $ret;
@@ -78,9 +76,14 @@ class ThumbnailsManager {
public function getThumbnailInfo($path) {
$arr = DatabaseManager::getInstance()->getFileData($path);
+ if (!$arr) {
+ $thubnail = $this->getThumbnail($path);
+ unset($thubnail);
+ $arr = DatabaseManager::getInstance()->getFileData($path);
+ }
$ret = array('filepath' => $arr['path'],
- 'width' => $arr['width'],
- 'height' => $arr['height']);
+ 'width' => $arr['width'],
+ 'height' => $arr['height']);
return $ret;
}