Removed medium option

Lychee will automatically create medium-sized photos when the photo ist big enough and Imagick installed and activated. It's no longer possible to deactivate it.
This commit is contained in:
Tobias Reich 2016-02-14 14:09:49 +01:00
parent 5aecee4873
commit 46f520e1fe
5 changed files with 1 additions and 24 deletions

View File

@ -52,12 +52,6 @@ This key is required to use the Dropbox import feature from your server. Lychee
If `1`, Lychee will use Imagick when available. Disable [Imagick](http://www.imagemagick.org) if you have problems or if you are using an outdated version. Lychee will use [GD](http://php.net/manual/en/book.image.php) when Imagick is disabled or not available.
#### Medium
medium = [0|1]
If `1`, Lychee will create a second, smaller version of your photo. This feature requires [Imagick](http://www.imagemagick.org) on your server and an activated `imagick` option the the settings table.
#### Skip Duplicates on Upload
skipDuplicates = [0|1]

View File

@ -380,7 +380,7 @@ final class Photo {
/**
* Creates a smaller version of a photo when its size is bigger than a preset size.
* Photo must be big enough, medium must be activated and Imagick must be installed and activated.
* Photo must be big enough and Imagick must be installed and activated.
* @return boolean Returns true when successful.
*/
private function createMedium($url, $filename, $width, $height) {
@ -413,11 +413,9 @@ final class Photo {
}
// Is photo big enough?
// Is medium activated?
// Is Imagick installed and activated?
if (($error===false)&&
($width>$newWidth||$height>$newHeight)&&
(Settings::get()['medium']==='1')&&
(extension_loaded('imagick')&&Settings::get()['imagick']==='1')) {
$newUrl = LYCHEE_UPLOADS_MEDIUM . $filename;

View File

@ -50,7 +50,6 @@ final class Session {
unset($return['config']['login']);
unset($return['config']['location']);
unset($return['config']['imagick']);
unset($return['config']['medium']);
unset($return['config']['plugins']);
}

View File

@ -9,7 +9,6 @@ VALUES
('checkForUpdates','1'),
('sortingPhotos','ORDER BY id DESC'),
('sortingAlbums','ORDER BY id DESC'),
('medium','1'),
('imagick','1'),
('dropboxKey',''),
('identifier',''),

View File

@ -31,19 +31,6 @@ if (is_dir(LYCHEE_UPLOADS_MEDIUM)===false) {
}
// Add medium to settings
$query = Database::prepare($connection, "SELECT `key` FROM `?` WHERE `key` = 'medium' LIMIT 1", array(LYCHEE_TABLE_SETTINGS));
$result = Database::execute($connection, $query, 'update_020700', __LINE__);
if ($result->num_rows===0) {
$query = Database::prepare($connection, "INSERT INTO `?` (`key`, `value`) VALUES ('medium', '1')", array(LYCHEE_TABLE_SETTINGS));
$result = Database::execute($connection, $query, 'update_020700', __LINE__);
if ($result===false) return false;
}
// Set version
if (Database::setVersion($connection, '020700')===false) return false;