cheditor5 에 webp 이미지 업로드 할 수 있도록 수정. 움직이는 gif, webp 의 이미지가 정지되어 업로드 되고 있음. 원래 그런것 같음.
This commit is contained in:
@ -9,10 +9,11 @@ if( !function_exists('che_reprocessImage') ){
|
||||
function che_reprocessImage($file_path, $callback){
|
||||
|
||||
$MIME_TYPES_PROCESSORS = array(
|
||||
"image/gif" => array("imagecreatefromgif", "imagegif"),
|
||||
"image/gif" => array("imagecreatefromgif", "imagegif"),
|
||||
"image/jpg" => array("imagecreatefromjpeg", "imagejpeg"),
|
||||
"image/jpeg" => array("imagecreatefromjpeg", "imagejpeg"),
|
||||
"image/png" => array("imagecreatefrompng", "imagepng"),
|
||||
"image/png" => array("imagecreatefrompng", "imagepng"),
|
||||
"image/webp" => array("imagecreatefromwebp", "imagewebp"),
|
||||
"image/bmp" => array("imagecreatefromwbmp", "imagewbmp")
|
||||
);
|
||||
|
||||
@ -84,6 +85,7 @@ switch ($type) {
|
||||
case "jpeg":
|
||||
case "gif":
|
||||
case "png":
|
||||
case "webp":
|
||||
$found = true;
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<div style="margin: 0px 0px 10px 0px;">
|
||||
<img src="../icons/imageUpload/remove_all.gif" class="remove-button" onclick="removeImages();"
|
||||
alt="" style="vertical-align: middle" />
|
||||
<input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif" id="inputImageUpload" multiple="multiple"
|
||||
<input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif,image/webp" id="inputImageUpload" multiple="multiple"
|
||||
onchange="selectedFiles(event)" style="vertical-align: middle; visibility: hidden; width: 0px"/>
|
||||
<img id="fileSelectButton" src="../icons/imageUpload/add.gif" alt="image button" onclick="inputImageUpload.click()"
|
||||
style="vertical-align: middle; margin-left: -5px; cursor: pointer"/>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<div style="margin: 0px 0px 10px 0px;">
|
||||
<img src="../icons/imageUpload/remove_all.gif" class="remove-button" onclick="removeImages();"
|
||||
alt="" style="vertical-align: middle" />
|
||||
<input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif" id="inputImageUpload" multiple="multiple"
|
||||
<input type="file" name="imageUpload[]" accept="image/jpeg,image/png,image/gif,image/webp" id="inputImageUpload" multiple="multiple"
|
||||
onchange="selectedFiles(event)" style="vertical-align: middle; visibility: hidden; width: 0px"/>
|
||||
<img id="fileSelectButton" src="../icons/imageUpload/add.gif" alt="image button" onclick="inputImageUpload.click()"
|
||||
style="vertical-align: middle; margin-left: -5px; cursor: pointer"/>
|
||||
|
||||
@ -14,7 +14,7 @@ var activeImage = null,
|
||||
dragDropDiv,
|
||||
eventDiff_x = 0,
|
||||
eventDiff_y = 0,
|
||||
fileTypeRe = /^image\/(png|jpeg|gif)$/i,
|
||||
fileTypeRe = /^image\/(png|jpeg|gif|webp)$/i,
|
||||
geckoOffsetX_marker = -3,
|
||||
geckoOffsetY_marker = -1,
|
||||
imageCompleted = 0,
|
||||
@ -434,7 +434,7 @@ function startUpload(list) {
|
||||
|
||||
function fileFilterError(file) {
|
||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
||||
"gif, png, jpg 사진 파일만 전송할 수 있습니다.");
|
||||
"gif, png, jpg, webp 사진 파일만 전송할 수 있습니다.");
|
||||
}
|
||||
|
||||
function imgComplete(img, imgSize, boxId) {
|
||||
|
||||
@ -14,7 +14,7 @@ var activeImage = null,
|
||||
dragDropDiv,
|
||||
eventDiff_x = 0,
|
||||
eventDiff_y = 0,
|
||||
fileTypeRe = /^image\/(png|jpeg|gif)$/i,
|
||||
fileTypeRe = /^image\/(png|jpeg|gif|webp)$/i,
|
||||
geckoOffsetX_marker = -3,
|
||||
geckoOffsetY_marker = -1,
|
||||
imageCompleted = 0,
|
||||
@ -434,7 +434,7 @@ function startUpload(list) {
|
||||
|
||||
function fileFilterError(file) {
|
||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
||||
"gif, png, jpg 사진 파일만 전송할 수 있습니다.");
|
||||
"gif, png, jpg, webp 사진 파일만 전송할 수 있습니다.");
|
||||
}
|
||||
|
||||
function imgComplete(img, imgSize, boxId) {
|
||||
|
||||
@ -335,7 +335,7 @@ function startUpload(count) {
|
||||
|
||||
function fileFilterError(file) {
|
||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
||||
"gif, png, jpg, 그림 파일만 전송할 수 있습니다.");
|
||||
"gif, png, jpg, webp 그림 파일만 전송할 수 있습니다.");
|
||||
}
|
||||
|
||||
function imgComplete(img, imgSize, boxId) {
|
||||
|
||||
@ -54,7 +54,7 @@ function chkImgFormat (url)
|
||||
{
|
||||
var imageName = getFilename(url);
|
||||
var allowSubmit = false;
|
||||
var extArray = [".gif", ".jpg", ".jpeg", ".png"];
|
||||
var extArray = [".gif", ".jpg", ".jpeg", ".png", ".webp"];
|
||||
|
||||
extArray.join(" ");
|
||||
if (imageName === "") {
|
||||
@ -72,7 +72,7 @@ function chkImgFormat (url)
|
||||
}
|
||||
|
||||
if (!allowSubmit) {
|
||||
alert("사진은 GIF, JPG, PNG 형식만 넣을 수 있습니다.");
|
||||
alert("사진은 GIF, JPG, PNG, WEBP 형식만 넣을 수 있습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user