1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-12 01:40:53 +01:00

Support JFIF files which are basically JPGs anyways (#983)

Note that this outputs JPG, but I think that should be fine. It's the better format anyways.
This commit is contained in:
Felipe Machado 2024-09-21 13:37:58 -03:00 committed by GitHub
parent 36762e9ed4
commit acf06532b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 12 additions and 8 deletions

View File

@ -21,10 +21,12 @@ const selectFile = async () => {
"png", "png",
"jpg", "jpg",
"jpeg", "jpeg",
"jfif",
"webp", "webp",
"PNG", "PNG",
"JPG", "JPG",
"JPEG", "JPEG",
"JFIF",
"WEBP", "WEBP",
], ],
}, },
@ -50,10 +52,12 @@ const selectFile = async () => {
file.endsWith(".png") || file.endsWith(".png") ||
file.endsWith(".jpg") || file.endsWith(".jpg") ||
file.endsWith(".jpeg") || file.endsWith(".jpeg") ||
file.endsWith(".jfif") ||
file.endsWith(".webp") || file.endsWith(".webp") ||
file.endsWith(".JPG") || file.endsWith(".JPG") ||
file.endsWith(".PNG") || file.endsWith(".PNG") ||
file.endsWith(".JPEG") || file.endsWith(".JPEG") ||
file.endsWith(".JFIF") ||
file.endsWith(".WEBP") file.endsWith(".WEBP")
) { ) {
isValid = true; isValid = true;

View File

@ -194,7 +194,7 @@
}, },
"INVALID_IMAGE_ERROR": { "INVALID_IMAGE_ERROR": {
"TITLE": "Invalid Image", "TITLE": "Invalid Image",
"DESCRIPTION": "Please select an image with a valid extension like PNG, JPG, JPEG, or WEBP.", "DESCRIPTION": "Please select an image with a valid extension like PNG, JPG, JPEG, JFIF or WEBP.",
"ADDITIONAL_DESCRIPTION": "Please drag and drop an image" "ADDITIONAL_DESCRIPTION": "Please drag and drop an image"
}, },
"NO_IMAGE_ERROR": { "NO_IMAGE_ERROR": {

View File

@ -194,7 +194,7 @@
}, },
"INVALID_IMAGE_ERROR": { "INVALID_IMAGE_ERROR": {
"TITLE": "Imagen inválida", "TITLE": "Imagen inválida",
"DESCRIPTION": "Por favor, selecciona una imagen con una extensión válida como PNG, JPG, JPEG o WEBP.", "DESCRIPTION": "Por favor, selecciona una imagen con una extensión válida como PNG, JPG, JPEG, JFIF o WEBP.",
"ADDITIONAL_DESCRIPTION": "Por favor, arrastra y suelta una imagen" "ADDITIONAL_DESCRIPTION": "Por favor, arrastra y suelta una imagen"
}, },
"NO_IMAGE_ERROR": { "NO_IMAGE_ERROR": {

View File

@ -194,7 +194,7 @@
}, },
"INVALID_IMAGE_ERROR": { "INVALID_IMAGE_ERROR": {
"TITLE": "Image invalide", "TITLE": "Image invalide",
"DESCRIPTION": "Veuillez sélectionner une image avec une extension valide comme PNG, JPG, JPEG ou WEBP.", "DESCRIPTION": "Veuillez sélectionner une image avec une extension valide comme PNG, JPG, JPEG, JFIF ou WEBP.",
"ADDITIONAL_DESCRIPTION": "Veuillez glisser-déposer une image" "ADDITIONAL_DESCRIPTION": "Veuillez glisser-déposer une image"
}, },
"NO_IMAGE_ERROR": { "NO_IMAGE_ERROR": {

View File

@ -194,7 +194,7 @@
}, },
"INVALID_IMAGE_ERROR": { "INVALID_IMAGE_ERROR": {
"TITLE": "無効な画像", "TITLE": "無効な画像",
"DESCRIPTION": "PNG、JPG、JPEG、またはWEBPなどの有効な拡張子を持つ画像を選択してください。", "DESCRIPTION": "PNG、JPG、JPEG、JFIF、またはWEBPなどの有効な拡張子を持つ画像を選択してください。",
"ADDITIONAL_DESCRIPTION": "画像をドラッグアンドドロップしてください" "ADDITIONAL_DESCRIPTION": "画像をドラッグアンドドロップしてください"
}, },
"NO_IMAGE_ERROR": { "NO_IMAGE_ERROR": {

View File

@ -192,7 +192,7 @@
}, },
"INVALID_IMAGE_ERROR": { "INVALID_IMAGE_ERROR": {
"TITLE": "Invalid Image", "TITLE": "Invalid Image",
"DESCRIPTION": "Please select an image with a valid extension like PNG, JPG, JPEG, or WEBP.", "DESCRIPTION": "Please select an image with a valid extension like PNG, JPG, JPEG, JFIF or WEBP.",
"ADDITIONAL_DESCRIPTION": "Please drag and drop an image" "ADDITIONAL_DESCRIPTION": "Please drag and drop an image"
}, },
"NO_IMAGE_ERROR": { "NO_IMAGE_ERROR": {

View File

@ -194,7 +194,7 @@
}, },
"INVALID_IMAGE_ERROR": { "INVALID_IMAGE_ERROR": {
"TITLE": "Неверное изображение", "TITLE": "Неверное изображение",
"DESCRIPTION": "Пожалуйста, выберите изображение с правильным расширением, таким как PNG, JPG, JPEG или WEBP.", "DESCRIPTION": "Пожалуйста, выберите изображение с правильным расширением, таким как PNG, JPG, JPEG, JFIF или WEBP.",
"ADDITIONAL_DESCRIPTION": "Пожалуйста, перетащите изображение" "ADDITIONAL_DESCRIPTION": "Пожалуйста, перетащите изображение"
}, },
"NO_IMAGE_ERROR": { "NO_IMAGE_ERROR": {

View File

@ -194,7 +194,7 @@
}, },
"INVALID_IMAGE_ERROR": { "INVALID_IMAGE_ERROR": {
"TITLE": "图片无效", "TITLE": "图片无效",
"DESCRIPTION": "请选择一个扩展名为 PNG、JPG、JPEG 或 WEBP 的有效图片", "DESCRIPTION": "请选择一个扩展名为 PNG、JPG、JPEG、JFIF 或 WEBP 的有效图片",
"ADDITIONAL_DESCRIPTION": "请拖放图片" "ADDITIONAL_DESCRIPTION": "请拖放图片"
}, },
"NO_IMAGE_ERROR": { "NO_IMAGE_ERROR": {

View File

@ -51,7 +51,7 @@ import getDirectoryFromPath from "@common/get-directory-from-path";
import { translationAtom } from "@/atoms/translations-atom"; import { translationAtom } from "@/atoms/translations-atom";
const Home = () => { const Home = () => {
const allowedFileTypes = ["png", "jpg", "jpeg", "webp"]; const allowedFileTypes = ["png", "jpg", "jpeg", "jfif", "webp"];
const t = useAtomValue(translationAtom); const t = useAtomValue(translationAtom);