Skip to content

Commit

Permalink
Merge pull request #601 from electerious/develop
Browse files Browse the repository at this point in the history
Lychee 3.1.3
  • Loading branch information
electerious authored Aug 22, 2016
2 parents 475ae57 + bf0ef33 commit b26cbc0
Show file tree
Hide file tree
Showing 18 changed files with 1,801 additions and 481 deletions.
Empty file modified dist/main.css
100755 → 100644
Empty file.
13 changes: 7 additions & 6 deletions dist/main.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/view.js

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## v3.1.3

Released August 22, 2016

- `Improved` rotate and flip images with GD based on EXIF orientation (Thanks @qligier, #600)
- `Improved` enter/leave fullscreen-mode by (not) moving the mouse for one second (Thanks @hrniels, #583)
- `Improved` Prefetch the medium photo instead of the big one (Thanks @Bramas, #446)
- `Improved` Added "session" to required extensions (#579)
- `Improved` Added warning if Imagick is not installed/enabled (Thanks @hrniels, #590)
- `Fixed` Don't assume that gd_info exists when running diagnostics (Thanks @hrniels, #589 #565)
- `Fixed` Sidebar showing up in smart albums when navigating back from the photo-view

## v3.1.2

Released June 12, 2016
Expand Down
41 changes: 0 additions & 41 deletions docs/Docker.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Everything you need is a web-server with PHP 5.5 or later and a MySQL-Database.

The following PHP extensions must be activated:

exif, gd, json, mbstring, mysqli, zip
session, exif, mbstring, gd, mysqli, json, zip

To use Lychee without restrictions, we recommend to increase the values of the following properties in `php.ini`:

Expand Down
10 changes: 5 additions & 5 deletions php/Modules/Album.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,30 +99,30 @@ public function get() {

case 'f':
$return['public'] = '0';
$query = Database::prepare(Database::get(), "SELECT id, title, tags, public, star, album, thumbUrl, takestamp, url FROM ? WHERE star = 1 " . Settings::get()['sortingPhotos'], array(LYCHEE_TABLE_PHOTOS));
$query = Database::prepare(Database::get(), "SELECT id, title, tags, public, star, album, thumbUrl, takestamp, url, medium FROM ? WHERE star = 1 " . Settings::get()['sortingPhotos'], array(LYCHEE_TABLE_PHOTOS));
break;

case 's':
$return['public'] = '0';
$query = Database::prepare(Database::get(), "SELECT id, title, tags, public, star, album, thumbUrl, takestamp, url FROM ? WHERE public = 1 " . Settings::get()['sortingPhotos'], array(LYCHEE_TABLE_PHOTOS));
$query = Database::prepare(Database::get(), "SELECT id, title, tags, public, star, album, thumbUrl, takestamp, url, medium FROM ? WHERE public = 1 " . Settings::get()['sortingPhotos'], array(LYCHEE_TABLE_PHOTOS));
break;

case 'r':
$return['public'] = '0';
$query = Database::prepare(Database::get(), "SELECT id, title, tags, public, star, album, thumbUrl, takestamp, url FROM ? WHERE LEFT(id, 10) >= unix_timestamp(DATE_SUB(NOW(), INTERVAL 1 DAY)) " . Settings::get()['sortingPhotos'], array(LYCHEE_TABLE_PHOTOS));
$query = Database::prepare(Database::get(), "SELECT id, title, tags, public, star, album, thumbUrl, takestamp, url, medium FROM ? WHERE LEFT(id, 10) >= unix_timestamp(DATE_SUB(NOW(), INTERVAL 1 DAY)) " . Settings::get()['sortingPhotos'], array(LYCHEE_TABLE_PHOTOS));
break;

case '0':
$return['public'] = '0';
$query = Database::prepare(Database::get(), "SELECT id, title, tags, public, star, album, thumbUrl, takestamp, url FROM ? WHERE album = 0 " . Settings::get()['sortingPhotos'], array(LYCHEE_TABLE_PHOTOS));
$query = Database::prepare(Database::get(), "SELECT id, title, tags, public, star, album, thumbUrl, takestamp, url, medium FROM ? WHERE album = 0 " . Settings::get()['sortingPhotos'], array(LYCHEE_TABLE_PHOTOS));
break;

default:
$query = Database::prepare(Database::get(), "SELECT * FROM ? WHERE id = '?' LIMIT 1", array(LYCHEE_TABLE_ALBUMS, $this->albumIDs));
$albums = Database::execute(Database::get(), $query, __METHOD__, __LINE__);
$return = $albums->fetch_assoc();
$return = Album::prepareData($return);
$query = Database::prepare(Database::get(), "SELECT id, title, tags, public, star, album, thumbUrl, takestamp, url FROM ? WHERE album = '?' " . Settings::get()['sortingPhotos'], array(LYCHEE_TABLE_PHOTOS, $this->albumIDs));
$query = Database::prepare(Database::get(), "SELECT id, title, tags, public, star, album, thumbUrl, takestamp, url, medium FROM ? WHERE album = '?' " . Settings::get()['sortingPhotos'], array(LYCHEE_TABLE_PHOTOS, $this->albumIDs));
break;

}
Expand Down
30 changes: 19 additions & 11 deletions php/Modules/Photo.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,7 @@ public function adjustFile($path, array $info) {

case 2:
// mirror
// not yet implemented
return false;
imageflip($sourceImg, IMG_FLIP_HORIZONTAL);
break;

case 3:
Expand All @@ -564,14 +563,16 @@ public function adjustFile($path, array $info) {

case 4:
// rotate 180 and mirror
// not yet implemented
return false;
imageflip($sourceImg, IMG_FLIP_VERTICAL);
break;

case 5:
// rotate 90 and mirror
// not yet implemented
return false;
$sourceImg = imagerotate($sourceImg, -90, 0);
$newWidth = $info['height'];
$newHeight = $info['width'];
$swapSize = true;
imageflip($sourceImg, IMG_FLIP_HORIZONTAL);
break;

case 6:
Expand All @@ -583,8 +584,11 @@ public function adjustFile($path, array $info) {

case 7:
// rotate -90 and mirror
// not yet implemented
return false;
$sourceImg = imagerotate($sourceImg, 90, 0);
$newWidth = $info['height'];
$newHeight = $info['width'];
$swapSize = true;
imageflip($sourceImg, IMG_FLIP_HORIZONTAL);
break;

case 8:
Expand Down Expand Up @@ -634,7 +638,7 @@ public function adjustFile($path, array $info) {
public static function prepareData(array $data) {

// Excepts the following:
// (array) $data = ['id', 'title', 'tags', 'public', 'star', 'album', 'thumbUrl', 'takestamp', 'url']
// (array) $data = ['id', 'title', 'tags', 'public', 'star', 'album', 'thumbUrl', 'takestamp', 'url', 'medium']

// Init
$photo = null;
Expand All @@ -647,7 +651,11 @@ public static function prepareData(array $data) {
$photo['star'] = $data['star'];
$photo['album'] = $data['album'];

// Parse urls
// Parse medium
if ($data['medium']==='1') $photo['medium'] = LYCHEE_URL_UPLOADS_MEDIUM . $data['url'];
else $photo['medium'] = '';

// Parse paths
$photo['thumbUrl'] = LYCHEE_URL_UPLOADS_THUMB . $data['thumbUrl'];
$photo['url'] = LYCHEE_URL_UPLOADS_BIG . $data['url'];

Expand Down Expand Up @@ -1304,4 +1312,4 @@ public function delete() {

}

?>
?>
15 changes: 11 additions & 4 deletions plugins/Diagnostics/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@
if (hasPermissions(LYCHEE_DATA)===false) $error .= ('Error: \'data/\' is missing or has insufficient read/write privileges' . PHP_EOL);

// About GD
$gdVersion = gd_info();
if (!$gdVersion['JPEG Support']) $error .= ('Error: PHP gd extension without jpeg support' . PHP_EOL);
if (!$gdVersion['PNG Support']) $error .= ('Error: PHP gd extension without png support' . PHP_EOL);
if (!$gdVersion['GIF Read Support'] || !$gdVersion['GIF Create Support']) $error .= ('Error: PHP gd extension without full gif support' . PHP_EOL);
$gdVersion = array('GD Version' => '-');
if (function_exists('gd_info')) {
$gdVersion = gd_info();
if (!$gdVersion['JPEG Support']) $error .= ('Error: PHP gd extension without jpeg support' . PHP_EOL);
if (!$gdVersion['PNG Support']) $error .= ('Error: PHP gd extension without png support' . PHP_EOL);
if (!$gdVersion['GIF Read Support'] || !$gdVersion['GIF Create Support']) $error .= ('Error: PHP gd extension without full gif support' . PHP_EOL);
}

// Load config
if (!file_exists(LYCHEE_CONFIG_FILE)) exit('Error: Configuration not found. Please install Lychee for additional tests');
Expand Down Expand Up @@ -96,6 +99,10 @@
// Check mysql version
if ($database->server_version<50500) echo('Warning: Lychee uses the GBK charset to avoid sql injections on your MySQL version. Please update to MySQL 5.5 or higher to enable UTF-8 support.' . PHP_EOL);

// Check imagick
if (!extension_loaded('imagick')) echo('Warning: Pictures that are rotated lose their metadata! Please install Imagick to avoid that.' . PHP_EOL);
else if (!$settings['imagick']) echo('Warning: Pictures that are rotated lose their metadata! Please enable Imagick in settings to avoid that.' . PHP_EOL);

// Output
if ($error==='') echo('No critical problems found. Lychee should work without problems!' . PHP_EOL);
else echo $error;
Expand Down
Loading

0 comments on commit b26cbc0

Please sign in to comment.