Merge e25eefd8a8a9d4c4113e69d7c501f8e5c2499b6d into cfc9d4995046cb40516ae53b1fc5c990862a04ec

This commit is contained in:
HarleyDavidson86 2016-02-07 08:21:40 +00:00
commit fb54a08839
2 changed files with 12 additions and 5 deletions

View File

@ -489,7 +489,7 @@ $(document).ready(function() {
{
type: "json",
action: HTML_PATH_ADMIN_ROOT+"ajax/uploader",
allow : "*.(jpg|jpeg|gif|png)",
allow : "*.(jpg|jpeg|gif|png|svg)",
params: {"type":"bludit-images-v8"},
loadstart: function() {

View File

@ -47,11 +47,18 @@ if($type=='profilePicture')
else {
// Generate the thumbnail
$Image = new Image();
$Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, THUMBNAILS_WIDTH, THUMBNAILS_HEIGHT, 'crop');
$Image->saveImage(PATH_UPLOADS_THUMBNAILS.$tmpName, 100, true);
//Handling all other formats than svg
if (strcasecmp($fileExtension, 'svg') != 0) {
$Image->setImage(PATH_TMP.'original'.'.'.$fileExtension, THUMBNAILS_WIDTH, THUMBNAILS_HEIGHT, 'crop');
$Image->saveImage(PATH_UPLOADS_THUMBNAILS.$tmpName, 100, true);
}
// Move the original to the upload folder.
rename(PATH_TMP.'original'.'.'.$fileExtension, PATH_UPLOADS.$tmpName);
//If it is a svg file, just save a copy in thumbnail-folder
if (strcasecmp($fileExtension, 'svg') == 0) {
symlink(PATH_UPLOADS.$tmpName, PATH_UPLOADS_THUMBNAILS.$tmpName);
}
}
// Remove the Bludit temporary file.
@ -64,4 +71,4 @@ exit(json_encode(array(
'filename'=>$tmpName
)));
?>
?>