summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-09-30 10:49:48 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-09-30 10:49:48 +0200
commit1051a3c6f5891e703a15225e12bbb9417755a860 (patch)
tree42309f8969042a29e2274e1b3d89da5a97dc322b
parentdb79ba547aaf4e3c8ab732aece11f8d738ebad95 (diff)
downloadnextcloud-server-1051a3c6f5891e703a15225e12bbb9417755a860.tar.gz
nextcloud-server-1051a3c6f5891e703a15225e12bbb9417755a860.zip
Change small thumbnails to 32 px
* fixes #16913 * fixes issues in IE8 where the thumbnail is too big
-rw-r--r--apps/files/js/filelist.js4
-rw-r--r--apps/files/templates/list.php2
-rw-r--r--apps/files_sharing/ajax/publicpreview.php4
-rw-r--r--apps/files_sharing/js/public.js4
-rw-r--r--apps/files_trashbin/lib/trashbin.php2
-rw-r--r--core/ajax/preview.php4
-rw-r--r--lib/private/helper.php4
-rw-r--r--lib/private/preview/txt.php2
-rw-r--r--tests/lib/preview.php4
9 files changed, 15 insertions, 15 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index b4cc71e2d3b..16aa643d11b 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1408,10 +1408,10 @@
generatePreviewUrl: function(urlSpec) {
urlSpec = urlSpec || {};
if (!urlSpec.x) {
- urlSpec.x = this.$table.data('preview-x') || 36;
+ urlSpec.x = this.$table.data('preview-x') || 32;
}
if (!urlSpec.y) {
- urlSpec.y = this.$table.data('preview-y') || 36;
+ urlSpec.y = this.$table.data('preview-y') || 32;
}
urlSpec.x *= window.devicePixelRatio;
urlSpec.y *= window.devicePixelRatio;
diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php
index bbbce8473de..7ebf80ee8b2 100644
--- a/apps/files/templates/list.php
+++ b/apps/files/templates/list.php
@@ -51,7 +51,7 @@
<p></p>
</div>
-<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="36" data-preview-y="36">
+<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="32" data-preview-y="32">
<thead>
<tr>
<th id='headerName' class="hidden column-name">
diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php
index 6ddd4786c2a..69894bb8da5 100644
--- a/apps/files_sharing/ajax/publicpreview.php
+++ b/apps/files_sharing/ajax/publicpreview.php
@@ -28,8 +28,8 @@ OCP\JSON::checkAppEnabled('files_sharing');
\OC_User::setIncognitoMode(true);
$file = array_key_exists('file', $_GET) ? (string) $_GET['file'] : '';
-$maxX = array_key_exists('x', $_GET) ? (int) $_GET['x'] : '36';
-$maxY = array_key_exists('y', $_GET) ? (int) $_GET['y'] : '36';
+$maxX = array_key_exists('x', $_GET) ? (int) $_GET['x'] : '32';
+$maxY = array_key_exists('y', $_GET) ? (int) $_GET['y'] : '32';
$scalingUp = array_key_exists('scalingup', $_GET) ? (bool) $_GET['scalingup'] : true;
$token = array_key_exists('t', $_GET) ? (string) $_GET['t'] : '';
$keepAspect = array_key_exists('a', $_GET) ? true : false;
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 6a6095317af..1c3d4b9ac32 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -161,10 +161,10 @@ OCA.Sharing.PublicApp = {
this.fileList.generatePreviewUrl = function (urlSpec) {
urlSpec = urlSpec || {};
if (!urlSpec.x) {
- urlSpec.x = 36;
+ urlSpec.x = 32;
}
if (!urlSpec.y) {
- urlSpec.y = 36;
+ urlSpec.y = 32;
}
urlSpec.x *= window.devicePixelRatio;
urlSpec.y *= window.devicePixelRatio;
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index 2a9df94988d..840fd4fa146 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -908,6 +908,6 @@ class Trashbin {
* @return string
*/
public static function preview_icon($path) {
- return \OCP\Util::linkToRoute('core_ajax_trashbin_preview', array('x' => 36, 'y' => 36, 'file' => $path));
+ return \OCP\Util::linkToRoute('core_ajax_trashbin_preview', array('x' => 32, 'y' => 32, 'file' => $path));
}
}
diff --git a/core/ajax/preview.php b/core/ajax/preview.php
index baa0ed4ec61..c8bc05453ed 100644
--- a/core/ajax/preview.php
+++ b/core/ajax/preview.php
@@ -26,8 +26,8 @@
\OC::$server->getSession()->close();
$file = array_key_exists('file', $_GET) ? (string)$_GET['file'] : '';
-$maxX = array_key_exists('x', $_GET) ? (int)$_GET['x'] : '36';
-$maxY = array_key_exists('y', $_GET) ? (int)$_GET['y'] : '36';
+$maxX = array_key_exists('x', $_GET) ? (int)$_GET['x'] : '32';
+$maxY = array_key_exists('y', $_GET) ? (int)$_GET['y'] : '32';
$scalingUp = array_key_exists('scalingup', $_GET) ? (bool)$_GET['scalingup'] : true;
$keepAspect = array_key_exists('a', $_GET) ? true : false;
$always = array_key_exists('forceIcon', $_GET) ? (bool)$_GET['forceIcon'] : true;
diff --git a/lib/private/helper.php b/lib/private/helper.php
index b8e4b451835..dcd263daa24 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -193,11 +193,11 @@ class OC_Helper {
* Returns the path to the preview of the file.
*/
public static function previewIcon($path) {
- return self::linkToRoute( 'core_ajax_preview', array('x' => 36, 'y' => 36, 'file' => $path ));
+ return self::linkToRoute( 'core_ajax_preview', array('x' => 32, 'y' => 32, 'file' => $path ));
}
public static function publicPreviewIcon( $path, $token ) {
- return self::linkToRoute( 'core_ajax_public_preview', array('x' => 36, 'y' => 36, 'file' => $path, 't' => $token));
+ return self::linkToRoute( 'core_ajax_public_preview', array('x' => 32, 'y' => 32, 'file' => $path, 't' => $token));
}
/**
diff --git a/lib/private/preview/txt.php b/lib/private/preview/txt.php
index 0bba570a8c9..2fdc86d9546 100644
--- a/lib/private/preview/txt.php
+++ b/lib/private/preview/txt.php
@@ -53,7 +53,7 @@ class TXT extends Provider {
$lines = preg_split("/\r\n|\n|\r/", $content);
- $fontSize = ($maxX) ? (int) ((5 / 36) * $maxX) : 5; //5px
+ $fontSize = ($maxX) ? (int) ((5 / 32) * $maxX) : 5; //5px
$lineSize = ceil($fontSize * 1.25);
$image = imagecreate($maxX, $maxY);
diff --git a/tests/lib/preview.php b/tests/lib/preview.php
index 9e118014bac..de1669cbf85 100644
--- a/tests/lib/preview.php
+++ b/tests/lib/preview.php
@@ -534,10 +534,10 @@ class Preview extends TestCase {
// Small thumbnails are always cropped
$this->keepAspect = false;
// Smaller previews should be based on the previous, larger preview, with the correct aspect ratio
- $this->createThumbnailFromBiggerCachedPreview($fileId, 36, 36);
+ $this->createThumbnailFromBiggerCachedPreview($fileId, 32, 32);
// 2nd cache query should indicate that we have a cached copy of the exact dimension
- $this->getCachedSmallThumbnail($fileId, 36, 36);
+ $this->getCachedSmallThumbnail($fileId, 32, 32);
// We create a preview in order to be able to delete the cache
$preview = $this->createPreview(rand(), rand());