From 73a00aafaa5fd3340b85c153d72b0daa9fa3113a Mon Sep 17 00:00:00 2001 From: Quentin Ligier Date: Wed, 27 Apr 2016 10:10:44 +0200 Subject: [PATCH 01/20] SQL structure changes See #531 --- php/database/update_030102.php | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 php/database/update_030102.php diff --git a/php/database/update_030102.php b/php/database/update_030102.php new file mode 100644 index 0000000..c4e2677 --- /dev/null +++ b/php/database/update_030102.php @@ -0,0 +1,49 @@ + \ No newline at end of file From 5b6b64bce3925696e6ad9f8a44264c6daff7f734 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Mon, 2 May 2016 19:51:06 +0200 Subject: [PATCH 02/20] Updated version --- src/package.json | 2 +- src/scripts/lychee.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/package.json b/src/package.json index 12550fe..cdf7be2 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "Lychee", - "version": "3.1.1", + "version": "3.1.2", "description": "Self-hosted photo-management done right.", "authors": "Tobias Reich ", "license": "MIT", diff --git a/src/scripts/lychee.js b/src/scripts/lychee.js index f0187fd..105e5ba 100644 --- a/src/scripts/lychee.js +++ b/src/scripts/lychee.js @@ -6,8 +6,8 @@ lychee = { title : document.title, - version : '3.1.1', - versionCode : '030101', + version : '3.1.2', + versionCode : '030102', updatePath : '//update.electerious.com/index.json', updateURL : 'https://github.com/electerious/Lychee', From 895825ada070c34ecf0646f64546d57be65fa8c4 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Mon, 2 May 2016 19:51:21 +0200 Subject: [PATCH 03/20] Added #533 to the list of update scripts --- php/Modules/Database.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/php/Modules/Database.php b/php/Modules/Database.php index 11afdff..11924b5 100755 --- a/php/Modules/Database.php +++ b/php/Modules/Database.php @@ -14,7 +14,8 @@ final class Database { '030000', // 3.0.0 '030001', // 3.0.1 '030003', // 3.0.3 - '030100' // 3.1.0 + '030100', // 3.1.0 + '030102' // 3.1.2 ); /** From c52e93b7ac716432dc5bf03faea4db0f53ac95d1 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Mon, 2 May 2016 19:51:29 +0200 Subject: [PATCH 04/20] Small syntax adjustment to #533 --- php/database/update_030102.php | 1 - 1 file changed, 1 deletion(-) diff --git a/php/database/update_030102.php b/php/database/update_030102.php index c4e2677..06e3eb3 100644 --- a/php/database/update_030102.php +++ b/php/database/update_030102.php @@ -40,7 +40,6 @@ if ($result===false) Response::error('Could not change type of the id field!'); // Change type of the id field $query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `id` `id` BIGINT(14) UNSIGNED NOT NULL", [LYCHEE_TABLE_ALBUMS]); $result = Database::execute($connection, $query, 'update_030102', __LINE__); - if ($result===false) Response::error('Could not change type of the id field!'); // Set version From a5c47cf02298fd7e99f976acc893244a378367dd Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Mon, 2 May 2016 20:04:41 +0200 Subject: [PATCH 05/20] Use array() instead of shorthand as done in the other scripts --- php/database/update_030102.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/php/database/update_030102.php b/php/database/update_030102.php index 06e3eb3..7607284 100644 --- a/php/database/update_030102.php +++ b/php/database/update_030102.php @@ -8,37 +8,37 @@ use Lychee\Modules\Database; use Lychee\Modules\Response; // Change type of the album id field -$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `album` `album` BIGINT UNSIGNED NOT NULL", [LYCHEE_TABLE_PHOTOS]); +$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `album` `album` BIGINT UNSIGNED NOT NULL", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); if ($result===false) Response::error('Could not change type of the album id field!'); // Add index to the album id field -$query = Database::prepare($connection, "ALTER TABLE `?` ADD INDEX `Index_album` (`album`)", [LYCHEE_TABLE_PHOTOS]); +$query = Database::prepare($connection, "ALTER TABLE `?` ADD INDEX `Index_album` (`album`)", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); if ($result===false) Response::error('Could not add index to the album id field!'); // Add index to the star field -$query = Database::prepare($connection, "ALTER TABLE `?` ADD INDEX `Index_star` (`star`)", [LYCHEE_TABLE_PHOTOS]); +$query = Database::prepare($connection, "ALTER TABLE `?` ADD INDEX `Index_star` (`star`)", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); if ($result===false) Response::error('Could not add index to the star field!'); // Change type of the checksum field -$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `checksum` `checksum` CHAR(40) NULL DEFAULT NULL", [LYCHEE_TABLE_PHOTOS]); +$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `checksum` `checksum` CHAR(40) NULL DEFAULT NULL", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); if ($result===false) Response::error('Could not change type of the checksum field!'); // Change type of the thumbUrl field -$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `thumbUrl` `thumbUrl` CHAR(37) NOT NULL", [LYCHEE_TABLE_PHOTOS]); +$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `thumbUrl` `thumbUrl` CHAR(37) NOT NULL", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); if ($result===false) Response::error('Could not change type of the thumbUrl field!'); // Change type of the id field -$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `id` `id` BIGINT(14) UNSIGNED NOT NULL", [LYCHEE_TABLE_PHOTOS]); +$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `id` `id` BIGINT(14) UNSIGNED NOT NULL", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); if ($result===false) Response::error('Could not change type of the id field!'); // Change type of the id field -$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `id` `id` BIGINT(14) UNSIGNED NOT NULL", [LYCHEE_TABLE_ALBUMS]); +$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `id` `id` BIGINT(14) UNSIGNED NOT NULL", array(LYCHEE_TABLE_ALBUMS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); if ($result===false) Response::error('Could not change type of the id field!'); From 2ce58d2821ea4b571fbb194167352a01857f9f61 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Mon, 2 May 2016 20:44:41 +0200 Subject: [PATCH 06/20] Fixed error when executing update script multiple times #533 --- php/database/update_030102.php | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/php/database/update_030102.php b/php/database/update_030102.php index 7607284..c18cdcf 100644 --- a/php/database/update_030102.php +++ b/php/database/update_030102.php @@ -10,36 +10,61 @@ use Lychee\Modules\Response; // Change type of the album id field $query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `album` `album` BIGINT UNSIGNED NOT NULL", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); + if ($result===false) Response::error('Could not change type of the album id field!'); // Add index to the album id field -$query = Database::prepare($connection, "ALTER TABLE `?` ADD INDEX `Index_album` (`album`)", array(LYCHEE_TABLE_PHOTOS)); +$query = Database::prepare($connection, "SHOW INDEX FROM `?` WHERE KEY_NAME = 'Index_album'", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); -if ($result===false) Response::error('Could not add index to the album id field!'); + +if ($result===false) Response::error('Could not check if Index_album exists!'); + +if ($result->num_rows===0) { + + $query = Database::prepare($connection, "ALTER TABLE `?` ADD INDEX `Index_album` (`album`)", array(LYCHEE_TABLE_PHOTOS)); + $result = Database::execute($connection, $query, 'update_030102', __LINE__); + + if ($result===false) Response::error('Could not add index to the album id field!'); + +} // Add index to the star field -$query = Database::prepare($connection, "ALTER TABLE `?` ADD INDEX `Index_star` (`star`)", array(LYCHEE_TABLE_PHOTOS)); +$query = Database::prepare($connection, "SHOW INDEX FROM `?` WHERE KEY_NAME = 'Index_star'", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); -if ($result===false) Response::error('Could not add index to the star field!'); + +if ($result===false) Response::error('Could not check if Index_star exists!'); + +if ($result->num_rows===0) { + + $query = Database::prepare($connection, "ALTER TABLE `?` ADD INDEX `Index_star` (`star`)", array(LYCHEE_TABLE_PHOTOS)); + $result = Database::execute($connection, $query, 'update_030102', __LINE__); + + if ($result===false) Response::error('Could not add index to the star field!'); + +} // Change type of the checksum field $query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `checksum` `checksum` CHAR(40) NULL DEFAULT NULL", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); + if ($result===false) Response::error('Could not change type of the checksum field!'); // Change type of the thumbUrl field $query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `thumbUrl` `thumbUrl` CHAR(37) NOT NULL", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); + if ($result===false) Response::error('Could not change type of the thumbUrl field!'); // Change type of the id field $query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `id` `id` BIGINT(14) UNSIGNED NOT NULL", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); + if ($result===false) Response::error('Could not change type of the id field!'); // Change type of the id field $query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `id` `id` BIGINT(14) UNSIGNED NOT NULL", array(LYCHEE_TABLE_ALBUMS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); + if ($result===false) Response::error('Could not change type of the id field!'); // Set version From 70cd7f8a47cd469ed1e2409d2e34dd4b0a07933d Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Wed, 1 Jun 2016 21:42:01 +0200 Subject: [PATCH 07/20] Protocol-relative URLs for open graph #546 --- php/helpers/getGraphHeader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/helpers/getGraphHeader.php b/php/helpers/getGraphHeader.php index 77e48a7..c50b173 100644 --- a/php/helpers/getGraphHeader.php +++ b/php/helpers/getGraphHeader.php @@ -24,8 +24,8 @@ function getGraphHeader($photoID) { else $dir = 'big'; $parseUrl = parse_url('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); - $url = $parseUrl['scheme'] . '://' . $parseUrl['host'] . $parseUrl['path'] . '?' . $parseUrl['query']; - $picture = $parseUrl['scheme'] . '://' . $parseUrl['host'] . $parseUrl['path'] . '/../uploads/' . $dir . '/' . $row->url; + $url = '//' . $parseUrl['host'] . $parseUrl['path'] . '?' . $parseUrl['query']; + $picture = '//' . $parseUrl['host'] . $parseUrl['path'] . '/../uploads/' . $dir . '/' . $row->url; $url = htmlentities($url); $picture = htmlentities($picture); From a9cfa87fd24953cf15023253181817e9880943e4 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 5 Jun 2016 15:47:41 +0200 Subject: [PATCH 08/20] Improved orientation-handling with Imagick #556 --- php/Modules/Photo.php | 75 ++++++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 23 deletions(-) diff --git a/php/Modules/Photo.php b/php/Modules/Photo.php index 8870307..b4fccda 100755 --- a/php/Modules/Photo.php +++ b/php/Modules/Photo.php @@ -472,38 +472,67 @@ final class Photo { if (extension_loaded('imagick')&&Settings::get()['imagick']==='1') { - switch ($info['orientation']) { + $image = new Imagick(); + $image->readImage($path); - case 3: - $rotateImage = 180; - break; + $orientation = $image->getImageOrientation(); - case 6: - $rotateImage = 90; - $swapSize = true; - break; + // Check if the images needs to be adjusted at all + if ($orientation!==Imagick::ORIENTATION_TOPLEFT) { - case 8: - $rotateImage = 270; - $swapSize = true; - break; + switch ($orientation) { - default: - return false; - break; + case Imagick::ORIENTATION_TOPLEFT: + break; - } + case Imagick::ORIENTATION_TOPRIGHT: + $image->flopImage(); + break; - if ($rotateImage!==0) { - $image = new Imagick(); - $image->readImage($path); - $image->rotateImage(new ImagickPixel(), $rotateImage); - $image->setImageOrientation(1); + case Imagick::ORIENTATION_BOTTOMRIGHT: + $image->rotateImage(new ImagickPixel(), 180); + break; + + case Imagick::ORIENTATION_BOTTOMLEFT: + $image->flopImage(); + $image->rotateImage(new ImagickPixel(), 180); + break; + + case Imagick::ORIENTATION_LEFTTOP: + $image->flopImage(); + $image->rotateImage(new ImagickPixel(), -90); + $swapSize = true; + break; + + case Imagick::ORIENTATION_RIGHTTOP: + $image->rotateImage(new ImagickPixel(), 90); + $swapSize = true; + break; + + case Imagick::ORIENTATION_RIGHTBOTTOM: + $image->flopImage(); + $image->rotateImage(new ImagickPixel(), 90); + $swapSize = true; + break; + + case Imagick::ORIENTATION_LEFTBOTTOM: + $image->rotateImage(new ImagickPixel(), -90); + $swapSize = true; + break; + + default: + break; + + } + + $image->setImageOrientation(Imagick::ORIENTATION_TOPLEFT); $image->writeImage($path); - $image->clear(); - $image->destroy(); + } + $image->clear(); + $image->destroy(); + } else { $newWidth = $info['width']; From c6cb750363843a9f9b1fb724697eebe03a220008 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 5 Jun 2016 15:53:00 +0200 Subject: [PATCH 09/20] Removed comment that somehow destroyed the whole syntax highlighting in Atom --- php/Modules/Photo.php | 1 - 1 file changed, 1 deletion(-) diff --git a/php/Modules/Photo.php b/php/Modules/Photo.php index b4fccda..815a5e9 100755 --- a/php/Modules/Photo.php +++ b/php/Modules/Photo.php @@ -238,7 +238,6 @@ final class Photo { } - // Save to DB $values = array(LYCHEE_TABLE_PHOTOS, $id, $info['title'], $photo_name, $info['description'], $info['tags'], $info['type'], $info['width'], $info['height'], $info['size'], $info['iso'], $info['aperture'], $info['make'], $info['model'], $info['shutter'], $info['focal'], $info['takestamp'], $path_thumb, $albumID, $public, $star, $checksum, $medium); $query = Database::prepare(Database::get(), "INSERT INTO ? (id, title, url, description, tags, type, width, height, size, iso, aperture, make, model, shutter, focal, takestamp, thumbUrl, album, public, star, checksum, medium) VALUES ('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?')", $values); $result = Database::execute(Database::get(), $query, __METHOD__, __LINE__); From 57acac71da395e9e5e200a5ca6948f7a65b47026 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sat, 11 Jun 2016 15:53:13 +0200 Subject: [PATCH 10/20] Renamed thumb quality variable --- php/Modules/Photo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/Modules/Photo.php b/php/Modules/Photo.php index 815a5e9..8ec06ba 100755 --- a/php/Modules/Photo.php +++ b/php/Modules/Photo.php @@ -295,7 +295,7 @@ final class Photo { Plugins::get()->activate(__METHOD__, 0, func_get_args()); // Quality of thumbnails - $thumbQuality = 90; + $quality = 90; // Size of the thumbnail $newWidth = 200; @@ -311,7 +311,7 @@ final class Photo { // Read image $thumb = new Imagick(); $thumb->readImage($url); - $thumb->setImageCompressionQuality($thumbQuality); + $thumb->setImageCompressionQuality($quality); $thumb->setImageFormat('jpeg'); // Copy image for 2nd thumb version From 55628f1f5659cf84a49a84a356ecf0e9670c2a15 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sat, 11 Jun 2016 15:54:41 +0200 Subject: [PATCH 11/20] Remove metadata from medium-photos and thumbs + Reduce quality of medium-photos #556 --- php/Modules/Photo.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/php/Modules/Photo.php b/php/Modules/Photo.php index 8ec06ba..923fe75 100755 --- a/php/Modules/Photo.php +++ b/php/Modules/Photo.php @@ -314,6 +314,9 @@ final class Photo { $thumb->setImageCompressionQuality($quality); $thumb->setImageFormat('jpeg'); + // Remove metadata to save some bytes + $thumb->stripImage(); + // Copy image for 2nd thumb version $thumb2x = clone $thumb; @@ -394,6 +397,9 @@ final class Photo { // Call plugins Plugins::get()->activate(__METHOD__, 0, func_get_args()); + // Quality of medium-photo + $quality = 90; + // Set to true when creation of medium-photo failed $error = false; @@ -426,6 +432,8 @@ final class Photo { // Adjust image $medium->scaleImage($newWidth, $newHeight, true); + $medium->stripImage(); + $medium->setImageCompressionQuality($quality); // Save image try { $medium->writeImage($newUrl); } From 9bfa149d29364a0032408d490cf2edc49c2e2177 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sat, 11 Jun 2016 15:55:05 +0200 Subject: [PATCH 12/20] EXIF orientation rotation code adjustments #556 --- php/Modules/Photo.php | 87 +++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/php/Modules/Photo.php b/php/Modules/Photo.php index 923fe75..955f0d9 100755 --- a/php/Modules/Photo.php +++ b/php/Modules/Photo.php @@ -484,59 +484,58 @@ final class Photo { $orientation = $image->getImageOrientation(); - // Check if the images needs to be adjusted at all - if ($orientation!==Imagick::ORIENTATION_TOPLEFT) { + switch ($orientation) { - switch ($orientation) { + case Imagick::ORIENTATION_TOPLEFT: + return false; + break; - case Imagick::ORIENTATION_TOPLEFT: - break; + case Imagick::ORIENTATION_TOPRIGHT: + $image->flopImage(); + break; - case Imagick::ORIENTATION_TOPRIGHT: - $image->flopImage(); - break; + case Imagick::ORIENTATION_BOTTOMRIGHT: + $image->rotateImage(new ImagickPixel(), 180); + break; - case Imagick::ORIENTATION_BOTTOMRIGHT: - $image->rotateImage(new ImagickPixel(), 180); - break; + case Imagick::ORIENTATION_BOTTOMLEFT: + $image->flopImage(); + $image->rotateImage(new ImagickPixel(), 180); + break; - case Imagick::ORIENTATION_BOTTOMLEFT: - $image->flopImage(); - $image->rotateImage(new ImagickPixel(), 180); - break; + case Imagick::ORIENTATION_LEFTTOP: + $image->flopImage(); + $image->rotateImage(new ImagickPixel(), -90); + $swapSize = true; + break; - case Imagick::ORIENTATION_LEFTTOP: - $image->flopImage(); - $image->rotateImage(new ImagickPixel(), -90); - $swapSize = true; - break; + case Imagick::ORIENTATION_RIGHTTOP: + $image->rotateImage(new ImagickPixel(), 90); + $swapSize = true; + break; - case Imagick::ORIENTATION_RIGHTTOP: - $image->rotateImage(new ImagickPixel(), 90); - $swapSize = true; - break; + case Imagick::ORIENTATION_RIGHTBOTTOM: + $image->flopImage(); + $image->rotateImage(new ImagickPixel(), 90); + $swapSize = true; + break; - case Imagick::ORIENTATION_RIGHTBOTTOM: - $image->flopImage(); - $image->rotateImage(new ImagickPixel(), 90); - $swapSize = true; - break; + case Imagick::ORIENTATION_LEFTBOTTOM: + $image->rotateImage(new ImagickPixel(), -90); + $swapSize = true; + break; - case Imagick::ORIENTATION_LEFTBOTTOM: - $image->rotateImage(new ImagickPixel(), -90); - $swapSize = true; - break; - - default: - break; - - } - - $image->setImageOrientation(Imagick::ORIENTATION_TOPLEFT); - $image->writeImage($path); + default: + return false; + break; } + // Adjust photo + $image->setImageOrientation(Imagick::ORIENTATION_TOPLEFT); + $image->writeImage($path); + + // Free memory $image->clear(); $image->destroy(); @@ -548,6 +547,11 @@ final class Photo { switch ($info['orientation']) { + case 1: + // do nothing + return false; + break; + case 2: // mirror // not yet implemented @@ -597,6 +601,7 @@ final class Photo { } // Recreate photo + // In this step the photos also loses its metadata :( $newSourceImg = imagecreatetruecolor($newWidth, $newHeight); imagecopyresampled($newSourceImg, $sourceImg, 0, 0, 0, 0, $newWidth, $newHeight, $newWidth, $newHeight); imagejpeg($newSourceImg, $path, 100); From 2bcccc41faf6e227fefd0298ded16b15bcdcd6fc Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sat, 11 Jun 2016 17:12:08 +0200 Subject: [PATCH 13/20] Adjustment in Changelog --- docs/Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index d770484..ab80c15 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -6,7 +6,7 @@ Released April 30, 2016 - `New` Import of IPTC photo tags (Thanks @qligier, #514) - `New` Added reset username and password to FAQ (#500 #128) - `Improved` Removed will-change from the main image to improve the image rendering in Chrome (#501) -- `Improved ` scroll and rendering performance by removing will-change +- `Improved` scroll and rendering performance by removing will-change - `Improved` Open Facebook and Twitter sharing sheet in new window - `Improved` EXIF and IPTC extraction (Thanks @qligier, #518) - `Fixed` broken URL in Update.md (#516) From 5c4f3413b15dce12c745ae2f1fb20c027c8937b8 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sat, 11 Jun 2016 17:12:42 +0200 Subject: [PATCH 14/20] Updated default tables to reflect changes made in #533 --- php/database/albums_table.sql | 4 ++-- php/database/log_table.sql | 4 ++-- php/database/photos_table.sql | 16 +++++++++------- php/database/settings_table.sql | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/php/database/albums_table.sql b/php/database/albums_table.sql index ea94d41..76c4272 100644 --- a/php/database/albums_table.sql +++ b/php/database/albums_table.sql @@ -2,7 +2,7 @@ # ------------------------------------------------------------ CREATE TABLE IF NOT EXISTS `?` ( - `id` bigint(14) NOT NULL, + `id` bigint(14) unsigned NOT NULL, `title` varchar(100) NOT NULL DEFAULT '', `description` varchar(1000) DEFAULT '', `sysstamp` int(11) NOT NULL, @@ -11,4 +11,4 @@ CREATE TABLE IF NOT EXISTS `?` ( `downloadable` tinyint(1) NOT NULL DEFAULT '0', `password` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; \ No newline at end of file +) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/php/database/log_table.sql b/php/database/log_table.sql index c5869bf..64d9c26 100644 --- a/php/database/log_table.sql +++ b/php/database/log_table.sql @@ -7,6 +7,6 @@ CREATE TABLE IF NOT EXISTS `?` ( `type` varchar(11) NOT NULL, `function` varchar(100) NOT NULL, `line` int(11) NOT NULL, - `text` TEXT, + `text` text, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/php/database/photos_table.sql b/php/database/photos_table.sql index bd265e8..7e4f0fb 100644 --- a/php/database/photos_table.sql +++ b/php/database/photos_table.sql @@ -2,8 +2,8 @@ # ------------------------------------------------------------ CREATE TABLE IF NOT EXISTS `?` ( - `id` bigint(14) NOT NULL, - `title` varchar(100) NOT NULL, + `id` bigint(14) unsigned NOT NULL, + `title` varchar(100) NOT NULL DEFAULT '', `description` varchar(1000) DEFAULT '', `url` varchar(100) NOT NULL, `tags` varchar(1000) NOT NULL DEFAULT '', @@ -20,9 +20,11 @@ CREATE TABLE IF NOT EXISTS `?` ( `focal` varchar(20) NOT NULL, `takestamp` int(11) DEFAULT NULL, `star` tinyint(1) NOT NULL, - `thumbUrl` varchar(50) NOT NULL, - `album` varchar(30) NOT NULL DEFAULT '0', - `checksum` VARCHAR(100) DEFAULT NULL, + `thumbUrl` char(37) NOT NULL, + `album` bigint(20) unsigned NOT NULL, + `checksum` char(40) DEFAULT NULL, `medium` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; \ No newline at end of file + PRIMARY KEY (`id`), + KEY `Index_album` (`album`), + KEY `Index_star` (`star`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/php/database/settings_table.sql b/php/database/settings_table.sql index bdc1cf2..55cb88c 100644 --- a/php/database/settings_table.sql +++ b/php/database/settings_table.sql @@ -4,4 +4,4 @@ CREATE TABLE IF NOT EXISTS `?` ( `key` varchar(50) NOT NULL DEFAULT '', `value` varchar(200) DEFAULT '' -) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; \ No newline at end of file +) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file From a38a5ded4d48788ad75bf4b7a41eb87e837dd0ba Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sat, 11 Jun 2016 17:12:59 +0200 Subject: [PATCH 15/20] Use bigint(14) for album if in photo table #533 --- php/database/update_030102.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/database/update_030102.php b/php/database/update_030102.php index c18cdcf..145dbee 100644 --- a/php/database/update_030102.php +++ b/php/database/update_030102.php @@ -8,7 +8,7 @@ use Lychee\Modules\Database; use Lychee\Modules\Response; // Change type of the album id field -$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `album` `album` BIGINT UNSIGNED NOT NULL", array(LYCHEE_TABLE_PHOTOS)); +$query = Database::prepare($connection, "ALTER TABLE `?` CHANGE `album` `album` BIGINT(14) UNSIGNED NOT NULL", array(LYCHEE_TABLE_PHOTOS)); $result = Database::execute($connection, $query, 'update_030102', __LINE__); if ($result===false) Response::error('Could not change type of the album id field!'); From 9cab1c1a8524815f3ca40badbffad714c6de5215 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sat, 11 Jun 2016 17:13:09 +0200 Subject: [PATCH 16/20] Updated changelog with v3.1.2 --- docs/Changelog.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/Changelog.md b/docs/Changelog.md index ab80c15..644b496 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,3 +1,13 @@ +## v3.1.2 + +Released June ?, 2016 + +- `Improved` Added indexes to SQL fields to improve query execution time (Thanks @qligier, #533) +- `Improved` Protocol-relative URLs for open graph metadata (#546) +- `Improved` Remove metadata from medium-sized images and thumbnails (Imagick only) (#556) +- `Improved` Reduce quality of medium-sized images (Imagick only) (#556) +- `Improved` orientation-handling with Imagick (#556) + ## v3.1.1 Released April 30, 2016 From 1adc2dec00a4bc9174ea5cfca509404504996cab Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 12 Jun 2016 17:06:25 +0200 Subject: [PATCH 17/20] Fixed GD thumb quality using wrong variable --- php/Modules/Photo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/Modules/Photo.php b/php/Modules/Photo.php index 955f0d9..0da0fbb 100755 --- a/php/Modules/Photo.php +++ b/php/Modules/Photo.php @@ -361,12 +361,12 @@ final class Photo { // Create thumb fastImageCopyResampled($thumb, $sourceImg, 0, 0, $startWidth, $startHeight, $newWidth, $newHeight, $newSize, $newSize); - imagejpeg($thumb, $newUrl, $thumbQuality); + imagejpeg($thumb, $newUrl, $quality); imagedestroy($thumb); // Create retina thumb fastImageCopyResampled($thumb2x, $sourceImg, 0, 0, $startWidth, $startHeight, $newWidth*2, $newHeight*2, $newSize, $newSize); - imagejpeg($thumb2x, $newUrl2x, $thumbQuality); + imagejpeg($thumb2x, $newUrl2x, $quality); imagedestroy($thumb2x); // Free memory From 659a570b2ec4ca5ea1569598f1ab9a7f42a744f5 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 12 Jun 2016 17:44:33 +0200 Subject: [PATCH 18/20] Save database update version for 3.1.2 --- php/database/update_030102.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/database/update_030102.php b/php/database/update_030102.php index 145dbee..cf89ddc 100644 --- a/php/database/update_030102.php +++ b/php/database/update_030102.php @@ -68,6 +68,6 @@ $result = Database::execute($connection, $query, 'update_030102', __LINE__); if ($result===false) Response::error('Could not change type of the id field!'); // Set version -//if (Database::setVersion($connection, '030102')===false) Response::error('Could not update version of database!'); +if (Database::setVersion($connection, '030102')===false) Response::error('Could not update version of database!'); ?> \ No newline at end of file From a50f2c997a5531c8b30cd0dac7448e7fa4535a23 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 12 Jun 2016 17:47:32 +0200 Subject: [PATCH 19/20] Added release date to change log --- docs/Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index 644b496..63cd607 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,6 +1,6 @@ ## v3.1.2 -Released June ?, 2016 +Released June 12, 2016 - `Improved` Added indexes to SQL fields to improve query execution time (Thanks @qligier, #533) - `Improved` Protocol-relative URLs for open graph metadata (#546) From 8c279a5550fdcc9bcb01e4711a225bb0b0d66858 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 12 Jun 2016 18:16:51 +0200 Subject: [PATCH 20/20] Rebuild --- dist/main.js | Bin 192119 -> 192119 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dist/main.js b/dist/main.js index b6d91fbd67b00c10fa41ef75f8d1bc83365c049b..8bae640725564715c7b86e0da455c52a19958bff 100644 GIT binary patch delta 42 ycmex