Fixed some php notices

pull/57/head
Tobias Reich 10 years ago
parent 89a721a222
commit 540304eb26

File diff suppressed because one or more lines are too long

@ -55,7 +55,7 @@ upload = {
for (var i = 0; i < files.length; i++) {
if (files[i].type!=="image/jpeg"&&files[i].type!=="image/jpg"&&files[i].type!=="image/png"&&files[i].type!=="image/gif") {
if (files[i].type!=="image/jpeg"&&files[i].type!=="image/jpg"&&files[i].type!=="image/png"&&files[i].type!=="image/gif"&&files[i].type!=="image/webp") {
loadingBar.show("error", "The file format of " + files[i].name + " is not supported.");
return false;
} else {
@ -134,7 +134,7 @@ upload = {
if (link&&link.length>3) {
extension = link.split('.').pop();
if (extension!=="jpeg"&&extension!=="jpg"&&extension!=="png"&&extension!=="gif") {
if (extension!=="jpeg"&&extension!=="jpg"&&extension!=="png"&&extension!=="gif"&&extension!=="webp") {
loadingBar.show("error", "The file format of this link is not supported.");
return false;
}

@ -92,6 +92,7 @@ if (!empty($_POST['function'])||!empty($_GET['function'])) {
break;
case 'setAlbumPublic': if (isset($_POST['albumID']))
if (!isset($_POST['password'])) $_POST['password'] = '';
echo setAlbumPublic($_POST['albumID'], $_POST['password']);
break;

@ -122,8 +122,9 @@ function getAlbum($albumID) {
$query = "SELECT id, title, sysdate, public, star, album, thumbUrl FROM lychee_photos WHERE public = 1 " . $settings['sorting'];
break;
case 0: $return['public'] = false;
case "0": $return['public'] = false;
$query = "SELECT id, title, sysdate, public, star, album, thumbUrl FROM lychee_photos WHERE album = 0 " . $settings['sorting'];
break;
default: $result = $database->query("SELECT * FROM lychee_albums WHERE id = '$albumID';");
$row = $result->fetch_object();

@ -182,15 +182,19 @@ function getInfo($filename) {
$return['description'] = '';
// IPTC Metadata
$iptcInfo = iptcparse($iptcArray['APP13']);
if (is_array($iptcInfo)) {
$temp = $iptcInfo['2#105'][0];
if (isset($temp)&&strlen($temp)>0) $return['title'] = $temp;
$temp = $iptcInfo['2#120'][0];
if (isset($temp)&&strlen($temp)>0) $return['description'] = $temp;
if(isset($iptcArray['APP13'])) {
$iptcInfo = iptcparse($iptcArray['APP13']);
if (is_array($iptcInfo)) {
$temp = $iptcInfo['2#105'][0];
if (isset($temp)&&strlen($temp)>0) $return['title'] = $temp;
$temp = $iptcInfo['2#120'][0];
if (isset($temp)&&strlen($temp)>0) $return['description'] = $temp;
}
}
// EXIF Metadata Fallback
@ -270,12 +274,16 @@ function createThumb($filename, $width = 200, $height = 200) {
$startWidth = $info[0]/2 - $info[1]/2;
$startHeight = 0;
}
// Fallback for older version
if ($info['mime']==='image/webp'&&floatval(phpversion())<5.5) return false;
// Create new image
switch($info['mime']) {
case 'image/jpeg': $sourceImg = imagecreatefromjpeg($url); break;
case 'image/png': $sourceImg = imagecreatefrompng($url); break;
case 'image/gif': $sourceImg = imagecreatefromgif($url); break;
case 'image/webp': $sourceImg = imagecreatefromwebp($url); break;
default: return false;
}

Loading…
Cancel
Save