added jpeg support

added jpeg support
This commit is contained in:
Luciano Fiore 2019-05-01 18:16:58 +01:00
parent fcc1610d42
commit 93293dc15a
2 changed files with 4 additions and 2 deletions

View File

@ -24,7 +24,8 @@ if (!isset($_FILES['image']) && !isset($_POST['url']))
$allowed_ext = [
'png',
'jpg',
'gif'
'gif',
'jpeg'
];
// user must have submitted either an image or URL
@ -177,6 +178,7 @@ if (isset($_SESSION['user']))
switch ($ext)
{
case 'jpg':
case 'jpeg':
$thumb = imagecreatefromjpeg($image_path);
break;

View File

@ -28,7 +28,7 @@ SET time_zone = "+00:00";
CREATE TABLE IF NOT EXISTS `images` (
`id` char(5) NOT NULL,
`ext` char(3) NOT NULL,
`ext` char(4) NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`user` smallint(5) unsigned DEFAULT NULL,
`ip` varchar(39) NOT NULL,