Skip to content

Commit b26cbc0

Browse files
authored
Merge pull request #601 from electerious/develop
Lychee 3.1.3
2 parents 475ae57 + bf0ef33 commit b26cbc0

18 files changed

+1801
-481
lines changed

dist/main.css

100755100644
File mode changed.

dist/main.js

+7-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/view.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/Changelog.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## v3.1.3
2+
3+
Released August 22, 2016
4+
5+
- `Improved` rotate and flip images with GD based on EXIF orientation (Thanks @qligier, #600)
6+
- `Improved` enter/leave fullscreen-mode by (not) moving the mouse for one second (Thanks @hrniels, #583)
7+
- `Improved` Prefetch the medium photo instead of the big one (Thanks @Bramas, #446)
8+
- `Improved` Added "session" to required extensions (#579)
9+
- `Improved` Added warning if Imagick is not installed/enabled (Thanks @hrniels, #590)
10+
- `Fixed` Don't assume that gd_info exists when running diagnostics (Thanks @hrniels, #589 #565)
11+
- `Fixed` Sidebar showing up in smart albums when navigating back from the photo-view
12+
113
## v3.1.2
214

315
Released June 12, 2016

docs/Docker.md

-41
This file was deleted.

docs/Installation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Everything you need is a web-server with PHP 5.5 or later and a MySQL-Database.
33

44
The following PHP extensions must be activated:
55

6-
exif, gd, json, mbstring, mysqli, zip
6+
session, exif, mbstring, gd, mysqli, json, zip
77

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

php/Modules/Album.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -99,30 +99,30 @@ public function get() {
9999

100100
case 'f':
101101
$return['public'] = '0';
102-
$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));
102+
$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));
103103
break;
104104

105105
case 's':
106106
$return['public'] = '0';
107-
$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));
107+
$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));
108108
break;
109109

110110
case 'r':
111111
$return['public'] = '0';
112-
$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));
112+
$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));
113113
break;
114114

115115
case '0':
116116
$return['public'] = '0';
117-
$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));
117+
$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));
118118
break;
119119

120120
default:
121121
$query = Database::prepare(Database::get(), "SELECT * FROM ? WHERE id = '?' LIMIT 1", array(LYCHEE_TABLE_ALBUMS, $this->albumIDs));
122122
$albums = Database::execute(Database::get(), $query, __METHOD__, __LINE__);
123123
$return = $albums->fetch_assoc();
124124
$return = Album::prepareData($return);
125-
$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));
125+
$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));
126126
break;
127127

128128
}

php/Modules/Photo.php

+19-11
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,7 @@ public function adjustFile($path, array $info) {
554554

555555
case 2:
556556
// mirror
557-
// not yet implemented
558-
return false;
557+
imageflip($sourceImg, IMG_FLIP_HORIZONTAL);
559558
break;
560559

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

565564
case 4:
566565
// rotate 180 and mirror
567-
// not yet implemented
568-
return false;
566+
imageflip($sourceImg, IMG_FLIP_VERTICAL);
569567
break;
570568

571569
case 5:
572570
// rotate 90 and mirror
573-
// not yet implemented
574-
return false;
571+
$sourceImg = imagerotate($sourceImg, -90, 0);
572+
$newWidth = $info['height'];
573+
$newHeight = $info['width'];
574+
$swapSize = true;
575+
imageflip($sourceImg, IMG_FLIP_HORIZONTAL);
575576
break;
576577

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

584585
case 7:
585586
// rotate -90 and mirror
586-
// not yet implemented
587-
return false;
587+
$sourceImg = imagerotate($sourceImg, 90, 0);
588+
$newWidth = $info['height'];
589+
$newHeight = $info['width'];
590+
$swapSize = true;
591+
imageflip($sourceImg, IMG_FLIP_HORIZONTAL);
588592
break;
589593

590594
case 8:
@@ -634,7 +638,7 @@ public function adjustFile($path, array $info) {
634638
public static function prepareData(array $data) {
635639

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

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

650-
// Parse urls
654+
// Parse medium
655+
if ($data['medium']==='1') $photo['medium'] = LYCHEE_URL_UPLOADS_MEDIUM . $data['url'];
656+
else $photo['medium'] = '';
657+
658+
// Parse paths
651659
$photo['thumbUrl'] = LYCHEE_URL_UPLOADS_THUMB . $data['thumbUrl'];
652660
$photo['url'] = LYCHEE_URL_UPLOADS_BIG . $data['url'];
653661

@@ -1304,4 +1312,4 @@ public function delete() {
13041312

13051313
}
13061314

1307-
?>
1315+
?>

plugins/Diagnostics/index.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@
5353
if (hasPermissions(LYCHEE_DATA)===false) $error .= ('Error: \'data/\' is missing or has insufficient read/write privileges' . PHP_EOL);
5454

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

6164
// Load config
6265
if (!file_exists(LYCHEE_CONFIG_FILE)) exit('Error: Configuration not found. Please install Lychee for additional tests');
@@ -96,6 +99,10 @@
9699
// Check mysql version
97100
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);
98101

102+
// Check imagick
103+
if (!extension_loaded('imagick')) echo('Warning: Pictures that are rotated lose their metadata! Please install Imagick to avoid that.' . PHP_EOL);
104+
else if (!$settings['imagick']) echo('Warning: Pictures that are rotated lose their metadata! Please enable Imagick in settings to avoid that.' . PHP_EOL);
105+
99106
// Output
100107
if ($error==='') echo('No critical problems found. Lychee should work without problems!' . PHP_EOL);
101108
else echo $error;

0 commit comments

Comments
 (0)