Commit c5f13cfd authored by Yanyutin753's avatar Yanyutin753
Browse files

Expend upload image file types

parent 22d23afb
...@@ -357,7 +357,7 @@ ...@@ -357,7 +357,7 @@
if (inputFiles && inputFiles.length > 0) { if (inputFiles && inputFiles.length > 0) {
inputFiles.forEach((file) => { inputFiles.forEach((file) => {
console.log(file, file.name.split('.').at(-1)); console.log(file, file.name.split('.').at(-1));
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) { if (['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(file['type'])) {
let reader = new FileReader(); let reader = new FileReader();
reader.onload = (event) => { reader.onload = (event) => {
files = [ files = [
...@@ -547,7 +547,7 @@ ...@@ -547,7 +547,7 @@
if (inputFiles && inputFiles.length > 0) { if (inputFiles && inputFiles.length > 0) {
const _inputFiles = Array.from(inputFiles); const _inputFiles = Array.from(inputFiles);
_inputFiles.forEach((file) => { _inputFiles.forEach((file) => {
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) { if (['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(file['type'])) {
let reader = new FileReader(); let reader = new FileReader();
reader.onload = (event) => { reader.onload = (event) => {
files = [ files = [
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
if ( if (
files.length > 0 && files.length > 0 &&
['image/gif', 'image/jpeg', 'image/png'].includes(files[0]['type']) ['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(files[0]['type'])
) { ) {
reader.readAsDataURL(files[0]); reader.readAsDataURL(files[0]);
} }
......
...@@ -339,7 +339,7 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, ''); ...@@ -339,7 +339,7 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
if ( if (
inputFiles && inputFiles &&
inputFiles.length > 0 && inputFiles.length > 0 &&
['image/gif', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type']) ['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type'])
) { ) {
reader.readAsDataURL(inputFiles[0]); reader.readAsDataURL(inputFiles[0]);
} else { } else {
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
if ( if (
inputFiles && inputFiles &&
inputFiles.length > 0 && inputFiles.length > 0 &&
['image/gif', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type']) ['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type'])
) { ) {
reader.readAsDataURL(inputFiles[0]); reader.readAsDataURL(inputFiles[0]);
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment