Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.
C# audio-converteravaloniabatch-conversionconvertercsharpdocument-converterdocx-to-pdfdotnetdrag-and-dropfile-conversionfile-converterheic-converterhwphwpximage-converterlinuxmacospdf-convertervideo-converterwindows
Merge pull request #349: Everyday media tools on 2.0.0, with audit fixes (schema 37)
KnifeLemon545c83b13118
diff --cc docs/ARCHITECTURE.mdindex 024c0cbc,e198a180..5cd601a2--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@@ -50,10 -50,11 +50,14 @@@same name ("Overwrite"). It frees its names and removes an output folder it made if that is left empty."Merge into one PDF" converts each file to PDF and merges with PDFsharp."Compress into one archive" packs the dropped files, unconverted, with the archive engine (`IFileCombiner`).+ "Merge videos", "Merge audio" and "Video from images" join the files, in the order picked in the merge order+ window, into one file with FFmpeg (`IMediaJoiner`); pictures become PNG through the image engines first. Like the+ other one-file jobs, the output follows "subfolder only for several files", and a join that fails or is cancelled+ is undone by the job's allocator, which deletes only paths that were the job's own.6. **Report** – progress and results appear in the toast window and in Home → Recent conversions.+ Renderers check only the original source for referenced fonts. `ConversionStep.MissingFonts` reports any missing+ families to `FileResult.MissingFonts`; the toast card can offer one trusted source, while the CLI and watch jobs+ report the names without pausing conversion or installing anything.## Files dragged from a web browserdiff --cc docs/ENGINES.mdindex 2f8ae99a,c439ec85..b35dd57d--- a/docs/ENGINES.md+++ b/docs/ENGINES.md@@@ -7,12 -7,12 +7,12 @@@ Filee chooses engines automatically. Se|---|---|---|| ImageMagick (Magick.NET) | built in (library) | JPG, PNG, WEBP, TIFF, BMP, GIF, ICO, AVIF, JPEG XL, JPEG 2000, PSD/PSB, TGA, PPM, MNG, QOI, DDS, PCX, CUR, XPM, XBM, WBMP, PAM, PFM, SGI, Sun Raster, MIFF ↔ each other, and **APNG** (Filee's own reader and writer); HEIC (written with FFmpeg), XCF, camera RAW (LibRaw), DICOM (uncompressed ones by Filee's own reader), Photo CD, OpenEXR, Radiance HDR, EMF/WMF (Windows) and the photo of an iPhone LIVP read || Windows Imaging Component | part of Windows (Windows only) | **JPEG XR** (JXR, WDP, HDP; HDR screenshots of Windows) → the images ImageMagick writes, and PDF, ICNS, HEIC and SVG through PNG; HDR tone-mapped to SDR |-| Vector graphics | built in (Svg.Skia, SkiaSharp, ACadSharp) | **SVG/SVGZ → PDF (vector) and images**, SVG ↔ SVGZ, **SVG → DXF** (→ DWG with the CAD engine), **raster images → SVG (tracing)**, PDF-compatible AI → PDF |+| Vector graphics | built in (Svg.Skia, SkiaSharp, ACadSharp) | **SVG/SVGZ → PDF (vector) and images**, SVG ↔ SVGZ, **SVG → DXF** (→ DWG with the CAD engine), **raster images → SVG (tracing)**, PDF-compatible AI → PDF, **HP-GL / HP-GL/2 plot files (PLT) → SVG**, PDF and images (pen moves, packed PE polylines, arcs and filled polygons; text labels are not drawn) || ICNS | built in | images → ICNS (16–1024 px), ICNS → images |- | PDFsharp | built in (library) | images → PDF, merge, split, page ranges, **compression** (smaller PDFs, see below) |+ | PDFsharp | built in (library) | images → PDF, merge, split, page ranges, **compression** (smaller PDFs, see below), PDFs without their metadata || PDFium | built in (library) | PDF → images (multi-page TIFF/GIF supported) || Unhwp | built in (library) | HWP/HWPX → TXT, Markdown, HTML (pictures in a `<name>_files` folder next to the Markdown, embedded in the HTML) |-| Text & Markdown (Markdig) | built in (library) | **Markdown → HTML, TXT**; **TXT, LOG, PY, PAC, BAT, COMMAND → UTF-8 TXT**, preserving source text without running scripts (and → PDF / DOCX through the HWPX writer, rhwp or LibreOffice) |+| Text & Markdown (Markdig) | built in (library) | **Markdown → HTML, TXT**; **TXT, LOG, PY, PAC, BAT, COMMAND, LUA, CSS → UTF-8 TXT**, preserving source text without running scripts (and → PDF / DOCX through the HWPX writer, rhwp or LibreOffice) || Spreadsheets (ExcelDataReader for XLS) | built in (library) | **XLSX, XLS, ODS, CSV, TSV → XLSX, ODS, CSV, TSV** (one CSV / TSV per sheet) || Office Open XML | built in | **DOCM / DOTX / DOTM ↔ DOCX, XLSM / XLTX ↔ XLSX, PPTM / POTX / POTM / PPSX ↔ PPTX** (macros removed for macro-free types) || Fonts | built in | **TTF, OTF, WOFF, WOFF2, EOT ↔ each other**; CFF (PostScript) outlines become TrueType for TTF and EOT |diff --cc src/Filee.App/Assets/i18n/ar.jsonindex 00db3f53,69a9198a..f67efc60--- a/src/Filee.App/Assets/i18n/ar.json+++ b/src/Filee.App/Assets/i18n/ar.json@@@ -78,8 -75,8 +78,9 @@@"format_request.notice_text": "أخبرنا بالصيغة التي تحتاجها.\nتساعد الطلبات في تحديد الصيغ التي سيدعمها Filee لاحقًا.\nلا يمكن تحويل الملفات المشفّرة أو المحمية من النسخ (DRM)، مهما كانت صيغتها.","error.no_route": "لا يوجد محرك يستطيع إجراء هذا التحويل","error.cannot_turn": "التدوير والانعكاس متاحان للصور فقط",+ "error.no_transparency": "هذا التنسيق لا يدعم الشفافية، لذا لا يوجد ما يُقص","error.too_many_frames": "عدد الإطارات كبير جدًا لحفظها كصور. زِد قيمة «كل إطار رقم N»",+ "error.too_many_pictures": "عدد الصور كبير جدًا لفيديو واحد، قسّمها على عدة فيديوهات","error.not_enough_space": "لا توجد مساحة كافية على القرص لحفظ الصور","error.no_motion_photo": "لا تحتوي هذه الصورة على فيديو يستطيع Filee قراءته (صورة Motion Photo من Android، أو Live Photo من iPhone مع ملف MOV بجانبها)","error.live_photo_start": "يبدأ المقطع بعد نهاية هذا الفيديو. اختر «بداية المقطع» أبكر",diff --cc src/Filee.App/Assets/i18n/en.jsonindex 996e0c9e,ccd8d77d..fabe56e3--- a/src/Filee.App/Assets/i18n/en.json+++ b/src/Filee.App/Assets/i18n/en.json@@@ -84,8 -81,8 +84,9 @@@"format_request.notice_text": "Tell us which format you need.\nRequests decide what Filee supports next.\nEncrypted or copy-protected (DRM) files can't be converted, whatever the format.","error.no_route": "No engine can do this conversion","error.cannot_turn": "Rotate and flip work on images only",+ "error.no_transparency": "This format has no transparency, so there's nothing to trim","error.too_many_frames": "Too many frames to save as pictures, raise \"Every Nth frame\"",+ "error.too_many_pictures": "Too many pictures for one video, split them into several","error.not_enough_space": "Not enough free disk space for the pictures","error.no_motion_photo": "This photo has no video Filee can read (an Android Motion Photo, or an iPhone Live Photo with its MOV next to it)","error.live_photo_start": "The clip starts after the end of this video. Choose an earlier \"Clip start\"",diff --cc src/Filee.App/Assets/i18n/es.jsonindex f69e7eaf,921e1036..f0615151--- a/src/Filee.App/Assets/i18n/es.json+++ b/src/Filee.App/Assets/i18n/es.json@@@ -78,8 -75,8 +78,9 @@@"format_request.notice_text": "Cuéntanos qué formato necesitas.\nLas solicitudes determinan qué formatos admitirá Filee a continuación.\nLos archivos cifrados o con protección de copia (DRM) no se pueden convertir, sea cual sea su formato.","error.no_route": "Ningún motor puede hacer esta conversión","error.cannot_turn": "Rotar y voltear solo funcionan con imágenes",+ "error.no_transparency": "Este formato no tiene transparencia, así que no hay nada que recortar","error.too_many_frames": "Demasiados fotogramas para guardar como imágenes; aumenta «Cada N fotogramas»",+ "error.too_many_pictures": "Demasiadas imágenes para un vídeo; divídelas en varios","error.not_enough_space": "Espacio libre en disco insuficiente para las imágenes","error.no_motion_photo": "Esta foto no tiene un vídeo que Filee pueda leer (una Motion Photo de Android o una Live Photo de iPhone con su MOV al lado)","error.live_photo_start": "El clip empieza después del final de este vídeo. Elige un «Inicio del clip» anterior",diff --cc src/Filee.App/Assets/i18n/hi.jsonindex 06f36822,8ef98e60..ab3f5765--- a/src/Filee.App/Assets/i18n/hi.json+++ b/src/Filee.App/Assets/i18n/hi.json@@@ -78,8 -75,8 +78,9 @@@"format_request.notice_text": "हमें बताएँ कि आपको कौन-सा फ़ॉर्मैट चाहिए।\nअनुरोधों से तय होता है कि Filee आगे क्या समर्थन करेगा।\nएन्क्रिप्टेड या कॉपी-सुरक्षित (DRM) फ़ाइलें किसी भी फ़ॉर्मैट में कन्वर्ट नहीं की जा सकतीं।","error.no_route": "कोई भी इंजन यह कन्वर्ज़न नहीं कर सकता","error.cannot_turn": "घुमाना और पलटना केवल इमेज पर काम करता है",+ "error.no_transparency": "इस फ़ॉर्मैट में पारदर्शिता नहीं है, इसलिए काटने को कुछ नहीं है","error.too_many_frames": "तस्वीरों के रूप में सहेजने के लिए बहुत ज़्यादा फ़्रेम हैं, \"हर Nवाँ फ़्रेम\" बढ़ाएँ",+ "error.too_many_pictures": "एक वीडियो के लिए तस्वीरें बहुत ज़्यादा हैं, इन्हें कई हिस्सों में बाँटें","error.not_enough_space": "तस्वीरों के लिए डिस्क पर पर्याप्त खाली जगह नहीं है","error.no_motion_photo": "इस फ़ोटो में ऐसा कोई वीडियो नहीं है जिसे Filee पढ़ सके (Android मोशन फ़ोटो, या पास में अपनी MOV फ़ाइल वाली iPhone लाइव फ़ोटो)","error.live_photo_start": "क्लिप इस वीडियो के ख़त्म होने के बाद शुरू होती है। \"क्लिप की शुरुआत\" पहले चुनें",diff --cc src/Filee.App/Assets/i18n/ja.jsonindex ae099f3c,59894213..ea3cbcbd--- a/src/Filee.App/Assets/i18n/ja.json+++ b/src/Filee.App/Assets/i18n/ja.json@@@ -78,8 -75,8 +78,9 @@@"format_request.notice_text": "必要な形式を教えてください。\nリクエストをもとに、今後Fileeが対応する形式を決めます。\n暗号化またはコピー保護(DRM)されたファイルは、形式にかかわらず変換できません。","error.no_route": "この変換に対応するエンジンがありません","error.cannot_turn": "回転と反転は画像でのみ使えます",+ "error.no_transparency": "この形式には透明部分がないため、切り取るものがありません","error.too_many_frames": "画像として保存するフレーム数が多すぎます。「Nフレームごと」の値を大きくしてください",+ "error.too_many_pictures": "1本の動画にするには画像が多すぎます。いくつかに分けてください","error.not_enough_space": "画像を保存するための空き容量が不足しています","error.no_motion_photo": "この写真には、Fileeが読み取れる動画がありません(Androidのモーションフォト、または隣にMOVがあるiPhoneのLive Photo)","error.live_photo_start": "クリップの開始位置が動画の終わりより後です。「クリップの開始」をもっと前にしてください",diff --cc src/Filee.App/Assets/i18n/ko.jsonindex 614bd6e2,7d2bd40a..4047b5f7--- a/src/Filee.App/Assets/i18n/ko.json+++ b/src/Filee.App/Assets/i18n/ko.json@@@ -84,8 -81,8 +84,9 @@@"format_request.notice_text": "필요한 형식을 알려주세요.\n요청을 보고 다음에 지원할 형식을 정해요.\n암호화되거나 DRM이 걸린 파일은 변환할 수 없어요.","error.no_route": "이 변환을 할 수 있는 엔진이 없어요","error.cannot_turn": "회전·반전은 이미지에만 할 수 있어요",+ "error.no_transparency": "이 형식에는 투명한 부분이 없어서 잘라낼 것이 없어요","error.too_many_frames": "프레임이 너무 많아요. 'N번째 프레임마다' 값을 늘려 주세요",+ "error.too_many_pictures": "한 동영상에 넣기엔 사진이 너무 많아요. 여러 번에 나눠 주세요","error.not_enough_space": "이미지를 저장할 디스크 공간이 부족해요","error.no_motion_photo": "이 사진에서 읽을 수 있는 동영상을 찾지 못했어요 (안드로이드 모션 포토, 또는 옆에 MOV가 있는 아이폰 라이브 포토)","error.live_photo_start": "클립 시작이 동영상 끝보다 뒤예요. \"클립 시작\"을 더 앞으로 정해 주세요",diff --cc src/Filee.App/Assets/i18n/pl.jsonindex dbc41a83,227d60f9..3311cdd3--- a/src/Filee.App/Assets/i18n/pl.json+++ b/src/Filee.App/Assets/i18n/pl.json@@@ -84,8 -81,8 +84,9 @@@"format_request.notice_text": "Napisz, jakiego formatu potrzebujesz.\nNa podstawie próśb wybieramy kolejne obsługiwane formaty.\nPlików zaszyfrowanych lub chronionych przed kopiowaniem (DRM) nie da się konwertować, niezależnie od formatu.","error.no_route": "Żaden silnik nie wykona tej konwersji","error.cannot_turn": "Obracanie i odbicie działają tylko na obrazach",+ "error.no_transparency": "Ten format nie ma przezroczystości, więc nie ma czego przycinać","error.too_many_frames": "Za dużo klatek do zapisania jako obrazy, zwiększ „Co N-ta klatka”",+ "error.too_many_pictures": "Za dużo zdjęć na jedno wideo, podziel je na kilka","error.not_enough_space": "Za mało wolnego miejsca na dysku na obrazy","error.no_motion_photo": "To zdjęcie nie ma wideo, które Filee może odczytać (Motion Photo z Androida lub Live Photo z iPhone'a z plikiem MOV obok)","error.live_photo_start": "Klip zaczyna się po końcu tego wideo. Wybierz wcześniejszy „Początek klipu”",diff --cc src/Filee.App/Assets/i18n/pt-BR.jsonindex 138da872,7584f266..8d20abed--- a/src/Filee.App/Assets/i18n/pt-BR.json+++ b/src/Filee.App/Assets/i18n/pt-BR.json@@@ -84,8 -81,8 +84,9 @@@"format_request.notice_text": "Diga qual formato você precisa.\nOs pedidos decidem o que o Filee passa a aceitar.\nArquivos criptografados ou protegidos contra cópia (DRM) não podem ser convertidos, seja qual for o formato.","error.no_route": "Nenhum motor faz esta conversão","error.cannot_turn": "Girar e espelhar só funcionam em imagens",+ "error.no_transparency": "Este formato não tem transparência, então não há nada para cortar","error.too_many_frames": "Quadros demais para salvar como imagens. Aumente “A cada N quadros”",+ "error.too_many_pictures": "Imagens demais para um vídeo; divida-as em vários","error.not_enough_space": "Não há espaço livre suficiente em disco para as imagens","error.no_motion_photo": "Esta foto não tem um vídeo que o Filee consiga ler (uma Motion Photo do Android, ou uma Live Photo do iPhone com o MOV ao lado)","error.live_photo_start": "O clipe começa depois do fim deste vídeo. Escolha um “Início do clipe” mais cedo",diff --cc src/Filee.App/Assets/i18n/ru.jsonindex 2c7aa40a,bbdb49b6..6d5f33ab--- a/src/Filee.App/Assets/i18n/ru.json+++ b/src/Filee.App/Assets/i18n/ru.json@@@ -84,8 -81,8 +84,9 @@@"format_request.notice_text": "Напишите, какой формат вам нужен.\nОт запросов зависит, что Filee будет поддерживать дальше.\nЗашифрованные и защищённые от копирования (DRM) файлы сконвертировать нельзя, в каком бы формате они ни были.","error.no_route": "Нет движка для такой конвертации","error.cannot_turn": "Поворот и отражение работают только с изображениями",+ "error.no_transparency": "В этом формате нет прозрачности, обрезать нечего","error.too_many_frames": "Слишком много кадров для сохранения картинками — увеличьте «Каждый N-й кадр»",+ "error.too_many_pictures": "Слишком много картинок для одного видео — разделите их на несколько","error.not_enough_space": "Не хватает места на диске для картинок","error.no_motion_photo": "В этом фото нет видео, которое Filee может прочитать (Motion Photo с Android или Live Photo с iPhone с файлом MOV рядом)","error.live_photo_start": "Клип начинается после конца этого видео. Выберите более раннее «Начало клипа»",diff --cc src/Filee.App/Assets/i18n/zh-CN.jsonindex 4e3e8c69,f3f8f9cc..855d8f24--- a/src/Filee.App/Assets/i18n/zh-CN.json+++ b/src/Filee.App/Assets/i18n/zh-CN.json@@@ -84,8 -81,8 +84,9 @@@"format_request.notice_text": "告诉我们你需要的格式。\n我们会根据请求决定接下来支持哪些格式。\n加密或有复制保护 (DRM) 的文件,无论什么格式都无法转换。","error.no_route": "没有引擎可以完成此转换","error.cannot_turn": "只能旋转和翻转图片",+ "error.no_transparency": "此格式没有透明部分,无需裁剪","error.too_many_frames": "帧数太多,请调大“每 N 帧”",+ "error.too_many_pictures": "图片太多,无法放进一个视频,请分成几次","error.not_enough_space": "磁盘空间不足,无法保存这些图片","error.no_motion_photo": "这张照片中没有可读取的视频(安卓动态照片,或旁边有 MOV 的 iPhone 实况照片)","error.live_photo_start": "片段开始位置在视频结束之后。请把“片段开始”设得更早",diff --cc src/Filee.App/Services/PresetAvailability.csindex bf1225c4,1955cb6e..c3f9a77f--- a/src/Filee.App/Services/PresetAvailability.cs+++ b/src/Filee.App/Services/PresetAvailability.cs@@@ -106,10 -106,22 +106,26 @@@ public sealed class PresetAvailabilitif (formats.Count == 0)return new(PresetUse.Unusable, _loc["error.unsupported_source"]);+ // "Trim transparent borders" on JPG and other formats without transparency would only re-encode them.+ if (preset.Image.TrimTransparent+ && formats.All(f => !Filee.Engines.Magick.ImageEncoder.HoldsAlpha(preset.TargetFormat == BuiltInData.SameAsSource ? f.Id : preset.TargetFormat)))+ return new(PresetUse.Unusable, _loc["error.no_transparency"]);+ // "Merge videos" / "Merge audio" / "Video from images": FFmpeg joins the files, so a route into the target (or,+ // for pictures, into PNG and from PNG into a video) says whether it is installed.+ if (preset.JoinsIntoOneMedia)+ {+ var target = preset.TargetFormat;+ bool Joinable(RoutePlanner planner) => formats.Any(f => preset.Media.Slideshow+ ? f.Category is FormatCategory.Image or FormatCategory.Vector+ && (f.Id == "png" || planner.CanConvert(f.Id, "png")) && planner.CanConvert("png", target)+ : (f.Category == FormatCategory.Video || f.Category == FormatCategory.Audio && target == "m4a")+ && planner.CanConvert(f.Id, target));+ if (Joinable(installedPlanner()))+ return new(PresetUse.Usable, null);+ return packageEnabling(Joinable) is { } joiner+ ? new(PresetUse.NeedsPackage, _loc.Format("engine.reason.needs_package", joiner.Name))+ : new(PresetUse.Unusable, _loc["error.no_route"]);+ }var merge = preset.Pdf.MergeIntoSingle && preset.TargetFormat == "pdf";var turns = preset.Image.TurnsOrMirrors;diff --cc src/Filee.Core/Conversion/JobQueue.csindex 935dfdc5,21c40238..05a22fd2--- a/src/Filee.Core/Conversion/JobQueue.cs+++ b/src/Filee.Core/Conversion/JobQueue.cs@@@ -713,8 -831,21 +861,21 @@@ public sealed class JobQueue : IAsyncDireturn [zipPath];}+ /// <summary>+ /// Puts the source in place of <paramref name="output"/> when both have the same format and the output is not+ /// smaller (<see cref="OutputRule.OnlyIfSmaller"/>). True when it did.+ /// </summary>+ private static bool CopyIfNotSmaller(string source, string output)+ {+ if (!string.Equals(FormatRegistry.Detect(source)?.Id, FormatRegistry.Detect(output)?.Id, StringComparison.Ordinal)+ || !File.Exists(output) || new FileInfo(output).Length < new FileInfo(source).Length)+ return false;+ File.Copy(source, output, overwrite: true);+ return true;+ }+- /// <summary>The engine's check; a check that fails (an unreadable file) finds nothing, and the conversion reports the file.</summary>- private string? ScriptNeedingShaping(ITextShapingCheck check, string path, string format)+ /// <summary>The engine's scan; one that fails (an unreadable file) finds nothing, and the conversion reports the file.</summary>+ private TextScripts? ScanScripts(ITextShapingCheck check, string path, string format){try{diff --cc src/Filee.Core/Presets/BuiltInData.csindex e7d081da,81ab6be0..45ac163f--- a/src/Filee.Core/Presets/BuiltInData.cs+++ b/src/Filee.Core/Presets/BuiltInData.cs@@@ -112,19 -112,62 +113,75 @@@ public static class BuiltInDatnew() { Id = "motion-photo-android", NameKey = "preset.motion_photo_android", TargetFormat = "jpg", Media = { LivePhoto = LivePhotoKind.Android } },];+ /// <summary>+ /// "Trim transparent borders" (issue #332, added in settings schema 33): a copy cropped to the visible pixels, in the+ /// same format. On the images donut's back face after "Remove background".+ /// </summary>+ public static List<Preset> TrimPresets() =>+ [+ new()+ {+ Id = "trim-transparent", NameKey = "preset.trim_transparent", TargetFormat = SameAsSource,+ Image = { TrimTransparent = true }, Output = { FileNamePattern = "{name}_trimmed" },+ },+ ];++ /// <summary>+ /// Everyday tools (added in settings schema 33): smaller copies of images, videos and audio, a video of photos,+ /// a video's sound as M4A, videos or audio files joined into one, and a copy without metadata. On the back faces+ /// of the images, PDF, video and audio donuts where they have room.+ /// </summary>+ public static List<Preset> MediaToolPresets() =>+ [+ new()+ {+ // Quality 75 like most photo apps' "smaller"; a JPEG saved below it stays at its own quality.+ Id = "compress-image", NameKey = "preset.compress_image", TargetFormat = SameAsSource,+ Image = { Quality = 75, MaxCompression = true, TiffCompression = TiffCompression.Zip },+ Output = { FileNamePattern = "{name}_compressed", OnlyIfSmaller = true },+ },+ new()+ {+ // H.264 at the Small quality, at most 1080p: plays everywhere, a fraction of a phone video's size.+ Id = "compress-video", NameKey = "preset.compress_video", TargetFormat = "mp4",+ Media = { Quality = MediaQuality.Small, MaxHeight = 1080 }, Output = { FileNamePattern = "{name}_compressed", OnlyIfSmaller = true },+ },+ new()+ {+ Id = "video-from-images", NameKey = "preset.video_from_images", TargetFormat = "mp4",+ Media = { Slideshow = true }, Output = { FileNamePattern = "{name}_video" },+ },+ new()+ {+ Id = "extract-audio", NameKey = "preset.extract_audio", TargetFormat = "m4a",+ Media = { CopyAudioWhenPossible = true },+ },+ new()+ {+ Id = "merge-videos", NameKey = "preset.merge_videos", TargetFormat = "mp4",+ Media = { JoinIntoOne = true }, Output = { FileNamePattern = "{name}_merged" },+ },+ new()+ {+ // AAC at the Small quality: 128 kbit/s for stereo.+ Id = "compress-audio", NameKey = "preset.compress_audio", TargetFormat = "m4a",+ Media = { Quality = MediaQuality.Small }, Output = { FileNamePattern = "{name}_compressed", OnlyIfSmaller = true },+ },+ new()+ {+ Id = "merge-audio", NameKey = "preset.merge_audio", TargetFormat = "m4a",+ Media = { JoinIntoOne = true }, Output = { FileNamePattern = "{name}_merged" },+ },+ new()+ {+ // Everything goes, the colour profile too; the preset editor can keep it. File dates are new ones.+ Id = "remove-metadata", NameKey = "preset.remove_metadata", TargetFormat = SameAsSource,+ Image = { Quality = 90, KeepMetadata = false, KeepColorProfile = false, KeepSourceQuality = true },+ Pdf = { RemoveMetadata = true }, Media = { RemoveMetadata = true },+ Output = { FileNamePattern = "{name}_clean" },+ },+ ];+/// <summary>/// "Compress PDF": pictures at 150 dpi, the rest compressed losslessly (added in settings schema 20). On no default/// donut, the PDF donut is full: users add it in Settings → Toolbar.@@@ -378,8 -420,8 +435,8 @@@Id = "images", NameKey = "profile.images",Extensions = ExtensionsOf(FormatCategory.Image),PresetIds = ["to-png", "to-jpg", "to-webp", "to-pdf", "trace-svg", "trace-line-art", "to-tiff", "to-bmp", "to-ico", "half-size"],- BackPresetIds = ["tool-crop", "rotate", "flip", "remove-background", "grayscale", "extract-motion", "to-avif", "to-gif", "merge-pdf",- "compress-image", "remove-metadata", "zip-all"],+ BackPresetIds = ["tool-crop", "rotate", "flip", "remove-background", "trim-transparent", "grayscale", "extract-motion", "to-avif", "to-gif",- "merge-pdf", "zip-all"],++ "merge-pdf", "compress-image", "remove-metadata", "zip-all"],},new(){diff --cc src/Filee.Core/Settings/UserDataStore.csindex 1102a5c1,1dd65645..182f4814--- a/src/Filee.Core/Settings/UserDataStore.cs+++ b/src/Filee.Core/Settings/UserDataStore.cs@@@ -750,66 -750,64 +750,121 @@@ internal static class SettingsMigration// v32: logs and script source, Video CD DAT and Workbench archives learn their donuts; custom claims stay put.if (from < 32)changed |= LearnExtensions(profiles, out _, ["log", "py", "pac", "bat", "command", "dat", "wbpz"]);+ // v33: HAR network logs and raw H.265 / H.264 camera streams learn their donuts (custom claims stay put), and+ // "Trim transparent borders" comes in after "Remove background".+ if (from < 33)+ {+ changed |= LearnExtensions(profiles, out _, ["har", "h265", "265", "hevc", "h264", "264"]);+ // "Trim transparent borders" after "Remove background", in the library and on the images donut's back face+ // when it has room and the user hasn't put it there.+ if (BuiltInData.TrimPresets().Single() is var trim && presets.All(p => p.Id != trim.Id))+ {+ var at = presets.FindIndex(p => p.Id == "remove-background");+ presets.Insert(at < 0 ? presets.Count : at + 1, trim);+ changed = true;+ }+ if (profiles.FirstOrDefault(p => p.Id == "images") is { BackPresetIds: { } back } images+ && !back.Contains("trim-transparent") && !images.PresetIds.Contains("trim-transparent")+ && back.Count < ToolbarProfile.MaxSlices)+ {+ var after = back.IndexOf("remove-background");+ back.Insert(after < 0 ? back.Count(id => id != "zip-all") : after + 1, "trim-transparent");+ changed = true;+ }+ }+ // v34: Lua scripts and CSS style sheets learn the text donut; custom claims stay put.+ if (from < 34)+ changed |= LearnExtensions(profiles, out _, ["lua", "css"]);+ // v35: HP-GL plot files learn their donut; custom claims stay put.+ if (from < 35)+ changed |= LearnExtensions(profiles, out _, ["plt", "hpgl", "hpg", "hgl"]);+ // v36: iCalendar (.ics, .ical) on the data donut, and "iCalendar" (CSV → ICS) after "vCard" on the back of the+ // spreadsheets donut when it has room; custom claims stay put.+ if (from < 36)+ {+ changed |= LearnExtensions(profiles, out _, ["ics", "ical"]);+ changed |= AddCalendarPreset(presets, profiles);+ }+ // v33: everyday tools (compress image / video / audio, video from images, extract audio, merge videos / audio,+ // remove metadata), after "Motion Photo (Android)" as in a new library, and on the back faces of the+ // built-in donuts before "One ZIP" where they have room and the user hasn't put them there already.+ // "Extract audio" replaces the plain M4A slice on the video donut's back.+ if (from < 33)+ changed |= AddMediaTools(presets, profiles);return changed;}+ private static bool AddCalendarPreset(List<Preset> presets, List<ToolbarProfile> profiles)+ {+ var changed = false;+ if (presets.All(p => p.Id != "to-ics"))+ {+ var preset = BuiltInData.DataPresets().Single(p => p.Id == "to-ics");+ var after = presets.FindIndex(p => p.Id == "to-vcf");+ presets.Insert(after < 0 ? presets.Count : after + 1, preset);+ changed = true;+ }++ if (profiles.FirstOrDefault(p => p.Id == "spreadsheets") is { BackPresetIds: { } back }+ && !back.Contains("to-ics") && back.Count < ToolbarProfile.MaxSlices)+ {+ var after = back.IndexOf("to-vcf");+ var beforeZip = back.IndexOf("zip-all");+ back.Insert(after >= 0 ? after + 1 : beforeZip >= 0 ? beforeZip : back.Count, "to-ics");+ changed = true;+ }+ return changed;+ }++ /// <summary>Where schema 33 offers its tools: (donut, presets for its back face).</summary>+ private static readonly (string Profile, string[] Presets)[] Version33Offers =+ [+ ("images", ["compress-image", "remove-metadata"]),+ ("pdf", ["remove-metadata"]),+ ("video", ["compress-video", "merge-videos", "extract-audio"]),+ ("audio", ["compress-audio", "merge-audio", "remove-metadata"]),+ ];++ private static bool AddMediaTools(List<Preset> presets, List<ToolbarProfile> profiles)+ {+ var changed = false;+ var at = presets.FindLastIndex(p => p.Id is "motion-photo-android" or "live-photo-iphone" or "extract-motion");+ at = at < 0 ? presets.Count : at + 1;+ foreach (var tool in BuiltInData.MediaToolPresets())+ {+ if (presets.Any(p => p.Id == tool.Id))+ continue;+ presets.Insert(Math.Min(at++, presets.Count), tool);+ changed = true;+ }+ foreach (var (profileId, ids) in Version33Offers)+ {+ if (profiles.FirstOrDefault(p => p.Id == profileId) is not { BackPresetIds: { } back } profile)+ continue;+ // "Extract audio" writes the same M4A as the plain M4A slice, copying the sound where it can: it takes that+ // slice's place on the video donut's back, or comes in with the other tools when there is room.+ if (profileId == "video" && !back.Contains("extract-audio") && !profile.PresetIds.Contains("extract-audio")+ && presets.Any(p => p.Id == "extract-audio"))+ {+ var m4a = back.IndexOf("to-m4a");+ if (m4a >= 0)+ {+ back[m4a] = "extract-audio";+ changed = true;+ }+ }+ foreach (var id in ids)+ {+ if (back.Contains(id) || profile.PresetIds.Contains(id) || back.Count >= ToolbarProfile.MaxSlices+ || presets.All(p => p.Id != id))+ continue;+ InsertBefore(back, id, "zip-all");+ changed = true;+ }+ }+ return changed;+ }+/// <summary>/// Gives each built-in donut without a back face (<see cref="ToolbarProfile.BackPresetIds"/> null) its default one,/// with only the presets in <paramref name="presets"/>. Donuts the user made are left fordiff --cc src/Filee.Engines/Media/MediaInfo.csindex 3f5fdde2,695397b8..862469f3--- a/src/Filee.Engines/Media/MediaInfo.cs+++ b/src/Filee.Engines/Media/MediaInfo.cs@@@ -71,12 -75,9 +75,13 @@@ internal sealed record AudioStreamInfo(/// <param name="Audio">First audio stream, if any.</param>/// <param name="CoverStreamIndex">Index of an embedded cover picture (JPEG or PNG) such as album art, if any.</param>/// <param name="SubtitleStreams">Every subtitle stream in file order, null when there is none.</param>+/// <param name="RawStream">+/// A bare H.264 / H.265 stream with no container (a camera's .h264 / .h265): its frames carry no timestamps, so it is+/// always encoded, never copied into a container.+/// </param>+ /// <param name="HasAttachments">The file carries attachments (an MKV's subtitle fonts).</param>internal sealed record MediaInfo(TimeSpan? Duration, VideoStreamInfo? Video, AudioStreamInfo? Audio, int? CoverStreamIndex,- IReadOnlyList<SubtitleStreamInfo>? SubtitleStreams = null, bool RawStream = false)- IReadOnlyList<SubtitleStreamInfo>? SubtitleStreams = null, bool HasAttachments = false)++ IReadOnlyList<SubtitleStreamInfo>? SubtitleStreams = null, bool RawStream = false, bool HasAttachments = false){/// <summary>Every subtitle stream, in file order.</summary>public IReadOnlyList<SubtitleStreamInfo> Subtitles => SubtitleStreams ?? [];@@@ -146,9 -152,8 +156,9 @@@var seconds = root.TryGetProperty("format", out var format) ? Number(format, "duration") : 0;if (seconds <= 0)seconds = longestStream;+ var raw = root.TryGetProperty("format", out var container) && Text(container, "format_name") is "h264" or "hevc";return new MediaInfo(seconds > 0 ? TimeSpan.FromSeconds(seconds) : null, video, audio, cover,- subtitles.Count > 0 ? subtitles : null, raw);- subtitles.Count > 0 ? subtitles : null, attachments);++ subtitles.Count > 0 ? subtitles : null, raw, attachments);}/// <summary>The colour tags of a video stream; null when it has none ("unknown" counts as none).</summary>