diff --git a/docs/Settings.md b/docs/Settings.md index b91c0f4..6bcd95f 100644 --- a/docs/Settings.md +++ b/docs/Settings.md @@ -22,12 +22,6 @@ All settings are stored in the database. You can change the properties manually, Your photos and albums are protected by a username and password. If both rows are empty, Lychee will prompt you to set them. -#### Thumb Quality - - thumbQuality = [0-100] - -Less means an inferiority quality of your thumbs, but faster loading. More means a better quality of your thumbs, but slower loading. The default value is 90. The allowed values are between 0 and 100. - #### Check For Updates checkForUpdates = [0|1] diff --git a/php/Modules/Photo.php b/php/Modules/Photo.php index fbf7854..e47712b 100755 --- a/php/Modules/Photo.php +++ b/php/Modules/Photo.php @@ -285,6 +285,9 @@ final class Photo { // Call plugins Plugins::get()->activate(__METHOD__, 0, func_get_args()); + // Quality of thumbnails + $thumbQuality = 90; + // Size of the thumbnail $newWidth = 200; $newHeight = 200; @@ -299,7 +302,7 @@ final class Photo { // Read image $thumb = new Imagick(); $thumb->readImage($url); - $thumb->setImageCompressionQuality(Settings::get()['thumbQuality']); + $thumb->setImageCompressionQuality($thumbQuality); $thumb->setImageFormat('jpeg'); // Copy image for 2nd thumb version @@ -346,12 +349,12 @@ final class Photo { // Create thumb fastImageCopyResampled($thumb, $sourceImg, 0, 0, $startWidth, $startHeight, $newWidth, $newHeight, $newSize, $newSize); - imagejpeg($thumb, $newUrl, Settings::get()['thumbQuality']); + imagejpeg($thumb, $newUrl, $thumbQuality); imagedestroy($thumb); // Create retina thumb fastImageCopyResampled($thumb2x, $sourceImg, 0, 0, $startWidth, $startHeight, $newWidth*2, $newHeight*2, $newSize, $newSize); - imagejpeg($thumb2x, $newUrl2x, Settings::get()['thumbQuality']); + imagejpeg($thumb2x, $newUrl2x, $thumbQuality); imagedestroy($thumb2x); // Free memory diff --git a/php/Modules/Session.php b/php/Modules/Session.php index 94c4278..126fb28 100755 --- a/php/Modules/Session.php +++ b/php/Modules/Session.php @@ -42,7 +42,6 @@ final class Session { // Unset unused vars unset($return['config']['skipDuplicates']); - unset($return['config']['thumbQuality']); unset($return['config']['sortingAlbums']); unset($return['config']['sortingPhotos']); unset($return['config']['dropboxKey']); diff --git a/php/database/settings_content.sql b/php/database/settings_content.sql index 907e6c4..4074590 100644 --- a/php/database/settings_content.sql +++ b/php/database/settings_content.sql @@ -6,7 +6,6 @@ VALUES ('version',''), ('username',''), ('password',''), - ('thumbQuality','90'), ('checkForUpdates','1'), ('sortingPhotos','ORDER BY id DESC'), ('sortingAlbums','ORDER BY id DESC'), diff --git a/plugins/Diagnostics/index.php b/plugins/Diagnostics/index.php index 70a89ac..9369c4d 100644 --- a/plugins/Diagnostics/index.php +++ b/plugins/Diagnostics/index.php @@ -78,7 +78,6 @@ $settings = Settings::get(); # Settings if (!isset($settings['username'])||$settings['username']=='') $error .= ('Error: Username empty or not set in database' . PHP_EOL); if (!isset($settings['password'])||$settings['password']=='') $error .= ('Error: Password empty or not set in database' . PHP_EOL); -if (!isset($settings['thumbQuality'])||$settings['thumbQuality']=='') $error .= ('Error: No or wrong property for thumbQuality in database' . PHP_EOL); if (!isset($settings['sortingPhotos'])||$settings['sortingPhotos']=='') $error .= ('Error: Wrong property for sortingPhotos in database' . PHP_EOL); if (!isset($settings['sortingAlbums'])||$settings['sortingAlbums']=='') $error .= ('Error: Wrong property for sortingAlbums in database' . PHP_EOL); if (!isset($settings['plugins'])) $error .= ('Error: No property for plugins in database' . PHP_EOL);