Skip to content

Commit

Permalink
Removed medium option
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
electerious committed Feb 14, 2016
1 parent 5aecee4 commit 46f520e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 24 deletions.
6 changes: 0 additions & 6 deletions docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 1 addition & 3 deletions php/Modules/Photo.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private function createThumb($url, $filename, $type, $width, $height) {

/**
* 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) {
Expand Down Expand Up @@ -413,11 +413,9 @@ private function createMedium($url, $filename, $width, $height) {
}

// 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;
Expand Down
1 change: 0 additions & 1 deletion php/Modules/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function init($public = true) {
unset($return['config']['login']);
unset($return['config']['location']);
unset($return['config']['imagick']);
unset($return['config']['medium']);
unset($return['config']['plugins']);

}
Expand Down
1 change: 0 additions & 1 deletion php/database/settings_content.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ VALUES
('checkForUpdates','1'),
('sortingPhotos','ORDER BY id DESC'),
('sortingAlbums','ORDER BY id DESC'),
('medium','1'),
('imagick','1'),
('dropboxKey',''),
('identifier',''),
Expand Down
13 changes: 0 additions & 13 deletions php/database/update_020700.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,6 @@

}

// 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;

Expand Down

0 comments on commit 46f520e

Please sign in to comment.