From d46ff57745c3a05c24a54301969d7bb6e0a40b8c Mon Sep 17 00:00:00 2001 From: cre8ive-marketing <168519979+cre8ive-marketing@users.noreply.github.com> Date: Wed, 2 Dec 2026 09:36:58 +0530 Subject: [PATCH 1/2] feat(image): choose the resampling filter for resizes Image presets get ImageOptions.ResizeFilter (Auto, Lanczos, Mitchell, Catmull-Rom, bilinear, box, nearest neighbour), shown under Resize in the preset editor. ApplyOptions sets it on the image before any resize, so the format caps, icons, cursors and the file-size fit use it too. Auto leaves FilterType unset, as before. The gallery allow-list and SharedPresetVersions know the field (2.6.0). Closes #1601 --- CHANGELOG.md | 7 ++++++ src/Filee.App/Assets/i18n/ar.json | 9 ++++++++ src/Filee.App/Assets/i18n/bn-BD.json | 9 ++++++++ src/Filee.App/Assets/i18n/de.json | 9 ++++++++ src/Filee.App/Assets/i18n/en.json | 9 ++++++++ src/Filee.App/Assets/i18n/es.json | 9 ++++++++ src/Filee.App/Assets/i18n/fa.json | 9 ++++++++ src/Filee.App/Assets/i18n/fr.json | 9 ++++++++ src/Filee.App/Assets/i18n/hi.json | 9 ++++++++ src/Filee.App/Assets/i18n/id.json | 9 ++++++++ src/Filee.App/Assets/i18n/it.json | 9 ++++++++ src/Filee.App/Assets/i18n/ja.json | 9 ++++++++ src/Filee.App/Assets/i18n/ko.json | 9 ++++++++ src/Filee.App/Assets/i18n/mn.json | 9 ++++++++ src/Filee.App/Assets/i18n/ne.json | 9 ++++++++ src/Filee.App/Assets/i18n/pl.json | 9 ++++++++ src/Filee.App/Assets/i18n/pt-BR.json | 9 ++++++++ src/Filee.App/Assets/i18n/pt-PT.json | 9 ++++++++ src/Filee.App/Assets/i18n/ru.json | 9 ++++++++ src/Filee.App/Assets/i18n/th.json | 9 ++++++++ src/Filee.App/Assets/i18n/tr.json | 9 ++++++++ src/Filee.App/Assets/i18n/vi.json | 9 ++++++++ src/Filee.App/Assets/i18n/zh-CN.json | 9 ++++++++ src/Filee.App/Assets/i18n/zh-TW.json | 9 ++++++++ .../ViewModels/PresetEditorViewModel.cs | 10 ++++++++- src/Filee.App/Views/PresetEditorView.axaml | 6 +++++ src/Filee.Core/Gallery/SharedPresetRules.cs | 1 + .../Gallery/SharedPresetVersions.cs | 1 + src/Filee.Core/Presets/Preset.cs | 21 ++++++++++++++++++ src/Filee.Engines/Magick/ImageEncoder.cs | 17 ++++++++++++++ tests/Filee.Engines.Tests/ImageFormatTests.cs | 22 +++++++++++++++++++ 31 files changed, 291 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64f25f35f..aba6bcb6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -114,8 +114,15 @@ ko: 3D Studio 모델(.3ds)을 OBJ, GLB, STL 같은 3D 형식이나 PNG 미리보 en: 3D Studio models (.3ds) convert to OBJ, GLB, STL and the other 3D formats, and to a PNG preview ko: PDF·Word·웹 페이지의 표를 Excel로 바꿀 때 머리글 병합은 남기고 여러 행에 걸친 분류는 행마다 채우도록 고를 수 있어서 필터와 피벗 테이블에 쓰기 좋아요 (새 프리셋의 기본값) en: Tables from PDF, Word and web pages can keep their header merges in Excel and fill categories into every row, ready for filters and pivot tables (new presets do this by default) +ko: 이미지 프리셋에서 크기 조정 방식(Lanczos, Mitchell, Catmull-Rom, 바이리니어, 박스, 최근접 이웃)을 고를 수 있어요 +en: Image presets can choose how a resize blends pixels: Lanczos, Mitchell, Catmull-Rom, bilinear, box or nearest neighbour --> +- **Choose the resampling filter** (#1601). An image preset that resizes now has a **Resampling** box under + **Resize**: Automatic (as before: ImageMagick picks Lanczos for shrinking and Mitchell for enlarging), Lanczos, + Mitchell, Catmull-Rom (the sharp bicubic), Bilinear, Box, or Nearest neighbour for pixel art. The same filter is + used when a picture is scaled to fit a format's size limit or a maximum file size, and for icons and cursors. + - **No update notice over full-screen games** (#1897). The "new version" card in the bottom-right corner could appear on top of a full-screen game, where it looked like something that didn't belong there. While a full-screen game or video, or a presentation, is in front, the card (and the one for newer engines) now waits until you next use Filee: diff --git a/src/Filee.App/Assets/i18n/ar.json b/src/Filee.App/Assets/i18n/ar.json index 88cfe3cf8..1d00d1392 100644 --- a/src/Filee.App/Assets/i18n/ar.json +++ b/src/Filee.App/Assets/i18n/ar.json @@ -960,6 +960,15 @@ "presets.resize.Width": "تعيين العرض", "presets.resize.Custom": "تعيين العرض والارتفاع", "presets.resize.MinShortEdge": "تحديد الحد الأدنى للضلع الأقصر", + "presets.resize_filter": "إعادة التشكيل", + "presets.resize_filter_hint": "طريقة مزج البكسلات عند تغيير حجم الصورة. التلقائي يستخدم Lanczos للتصغير وMitchell للتكبير.", + "presets.resize_filter.Auto": "تلقائي", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (تكعيبي ثنائي)", + "presets.resize_filter.Bilinear": "خطي ثنائي", + "presets.resize_filter.Box": "صندوقي", + "presets.resize_filter.Nearest": "الجار الأقرب (فن البكسل)", "presets.rotation": "التدوير", "presets.rotation.None": "دون تدوير", "presets.rotation.Right90": "90° لليمين", diff --git a/src/Filee.App/Assets/i18n/bn-BD.json b/src/Filee.App/Assets/i18n/bn-BD.json index f97d2a2dc..f0ac08a47 100644 --- a/src/Filee.App/Assets/i18n/bn-BD.json +++ b/src/Filee.App/Assets/i18n/bn-BD.json @@ -959,6 +959,15 @@ "presets.resize.Width": "প্রস্থ নির্ধারণ", "presets.resize.Custom": "প্রস্থ এবং উচ্চতা নির্ধারণ", "presets.resize.MinShortEdge": "সর্বনিম্ন ছোট প্রান্ত নির্ধারণ", + "presets.resize_filter": "রিস্যাম্পলিং", + "presets.resize_filter_hint": "আকার বদলানোর সময় পিক্সেল কীভাবে মেশানো হবে। স্বয়ংক্রিয় ছোট করতে Lanczos আর বড় করতে Mitchell নেয়।", + "presets.resize_filter.Auto": "স্বয়ংক্রিয়", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (বাইকিউবিক)", + "presets.resize_filter.Bilinear": "বাইলিনিয়ার", + "presets.resize_filter.Box": "বক্স", + "presets.resize_filter.Nearest": "নিকটতম প্রতিবেশী (পিক্সেল আর্ট)", "presets.rotation": "ঘোরান", "presets.rotation.None": "ঘোরাবেন না", "presets.rotation.Right90": "ডানে ৯০°", diff --git a/src/Filee.App/Assets/i18n/de.json b/src/Filee.App/Assets/i18n/de.json index a4e5cee60..07a2e0b8a 100644 --- a/src/Filee.App/Assets/i18n/de.json +++ b/src/Filee.App/Assets/i18n/de.json @@ -960,6 +960,15 @@ "presets.resize.Width": "Breite festlegen", "presets.resize.Custom": "Breite und Höhe festlegen", "presets.resize.MinShortEdge": "Mindestlänge der kurzen Kante", + "presets.resize_filter": "Neuberechnung", + "presets.resize_filter_hint": "Wie Pixel beim Ändern der Größe gemischt werden. Automatisch nimmt Lanczos zum Verkleinern und Mitchell zum Vergrößern.", + "presets.resize_filter.Auto": "Automatisch", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (bikubisch)", + "presets.resize_filter.Bilinear": "Bilinear", + "presets.resize_filter.Box": "Box", + "presets.resize_filter.Nearest": "Nächster Nachbar (Pixel-Art)", "presets.rotation": "Drehen", "presets.rotation.None": "Nicht drehen", "presets.rotation.Right90": "90° nach rechts", diff --git a/src/Filee.App/Assets/i18n/en.json b/src/Filee.App/Assets/i18n/en.json index 279ed153e..715506639 100644 --- a/src/Filee.App/Assets/i18n/en.json +++ b/src/Filee.App/Assets/i18n/en.json @@ -975,6 +975,15 @@ "presets.resize.Width": "Set the width", "presets.resize.Custom": "Set width and height", "presets.resize.MinShortEdge": "Set a minimum short edge", + "presets.resize_filter": "Resampling", + "presets.resize_filter_hint": "How pixels are blended when the picture is resized. Automatic picks Lanczos for shrinking and Mitchell for enlarging.", + "presets.resize_filter.Auto": "Automatic", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (bicubic)", + "presets.resize_filter.Bilinear": "Bilinear", + "presets.resize_filter.Box": "Box", + "presets.resize_filter.Nearest": "Nearest neighbour (pixel art)", "presets.rotation": "Rotate", "presets.rotation.None": "Don't rotate", "presets.rotation.Right90": "Right 90°", diff --git a/src/Filee.App/Assets/i18n/es.json b/src/Filee.App/Assets/i18n/es.json index 71f414a5b..357b093ba 100644 --- a/src/Filee.App/Assets/i18n/es.json +++ b/src/Filee.App/Assets/i18n/es.json @@ -960,6 +960,15 @@ "presets.resize.Width": "Fijar el ancho", "presets.resize.Custom": "Fijar el ancho y el alto", "presets.resize.MinShortEdge": "Fijar un lado corto mínimo", + "presets.resize_filter": "Remuestreo", + "presets.resize_filter_hint": "Cómo se mezclan los píxeles al cambiar el tamaño. Automático usa Lanczos para reducir y Mitchell para ampliar.", + "presets.resize_filter.Auto": "Automático", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (bicúbico)", + "presets.resize_filter.Bilinear": "Bilineal", + "presets.resize_filter.Box": "Caja", + "presets.resize_filter.Nearest": "Vecino más cercano (pixel art)", "presets.rotation": "Rotar", "presets.rotation.None": "No rotar", "presets.rotation.Right90": "90° a la derecha", diff --git a/src/Filee.App/Assets/i18n/fa.json b/src/Filee.App/Assets/i18n/fa.json index 111c488f9..6ad082589 100644 --- a/src/Filee.App/Assets/i18n/fa.json +++ b/src/Filee.App/Assets/i18n/fa.json @@ -959,6 +959,15 @@ "presets.resize.Width": "تنظیم عرض", "presets.resize.Custom": "تنظیم عرض و ارتفاع", "presets.resize.MinShortEdge": "حداقل لبه کوتاه", + "presets.resize_filter": "بازنمونه‌برداری", + "presets.resize_filter_hint": "روش ترکیب پیکسل‌ها هنگام تغییر اندازه. خودکار برای کوچک کردن Lanczos و برای بزرگ کردن Mitchell را به کار می‌برد.", + "presets.resize_filter.Auto": "خودکار", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (دومکعبی)", + "presets.resize_filter.Bilinear": "دوخطی", + "presets.resize_filter.Box": "جعبه‌ای", + "presets.resize_filter.Nearest": "نزدیک‌ترین همسایه (پیکسل‌آرت)", "presets.rotation": "چرخش", "presets.rotation.None": "بدون چرخش", "presets.rotation.Right90": "۹۰ درجه راست", diff --git a/src/Filee.App/Assets/i18n/fr.json b/src/Filee.App/Assets/i18n/fr.json index ec89223db..2b542f1b1 100644 --- a/src/Filee.App/Assets/i18n/fr.json +++ b/src/Filee.App/Assets/i18n/fr.json @@ -979,6 +979,15 @@ "presets.resize.Width": "Fixer la largeur", "presets.resize.Custom": "Fixer la largeur et la hauteur", "presets.resize.MinShortEdge": "Imposer un petit côté minimal", + "presets.resize_filter": "Rééchantillonnage", + "presets.resize_filter_hint": "La façon de mélanger les pixels quand l'image est redimensionnée. Automatique prend Lanczos pour réduire et Mitchell pour agrandir.", + "presets.resize_filter.Auto": "Automatique", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (bicubique)", + "presets.resize_filter.Bilinear": "Bilinéaire", + "presets.resize_filter.Box": "Boîte", + "presets.resize_filter.Nearest": "Plus proche voisin (pixel art)", "presets.rotation": "Faire pivoter", "presets.rotation.None": "Ne pas faire pivoter", "presets.rotation.Right90": "90° à droite", diff --git a/src/Filee.App/Assets/i18n/hi.json b/src/Filee.App/Assets/i18n/hi.json index e14415dcb..e8fb7a7da 100644 --- a/src/Filee.App/Assets/i18n/hi.json +++ b/src/Filee.App/Assets/i18n/hi.json @@ -964,6 +964,15 @@ "presets.resize.Width": "चौड़ाई तय करें", "presets.resize.Custom": "चौड़ाई और ऊँचाई तय करें", "presets.resize.MinShortEdge": "छोटी भुजा की न्यूनतम लंबाई तय करें", + "presets.resize_filter": "रीसैंपलिंग", + "presets.resize_filter_hint": "आकार बदलते समय पिक्सेल कैसे मिलाए जाएँ। स्वचालित छोटा करने पर Lanczos और बड़ा करने पर Mitchell चुनता है।", + "presets.resize_filter.Auto": "स्वचालित", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (बाइक्यूबिक)", + "presets.resize_filter.Bilinear": "बाइलीनियर", + "presets.resize_filter.Box": "बॉक्स", + "presets.resize_filter.Nearest": "निकटतम पड़ोसी (पिक्सेल आर्ट)", "presets.rotation": "घुमाएँ", "presets.rotation.None": "न घुमाएँ", "presets.rotation.Right90": "दाएँ 90°", diff --git a/src/Filee.App/Assets/i18n/id.json b/src/Filee.App/Assets/i18n/id.json index 902ae1796..5e618439f 100644 --- a/src/Filee.App/Assets/i18n/id.json +++ b/src/Filee.App/Assets/i18n/id.json @@ -964,6 +964,15 @@ "presets.resize.Width": "Tentukan lebar", "presets.resize.Custom": "Tentukan lebar dan tinggi", "presets.resize.MinShortEdge": "Atur batas minimum sisi pendek", + "presets.resize_filter": "Resampling", + "presets.resize_filter_hint": "Cara piksel dicampur saat gambar diubah ukurannya. Otomatis memakai Lanczos untuk mengecilkan dan Mitchell untuk memperbesar.", + "presets.resize_filter.Auto": "Otomatis", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (bikubik)", + "presets.resize_filter.Bilinear": "Bilinear", + "presets.resize_filter.Box": "Box", + "presets.resize_filter.Nearest": "Tetangga terdekat (pixel art)", "presets.rotation": "Rotasi", "presets.rotation.None": "Jangan putar", "presets.rotation.Right90": "Kanan 90°", diff --git a/src/Filee.App/Assets/i18n/it.json b/src/Filee.App/Assets/i18n/it.json index fd98025bc..37a059f28 100644 --- a/src/Filee.App/Assets/i18n/it.json +++ b/src/Filee.App/Assets/i18n/it.json @@ -963,6 +963,15 @@ "presets.resize.Width": "Imposta la larghezza", "presets.resize.Custom": "Imposta larghezza e altezza", "presets.resize.MinShortEdge": "Limita il lato corto minimo", + "presets.resize_filter": "Ricampionamento", + "presets.resize_filter_hint": "Come si mescolano i pixel quando l'immagine viene ridimensionata. Automatico usa Lanczos per ridurre e Mitchell per ingrandire.", + "presets.resize_filter.Auto": "Automatico", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (bicubico)", + "presets.resize_filter.Bilinear": "Bilineare", + "presets.resize_filter.Box": "Box", + "presets.resize_filter.Nearest": "Vicino più prossimo (pixel art)", "presets.rotation": "Ruota", "presets.rotation.None": "Non ruotare", "presets.rotation.Right90": "90° a destra", diff --git a/src/Filee.App/Assets/i18n/ja.json b/src/Filee.App/Assets/i18n/ja.json index 7434a8d32..af8ec02c9 100644 --- a/src/Filee.App/Assets/i18n/ja.json +++ b/src/Filee.App/Assets/i18n/ja.json @@ -964,6 +964,15 @@ "presets.resize.Width": "幅を指定", "presets.resize.Custom": "幅と高さを指定", "presets.resize.MinShortEdge": "短辺の下限を指定", + "presets.resize_filter": "リサンプリング", + "presets.resize_filter_hint": "サイズ変更時のピクセルの補間方法です。自動では縮小に Lanczos、拡大に Mitchell を使います。", + "presets.resize_filter.Auto": "自動", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (バイキュービック)", + "presets.resize_filter.Bilinear": "バイリニア", + "presets.resize_filter.Box": "ボックス", + "presets.resize_filter.Nearest": "ニアレストネイバー (ピクセルアート)", "presets.rotation": "回転", "presets.rotation.None": "回転しない", "presets.rotation.Right90": "右に90°", diff --git a/src/Filee.App/Assets/i18n/ko.json b/src/Filee.App/Assets/i18n/ko.json index 22139a8f5..3c52ea53b 100644 --- a/src/Filee.App/Assets/i18n/ko.json +++ b/src/Filee.App/Assets/i18n/ko.json @@ -975,6 +975,15 @@ "presets.resize.Width": "너비 맞추기", "presets.resize.Custom": "너비와 높이 맞추기", "presets.resize.MinShortEdge": "짧은 변 최소 길이", + "presets.resize_filter": "리샘플링", + "presets.resize_filter_hint": "크기를 바꿀 때 픽셀을 섞는 방식입니다. 자동은 줄일 때 Lanczos, 키울 때 Mitchell을 씁니다.", + "presets.resize_filter.Auto": "자동", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (바이큐빅)", + "presets.resize_filter.Bilinear": "바이리니어", + "presets.resize_filter.Box": "박스", + "presets.resize_filter.Nearest": "최근접 이웃 (픽셀 아트)", "presets.rotation": "회전", "presets.rotation.None": "회전 안 함", "presets.rotation.Right90": "오른쪽 90°", diff --git a/src/Filee.App/Assets/i18n/mn.json b/src/Filee.App/Assets/i18n/mn.json index d42acfbe4..a3e636511 100644 --- a/src/Filee.App/Assets/i18n/mn.json +++ b/src/Filee.App/Assets/i18n/mn.json @@ -959,6 +959,15 @@ "presets.resize.Width": "Өргөнийг заах", "presets.resize.Custom": "Өргөн ба өндрийг заах", "presets.resize.MinShortEdge": "Богино талын доод хэмжээг заах", + "presets.resize_filter": "Дахин түүвэрлэлт", + "presets.resize_filter_hint": "Хэмжээг өөрчлөхөд пикселийг хэрхэн холих. Автомат нь багасгахад Lanczos, томсгоход Mitchell сонгоно.", + "presets.resize_filter.Auto": "Автомат", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (бикуб)", + "presets.resize_filter.Bilinear": "Билинеар", + "presets.resize_filter.Box": "Хайрцаг", + "presets.resize_filter.Nearest": "Хамгийн ойр хөрш (пиксел арт)", "presets.rotation": "Эргүүлэх", "presets.rotation.None": "Эргүүлэхгүй", "presets.rotation.Right90": "Баруун тийш 90°", diff --git a/src/Filee.App/Assets/i18n/ne.json b/src/Filee.App/Assets/i18n/ne.json index 0bad7bd8e..e90032daa 100644 --- a/src/Filee.App/Assets/i18n/ne.json +++ b/src/Filee.App/Assets/i18n/ne.json @@ -960,6 +960,15 @@ "presets.resize.Width": "चौडाइ निर्धारण गर्नुहोस्", "presets.resize.Custom": "चौडाइ र उचाइ निर्धारण गर्नुहोस्", "presets.resize.MinShortEdge": "छोटो छेउको न्यूनतम लम्बाइ तोक्नुहोस्", + "presets.resize_filter": "रिस्याम्पलिङ", + "presets.resize_filter_hint": "आकार बदल्दा पिक्सेल कसरी मिसाइन्छ। स्वचालितले सानो पार्दा Lanczos र ठूलो पार्दा Mitchell रोज्छ।", + "presets.resize_filter.Auto": "स्वचालित", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (बाइक्युबिक)", + "presets.resize_filter.Bilinear": "बाइलिनियर", + "presets.resize_filter.Box": "बक्स", + "presets.resize_filter.Nearest": "नजिकको छिमेकी (पिक्सेल आर्ट)", "presets.rotation": "घुमाउनुहोस्", "presets.rotation.None": "नघुमाउनुहोस्", "presets.rotation.Right90": "दायाँ ९०°", diff --git a/src/Filee.App/Assets/i18n/pl.json b/src/Filee.App/Assets/i18n/pl.json index 6e513b24a..967eadf49 100644 --- a/src/Filee.App/Assets/i18n/pl.json +++ b/src/Filee.App/Assets/i18n/pl.json @@ -979,6 +979,15 @@ "presets.resize.Width": "Ustaw szerokość", "presets.resize.Custom": "Ustaw szerokość i wysokość", "presets.resize.MinShortEdge": "Ustaw minimalny krótszy bok", + "presets.resize_filter": "Przepróbkowanie", + "presets.resize_filter_hint": "Jak mieszane są piksele przy zmianie rozmiaru. Automatycznie: Lanczos przy zmniejszaniu, Mitchell przy powiększaniu.", + "presets.resize_filter.Auto": "Automatycznie", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (dwusześcienny)", + "presets.resize_filter.Bilinear": "Dwuliniowy", + "presets.resize_filter.Box": "Box", + "presets.resize_filter.Nearest": "Najbliższy sąsiad (pixel art)", "presets.rotation": "Obróć", "presets.rotation.None": "Nie obracaj", "presets.rotation.Right90": "W prawo 90°", diff --git a/src/Filee.App/Assets/i18n/pt-BR.json b/src/Filee.App/Assets/i18n/pt-BR.json index 20df3b086..f1532ba8b 100644 --- a/src/Filee.App/Assets/i18n/pt-BR.json +++ b/src/Filee.App/Assets/i18n/pt-BR.json @@ -979,6 +979,15 @@ "presets.resize.Width": "Definir a largura", "presets.resize.Custom": "Definir a largura e a altura", "presets.resize.MinShortEdge": "Definir um lado menor mínimo", + "presets.resize_filter": "Reamostragem", + "presets.resize_filter_hint": "Como os pixels são misturados ao redimensionar. Automático usa Lanczos para reduzir e Mitchell para ampliar.", + "presets.resize_filter.Auto": "Automático", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (bicúbico)", + "presets.resize_filter.Bilinear": "Bilinear", + "presets.resize_filter.Box": "Caixa", + "presets.resize_filter.Nearest": "Vizinho mais próximo (pixel art)", "presets.rotation": "Girar", "presets.rotation.None": "Não girar", "presets.rotation.Right90": "90° à direita", diff --git a/src/Filee.App/Assets/i18n/pt-PT.json b/src/Filee.App/Assets/i18n/pt-PT.json index 025793024..c12f3ee92 100644 --- a/src/Filee.App/Assets/i18n/pt-PT.json +++ b/src/Filee.App/Assets/i18n/pt-PT.json @@ -979,6 +979,15 @@ "presets.resize.Width": "Definir a largura", "presets.resize.Custom": "Definir a largura e a altura", "presets.resize.MinShortEdge": "Definir um lado menor mínimo", + "presets.resize_filter": "Reamostragem", + "presets.resize_filter_hint": "Como os píxeis são misturados ao redimensionar. Automático usa Lanczos para reduzir e Mitchell para ampliar.", + "presets.resize_filter.Auto": "Automático", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (bicúbico)", + "presets.resize_filter.Bilinear": "Bilinear", + "presets.resize_filter.Box": "Caixa", + "presets.resize_filter.Nearest": "Vizinho mais próximo (pixel art)", "presets.rotation": "Rodar", "presets.rotation.None": "Não rodar", "presets.rotation.Right90": "90° à direita", diff --git a/src/Filee.App/Assets/i18n/ru.json b/src/Filee.App/Assets/i18n/ru.json index 6269eafec..00309d720 100644 --- a/src/Filee.App/Assets/i18n/ru.json +++ b/src/Filee.App/Assets/i18n/ru.json @@ -979,6 +979,15 @@ "presets.resize.Width": "Задать ширину", "presets.resize.Custom": "Задать ширину и высоту", "presets.resize.MinShortEdge": "Задать минимум короткой стороны", + "presets.resize_filter": "Ресемплинг", + "presets.resize_filter_hint": "Как смешиваются пиксели при изменении размера. Автоматически: Lanczos для уменьшения, Mitchell для увеличения.", + "presets.resize_filter.Auto": "Автоматически", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (бикубический)", + "presets.resize_filter.Bilinear": "Билинейный", + "presets.resize_filter.Box": "Box", + "presets.resize_filter.Nearest": "Ближайший сосед (пиксель-арт)", "presets.rotation": "Повернуть", "presets.rotation.None": "Не поворачивать", "presets.rotation.Right90": "Вправо на 90°", diff --git a/src/Filee.App/Assets/i18n/th.json b/src/Filee.App/Assets/i18n/th.json index ff9c8f949..d2de6aacb 100644 --- a/src/Filee.App/Assets/i18n/th.json +++ b/src/Filee.App/Assets/i18n/th.json @@ -960,6 +960,15 @@ "presets.resize.Width": "กำหนดความกว้าง", "presets.resize.Custom": "กำหนดความกว้างและความสูง", "presets.resize.MinShortEdge": "กำหนดความยาวขั้นต่ำของด้านที่สั้นที่สุด", + "presets.resize_filter": "การสุ่มตัวอย่างใหม่", + "presets.resize_filter_hint": "วิธีผสมพิกเซลเมื่อปรับขนาดภาพ อัตโนมัติใช้ Lanczos เมื่อย่อ และ Mitchell เมื่อขยาย", + "presets.resize_filter.Auto": "อัตโนมัติ", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (ไบคิวบิก)", + "presets.resize_filter.Bilinear": "ไบลิเนียร์", + "presets.resize_filter.Box": "Box", + "presets.resize_filter.Nearest": "เพื่อนบ้านใกล้สุด (พิกเซลอาร์ต)", "presets.rotation": "หมุนภาพ", "presets.rotation.None": "ไม่หมุน", "presets.rotation.Right90": "ขวา 90°", diff --git a/src/Filee.App/Assets/i18n/tr.json b/src/Filee.App/Assets/i18n/tr.json index 66d164ecd..daf655791 100644 --- a/src/Filee.App/Assets/i18n/tr.json +++ b/src/Filee.App/Assets/i18n/tr.json @@ -960,6 +960,15 @@ "presets.resize.Width": "Genişliği ayarla", "presets.resize.Custom": "Genişliği ve yüksekliği ayarla", "presets.resize.MinShortEdge": "Kısa kenar için alt sınır", + "presets.resize_filter": "Yeniden örnekleme", + "presets.resize_filter_hint": "Boyut değişirken piksellerin nasıl karıştırılacağı. Otomatik, küçültmede Lanczos, büyütmede Mitchell kullanır.", + "presets.resize_filter.Auto": "Otomatik", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (bikübik)", + "presets.resize_filter.Bilinear": "Bilineer", + "presets.resize_filter.Box": "Kutu", + "presets.resize_filter.Nearest": "En yakın komşu (piksel sanatı)", "presets.rotation": "Döndür", "presets.rotation.None": "Döndürme", "presets.rotation.Right90": "Sağa 90°", diff --git a/src/Filee.App/Assets/i18n/vi.json b/src/Filee.App/Assets/i18n/vi.json index dccb31e17..380aa7e2e 100644 --- a/src/Filee.App/Assets/i18n/vi.json +++ b/src/Filee.App/Assets/i18n/vi.json @@ -975,6 +975,15 @@ "presets.resize.Width": "Đặt chiều rộng", "presets.resize.Custom": "Đặt chiều rộng và chiều cao", "presets.resize.MinShortEdge": "Đặt cạnh ngắn tối thiểu", + "presets.resize_filter": "Lấy mẫu lại", + "presets.resize_filter_hint": "Cách trộn điểm ảnh khi đổi kích thước. Tự động dùng Lanczos khi thu nhỏ và Mitchell khi phóng to.", + "presets.resize_filter.Auto": "Tự động", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (song lập phương)", + "presets.resize_filter.Bilinear": "Song tuyến", + "presets.resize_filter.Box": "Hộp", + "presets.resize_filter.Nearest": "Láng giềng gần nhất (pixel art)", "presets.rotation": "Xoay", "presets.rotation.None": "Không xoay", "presets.rotation.Right90": "Phải 90°", diff --git a/src/Filee.App/Assets/i18n/zh-CN.json b/src/Filee.App/Assets/i18n/zh-CN.json index 3d357541e..caa12378b 100644 --- a/src/Filee.App/Assets/i18n/zh-CN.json +++ b/src/Filee.App/Assets/i18n/zh-CN.json @@ -975,6 +975,15 @@ "presets.resize.Width": "设置宽度", "presets.resize.Custom": "设置宽度和高度", "presets.resize.MinShortEdge": "设置短边最小值", + "presets.resize_filter": "重采样", + "presets.resize_filter_hint": "调整大小时像素的混合方式。自动:缩小用 Lanczos,放大用 Mitchell。", + "presets.resize_filter.Auto": "自动", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (双三次)", + "presets.resize_filter.Bilinear": "双线性", + "presets.resize_filter.Box": "盒式", + "presets.resize_filter.Nearest": "最近邻 (像素画)", "presets.rotation": "旋转", "presets.rotation.None": "不旋转", "presets.rotation.Right90": "向右 90°", diff --git a/src/Filee.App/Assets/i18n/zh-TW.json b/src/Filee.App/Assets/i18n/zh-TW.json index 327df99c7..d7aa17ccf 100644 --- a/src/Filee.App/Assets/i18n/zh-TW.json +++ b/src/Filee.App/Assets/i18n/zh-TW.json @@ -975,6 +975,15 @@ "presets.resize.Width": "設定寬度", "presets.resize.Custom": "設定寬度和高度", "presets.resize.MinShortEdge": "設定短邊最小值", + "presets.resize_filter": "重新取樣", + "presets.resize_filter_hint": "調整大小時像素的混合方式。自動:縮小用 Lanczos,放大用 Mitchell。", + "presets.resize_filter.Auto": "自動", + "presets.resize_filter.Lanczos": "Lanczos", + "presets.resize_filter.Mitchell": "Mitchell", + "presets.resize_filter.CatmullRom": "Catmull-Rom (雙立方)", + "presets.resize_filter.Bilinear": "雙線性", + "presets.resize_filter.Box": "盒狀", + "presets.resize_filter.Nearest": "最近鄰 (像素畫)", "presets.rotation": "旋轉", "presets.rotation.None": "不旋轉", "presets.rotation.Right90": "向右 90°", diff --git a/src/Filee.App/ViewModels/PresetEditorViewModel.cs b/src/Filee.App/ViewModels/PresetEditorViewModel.cs index 6022410b0..91e61148e 100644 --- a/src/Filee.App/ViewModels/PresetEditorViewModel.cs +++ b/src/Filee.App/ViewModels/PresetEditorViewModel.cs @@ -152,6 +152,7 @@ .. FormatRegistry.Known if (preset.IsCopyToFolder) Targets = [new Choice(Preset.CopyTarget, loc["presets.copy_to_folder"])]; ResizeModes = Enum.GetValues().Select(v => new Choice(v, loc[$"presets.resize.{v}"])).ToList(); + ResizeFilters = Enum.GetValues().Select(v => new Choice(v, loc[$"presets.resize_filter.{v}"])).ToList(); Rotations = Enum.GetValues().Select(v => new Choice(v, loc[$"presets.rotation.{v}"])).ToList(); Flips = Enum.GetValues().Select(v => new Choice(v, loc[$"presets.flip.{v}"])).ToList(); PageSizes = Enum.GetValues().Select(v => new Choice(v, loc[$"presets.page_size.{v}"])).ToList(); @@ -263,6 +264,7 @@ .. WhisperLanguages.All _location = _edit.Output.AskEveryTime ? Locations[^1] : Locations.First(l => l.Value == _edit.Output.Location); _conflict = Conflicts.First(c => c.Value == _edit.Output.Conflict); _tiffCompression = TiffCompressions.First(t => t.Value == _edit.Image.TiffCompression); + _resizeFilter = ResizeFilters.FirstOrDefault(f => f.Value == _edit.Image.ResizeFilter) ?? ResizeFilters[0]; _fitsTiffMode = FitsTiffModes.FirstOrDefault(m => m.Value == _edit.Image.FitsTiff) ?? FitsTiffModes[0]; _fitsDebayer = _edit.Image.FitsDebayer; _rasterColours = RasterColourModes.FirstOrDefault(m => m.Value == _edit.Image.RasterColours) ?? RasterColourModes[0]; @@ -515,6 +517,7 @@ public async Task TestTranslationAsync() public IReadOnlyList> Locations { get; } public IReadOnlyList> Conflicts { get; } public IReadOnlyList> TiffCompressions { get; } + public IReadOnlyList> ResizeFilters { get; } /// FITS → TIFF: the data as it is, or stretched (ImageOptions.FitsTiff). public IReadOnlyList> FitsTiffModes { get; } @@ -733,7 +736,7 @@ public Choice AudioCodecChoice } } - [ObservableProperty, NotifyPropertyChangedFor(nameof(ShowPercent), nameof(ShowLongEdge), nameof(ShowWidth), nameof(ShowCustom), nameof(ShowMinShortEdge))] + [ObservableProperty, NotifyPropertyChangedFor(nameof(ShowPercent), nameof(ShowLongEdge), nameof(ShowWidth), nameof(ShowCustom), nameof(ShowMinShortEdge), nameof(ShowResizeFilter))] [NotifyPropertyChangedFor(nameof(CustomSizeError), nameof(IsValid))] private Choice _resize; @@ -749,6 +752,7 @@ public Choice AudioCodecChoice [ObservableProperty] private Choice _conflict; [ObservableProperty] private Choice _tiffCompression; + [ObservableProperty] private Choice _resizeFilter; [ObservableProperty] private Choice _fitsTiffMode; /// FITS → other pictures: debayer a colour camera's raw frame (ImageOptions.FitsDebayer). @@ -1163,6 +1167,8 @@ partial void OnImageSizeUnitChanged(Choice? oldValue, Choice? oldValue, Choice newValue) => Choices.Restore(oldValue, newValue, v => PageSize = v); partial void OnLocationChanged(Choice? oldValue, Choice newValue) => Choices.Restore(oldValue, newValue, v => Location = v); partial void OnConflictChanged(Choice? oldValue, Choice newValue) => Choices.Restore(oldValue, newValue, v => Conflict = v); + partial void OnResizeFilterChanged(Choice? oldValue, Choice newValue) => + Choices.Restore(oldValue, newValue, v => ResizeFilter = v); partial void OnTiffCompressionChanged(Choice? oldValue, Choice newValue) => Choices.Restore(oldValue, newValue, v => TiffCompression = v); partial void OnFitsTiffModeChanged(Choice? oldValue, Choice newValue) => @@ -1368,6 +1374,7 @@ partial void OnUpscaleTileSizeChanged(Choice? oldValue, Choice newValu public bool ShowWidth => Resize.Value == ResizeMode.Width; public bool ShowCustom => Resize.Value == ResizeMode.Custom; public bool ShowMinShortEdge => Resize.Value == ResizeMode.MinShortEdge; + public bool ShowResizeFilter => Resize.Value != ResizeMode.None; public bool ShowMargin => PageSize.Value != PdfPageSize.FitImage; public bool ShowSubfolder => Location.Value == OutputLocation.Subfolder; public bool ShowCustomFolder => Location.Value == OutputLocation.CustomFolder; @@ -1450,6 +1457,7 @@ public bool Apply() image.KeepEnclosedBackground = KeepEnclosedBackground; image.Background = string.IsNullOrWhiteSpace(Background) ? "#FFFFFF" : Background.Trim(); image.TiffCompression = TiffCompression.Value; + image.ResizeFilter = ResizeFilter.Value; image.WebpLossless = WebpLossless; image.MultiPageTiff = MultiPageTiff; image.FitsTiff = FitsTiffMode.Value; diff --git a/src/Filee.App/Views/PresetEditorView.axaml b/src/Filee.App/Views/PresetEditorView.axaml index 86745d136..fa3e2be12 100644 --- a/src/Filee.App/Views/PresetEditorView.axaml +++ b/src/Filee.App/Views/PresetEditorView.axaml @@ -161,6 +161,12 @@ + + + + + diff --git a/src/Filee.Core/Gallery/SharedPresetRules.cs b/src/Filee.Core/Gallery/SharedPresetRules.cs index e82b77393..f378fc9d6 100644 --- a/src/Filee.Core/Gallery/SharedPresetRules.cs +++ b/src/Filee.Core/Gallery/SharedPresetRules.cs @@ -150,6 +150,7 @@ private static ValueRule MetadataValue(string field) => SharedText.IsPersonalFie ("maxSizeKeepsPixels", Flag), ("minSizeMb", new NumberRule(0, 10_000)), ("resize", Enum()), + ("resizeFilter", Enum()), ("rotation", Enum()), ("flip", Enum()), ("annotations", new ListRule(Obj( diff --git a/src/Filee.Core/Gallery/SharedPresetVersions.cs b/src/Filee.Core/Gallery/SharedPresetVersions.cs index f59835b14..adfbfc662 100644 --- a/src/Filee.Core/Gallery/SharedPresetVersions.cs +++ b/src/Filee.Core/Gallery/SharedPresetVersions.cs @@ -31,6 +31,7 @@ internal static class SharedPresetVersions public static readonly IReadOnlyDictionary Fields = new Dictionary(StringComparer.Ordinal) { ["presets[].image.rasterColours"] = "2.6.0", + ["presets[].image.resizeFilter"] = "2.6.0", ["presets[].media.turnUpright"] = "2.6.0", ["presets[].media.clip.music.loop"] = "2.6.0", ["presets[].media.dvd"] = "2.6.0", diff --git a/src/Filee.Core/Presets/Preset.cs b/src/Filee.Core/Presets/Preset.cs index a2d8292be..588c57d44 100644 --- a/src/Filee.Core/Presets/Preset.cs +++ b/src/Filee.Core/Presets/Preset.cs @@ -512,6 +512,24 @@ public enum ResizeMode MinShortEdge, } +/// +/// The resampling filter a resize uses (issue #1601). leaves it to ImageMagick: Mitchell when +/// enlarging or for pictures with alpha or a palette, Lanczos when shrinking. +/// +public enum ResizeFilter +{ + Auto, + Lanczos, + Mitchell, + /// Catmull-Rom, the sharp bicubic most apps call "Bicubic". + CatmullRom, + /// Bilinear (ImageMagick's Triangle). + Bilinear, + Box, + /// Nearest neighbour (ImageMagick's Point): hard pixel edges, for pixel art. + Nearest, +} + /// How an image is turned, after its EXIF orientation is applied. public enum ImageRotation { @@ -910,6 +928,9 @@ public void ForgetBackdropPictures() /// Target width in pixels when is . public int Width { get; set; } = 1200; + /// The filter every resize of the picture uses, the format size caps included (issue #1601). + public ResizeFilter ResizeFilter { get; set; } = ResizeFilter.Auto; + /// /// Free width x height resizing (issue #576): stretched to exactly that size, or with /// scaled (up or down, or with only diff --git a/src/Filee.Engines/Magick/ImageEncoder.cs b/src/Filee.Engines/Magick/ImageEncoder.cs index d85aa801d..32a4de877 100644 --- a/src/Filee.Engines/Magick/ImageEncoder.cs +++ b/src/Filee.Engines/Magick/ImageEncoder.cs @@ -254,6 +254,18 @@ public static double MinShortEdgeScale(double width, double height, int minShort return scale <= 1 ? 1 : Math.Max(1, Math.Min(scale, Math.Sqrt(MaxEnlargedPixels / (width * height)))); } + /// The ImageMagick filter for , or null for Auto (ImageMagick chooses). + public static FilterType? Filter(ResizeFilter filter) => filter switch + { + ResizeFilter.Lanczos => FilterType.Lanczos, + ResizeFilter.Mitchell => FilterType.Mitchell, + ResizeFilter.CatmullRom => FilterType.Catrom, + ResizeFilter.Bilinear => FilterType.Triangle, + ResizeFilter.Box => FilterType.Box, + ResizeFilter.Nearest => FilterType.Point, + _ => null, + }; + /// Turns and mirrors an image as say (part of ). public static void Turn(IMagickImage image, ImageOptions options) { @@ -328,6 +340,11 @@ public static void ApplyOptions(IMagickImage image, ImageOptions options, image.SetProfile(exif); } + // Set on the image, so every later resize uses it: the ones below, the format caps, icons and cursors, and the + // copies the file-size fit scales down. Auto leaves FilterType unset and ImageMagick picks (issue #1601). + if (Filter(options.ResizeFilter) is { } filter) + image.FilterType = filter; + // A hand-edited presets.json or an imported bundle can carry sizes the editor would never write, and a // width of 0 or below would wrap to about 4 billion px in the (uint) casts below: such a size is skipped, // so the picture keeps the preset's own resize behavior (None for a Custom preset) instead. A size above the diff --git a/tests/Filee.Engines.Tests/ImageFormatTests.cs b/tests/Filee.Engines.Tests/ImageFormatTests.cs index 55a8c6d4e..10000ce09 100644 --- a/tests/Filee.Engines.Tests/ImageFormatTests.cs +++ b/tests/Filee.Engines.Tests/ImageFormatTests.cs @@ -345,4 +345,26 @@ public void ApplyOptions_keeps_sub_eight_bit_depth_and_caps_sixteen_bit_depth() ImageEncoder.ApplyOptions(high, new ImageOptions(), "tiff"); Assert.Equal(8u, high.Depth); } + + /// + /// #1601: the preset's resampling filter is the one the resize uses. A 2 x 2 checkerboard enlarged 4x stays pure + /// black and white with nearest neighbour, and Automatic (ImageMagick's own choice) blends the edges into greys. + /// + [Theory] + [InlineData(ResizeFilter.Nearest, 2)] + [InlineData(ResizeFilter.Auto, 3)] + public void ApplyOptions_resizes_with_the_chosen_filter(ResizeFilter filter, int minColours) + { + using var checker = new MagickImage(MagickColors.White, 2, 2); + checker.GetPixels().SetPixel(0, 0, [0, 0, 0]); + checker.GetPixels().SetPixel(1, 1, [0, 0, 0]); + ImageEncoder.ApplyOptions(checker, new ImageOptions { Resize = ResizeMode.Percent, ResizePercent = 400, ResizeFilter = filter }, "png"); + + Assert.Equal(8u, checker.Width); + var colours = checker.Histogram().Count; + if (filter == ResizeFilter.Nearest) + Assert.Equal(minColours, colours); + else + Assert.True(colours >= minColours, $"{filter} gave {colours} colours"); + } } From 146b1c5140a55a33a320b94f17318517d6544c46 Mon Sep 17 00:00:00 2001 From: cre8ive-marketing <168519979+cre8ive-marketing@users.noreply.github.com> Date: Wed, 2 Dec 2026 18:15:27 +0530 Subject: [PATCH 2/2] Resampling filter: review fixes (#1601) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ImageOptions.ResizeFilter reads leniently: a filter from a newer Filee (or a missing field) is Automatic instead of breaking presets.json. Test: saved by name, missing, unknown. - ICNS uses the preset's filter too (Automatic stays Lanczos). - The editor saves Automatic when Resize is Original size, so no hidden filter is kept. - ko.json hint in 해요체. --- CHANGELOG.md | 2 +- src/Filee.App/Assets/i18n/ko.json | 2 +- .../ViewModels/PresetEditorViewModel.cs | 3 ++- src/Filee.Core/Presets/Preset.cs | 1 + src/Filee.Engines/Icns/IcnsConverter.cs | 3 ++- tests/Filee.Core.Tests/ResizeFilterTests.cs | 27 +++++++++++++++++++ 6 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 tests/Filee.Core.Tests/ResizeFilterTests.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 1706db491..4545945a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -127,7 +127,7 @@ en: Image presets can choose how a resize blends pixels: Lanczos, Mitchell, Catm - **Choose the resampling filter** (#1601). An image preset that resizes now has a **Resampling** box under **Resize**: Automatic (as before: ImageMagick picks Lanczos for shrinking and Mitchell for enlarging), Lanczos, Mitchell, Catmull-Rom (the sharp bicubic), Bilinear, Box, or Nearest neighbour for pixel art. The same filter is - used when a picture is scaled to fit a format's size limit or a maximum file size, and for icons and cursors. + used when a picture is scaled to fit a format's size limit or a maximum file size, and for icons and cursors (ICO, CUR and ICNS). - **No update notice over full-screen games** (#1897). The "new version" card in the bottom-right corner could appear on top of a full-screen game, where it looked like something that didn't belong there. While a full-screen game or diff --git a/src/Filee.App/Assets/i18n/ko.json b/src/Filee.App/Assets/i18n/ko.json index 2fc341a4a..e57529cd5 100644 --- a/src/Filee.App/Assets/i18n/ko.json +++ b/src/Filee.App/Assets/i18n/ko.json @@ -976,7 +976,7 @@ "presets.resize.Custom": "너비와 높이 맞추기", "presets.resize.MinShortEdge": "짧은 변 최소 길이", "presets.resize_filter": "리샘플링", - "presets.resize_filter_hint": "크기를 바꿀 때 픽셀을 섞는 방식입니다. 자동은 줄일 때 Lanczos, 키울 때 Mitchell을 씁니다.", + "presets.resize_filter_hint": "크기를 바꿀 때 픽셀을 섞는 방식이에요. 자동은 줄일 때 Lanczos, 키울 때 Mitchell을 써요.", "presets.resize_filter.Auto": "자동", "presets.resize_filter.Lanczos": "Lanczos", "presets.resize_filter.Mitchell": "Mitchell", diff --git a/src/Filee.App/ViewModels/PresetEditorViewModel.cs b/src/Filee.App/ViewModels/PresetEditorViewModel.cs index 91e61148e..01e3ae165 100644 --- a/src/Filee.App/ViewModels/PresetEditorViewModel.cs +++ b/src/Filee.App/ViewModels/PresetEditorViewModel.cs @@ -1457,7 +1457,8 @@ public bool Apply() image.KeepEnclosedBackground = KeepEnclosedBackground; image.Background = string.IsNullOrWhiteSpace(Background) ? "#FFFFFF" : Background.Trim(); image.TiffCompression = TiffCompression.Value; - image.ResizeFilter = ResizeFilter.Value; + // A filter hidden with "Original size" isn't kept: it would still apply to the format caps and the size fit. + image.ResizeFilter = ShowResizeFilter ? ResizeFilter.Value : Filee.Core.Presets.ResizeFilter.Auto; image.WebpLossless = WebpLossless; image.MultiPageTiff = MultiPageTiff; image.FitsTiff = FitsTiffMode.Value; diff --git a/src/Filee.Core/Presets/Preset.cs b/src/Filee.Core/Presets/Preset.cs index 588c57d44..86df21568 100644 --- a/src/Filee.Core/Presets/Preset.cs +++ b/src/Filee.Core/Presets/Preset.cs @@ -929,6 +929,7 @@ public void ForgetBackdropPictures() public int Width { get; set; } = 1200; /// The filter every resize of the picture uses, the format size caps included (issue #1601). + [JsonConverter(typeof(LenientEnumJsonConverter))] public ResizeFilter ResizeFilter { get; set; } = ResizeFilter.Auto; /// diff --git a/src/Filee.Engines/Icns/IcnsConverter.cs b/src/Filee.Engines/Icns/IcnsConverter.cs index 6f2086354..c89ce6eb0 100644 --- a/src/Filee.Engines/Icns/IcnsConverter.cs +++ b/src/Filee.Engines/Icns/IcnsConverter.cs @@ -51,7 +51,8 @@ private static IReadOnlyList WriteIcon(ConversionStep step, IProgress