Skip to content
Snippets Groups Projects
Commit aa0fc3c6 authored by Bartek Przybylski's avatar Bartek Przybylski
Browse files

aviod incorrect image size returning in gallery listing

parent 671fe498
Branches
No related tags found
No related merge requests found
......@@ -32,9 +32,10 @@ class DatabaseManager {
\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()));
unset($image);
\OCP\DB::commit();
return $this->getFileData($path);
$ret = array('filepath' => $path, 'width' => $image->width(), 'height' => $image->height());
unset($image);
return $ret;
}
private function __construct() {}
......
......@@ -42,7 +42,7 @@ function o(element) {
function openNewGal(album_name) {
root = root + album_name + "/";
var url = window.location.toString().replace(window.location.search, '');
url = url + "?app=gallery&root="+root;
url = url + "?app=gallery&root="+encodeURIComponent(root);
window.location = url;
}
......@@ -85,6 +85,7 @@ for($i = 0; $i < count($images); $i++) {
$dir_arr = explode('/', $previous_element);
if (count($images)>1) {
if (count($dir_arr)==0) {
$tl->addTile(new \OC\Pictures\TileSingle($previous_element));
} else if (count($dir_arr) && $ts->getCount() == 0){
......@@ -93,6 +94,7 @@ if (count($dir_arr)==0) {
$arr[] = $previous_element;
$ts->addTile($arr);
}
}
if ($ts->getCount() != 0) {
$tl->addTile($ts);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment