Skip to content

Fix #328, #301, #332, #345: HAR, raw H.265 / H.264, trim transparent borders, Arabic in .xls - #351

Merged
KnifeLemon merged 8 commits into
KnifeLemon:mainfrom
cre8ive-marketing:fix/issues-batch-1
Oct 23, 2026
Merged

KnifeLemon merged 8 commits into
KnifeLemon:mainfrom
cre8ive-marketing:fix/issues-batch-1

Conversation

@cre8ive-marketing

@cre8ive-marketing cre8ive-marketing commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

What does this change?

Fixes for four open issues, smallest first. Each is its own commit with tests.

Issue What changes
#328 .har HAR is a read-only data format. It is read like JSON for JSON / YAML / TOML / XML / JSON Lines, and as one table row per request (started, method, URL, status, time, size, type) for CSV, so spreadsheets, Markdown, HTML and PDF follow through the table routes. Renaming to .json didn't get there: the table writer refuses HAR's nesting ("entries holds a list").
#301 .h265 .h265 / .265 / .hevc and .h264 / .264 are read-only video formats. FFmpeg reports them as format hevc / h264 (MediaInfo.RawStream). They are always encoded, never copied: their frames carry no timestamps, and a stream copy into MP4 failed to decode ("non monotonically increasing dts").
#332 Trim Trim transparent borders, a new image preset. It saves a copy cropped to the pixels that aren't fully transparent, as name_trimmed in the same format, and never overwrites the source. Only alpha counts: ImageMagick's Trim() trims the corners' colour, which cuts into content that touches a corner. Pictures without transparency, fully transparent ones and multi-frame animations stay as they are (a shortcut: comment marks the animation case). It sits on the images donut's back face after Remove background.
#345 Arabic 2.0.0 already keeps .xlsx / .ods sheets with Arabic away from rhwp. The binary .xls was skipped by that check (ComplexScripts), so an Arabic .xls still reached PDF through rhwp, unshaped. Its cells are now read with the built-in XLS reader.

Settings schema 33 teaches existing donuts the new extensions and adds the trim preset. #349 also uses 33. Whichever PR merges second needs its step renumbered to 34. Happy to do that.

How was it tested?

  • dotnet format --verify-no-changes
  • dotnet test: all pass with FFmpeg 9.0.2 and rhwp 0.8.7 installed: Core 463, App 767, Engines 1453, Setup 134, Cli 27, Platform 48 (0 failed).
  • New tests:
    • NewExtensionsTests: detection, read-only formats, the schema 33 upgrade, custom claims kept.
    • NewExtensionsRealTests, with FFmpeg 9.0.2:
      • raw .h265 → AVI and MP4, and .264 → MP4: right size and duration, decode with no errors
      • .har → a Markdown table row and → JSON
      • a pure test that a raw stream is never copied
    • TrimTransparentTests: PNG and WebP padding removed with no page offset left, a corner-touching picture keeps its content, a 2-frame GIF stays aligned, opaque and empty pictures are untouched.
    • ArabicSheetTests, with rhwp: Arabic found in .xlsx and .xls, and both refused with error.needs_shaping without LibreOffice. Before the fix the .xls one was converted, unshaped.
  • Not checked: the right-to-left layout of an Arabic sheet through LibreOffice (not installed on this PC).

Screenshots (UI changes)

One new preset, "Trim transparent borders", on the images donut's back face. No other UI changes.

Checklist

  • New UI strings are in all src/Filee.App/Assets/i18n/*.json files (preset.trim_transparent, 10 languages)
  • New third-party code or binaries are listed in THIRD-PARTY-NOTICES.md (none)

Fixes #328.
Addresses #301 (raw streams; a recorder that writes its own container under .h265 still needs the sample asked for there), #332 (as name_trimmed, not in place; the question asked there is still open), and #345 (the .xls case; .xlsx was handled in 2.0.0).

cre8ive-marketing and others added 3 commits October 21, 2026 17:32
…n#328, KnifeLemon#301)

- .har (HTTP Archive) is its own read-only data format: read as JSON for
  JSON, YAML, TOML, XML and JSON Lines, and as one table row per request
  (started, method, URL, status, time, size, type) for CSV, so spreadsheets,
  Markdown, HTML and PDF follow through the table routes. Renaming to .json
  did not work for those: the table writer refused HAR's nesting.
- .h265 / .265 / .hevc and .h264 / .264 are read-only video formats. FFmpeg
  reports such files as format "hevc" / "h264" (MediaInfo.RawStream); they
  are always encoded, never copied, because their frames carry no
  timestamps and a copy into MP4 had non-monotonic DTS.
- Settings schema 33 teaches existing donuts the new extensions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A copy cropped to the box around the pixels that aren't fully transparent
(name_trimmed, same format; the source is never overwritten). Only alpha
counts: ImageMagick's Trim trims the corners' colour, so a picture whose
content touches a corner would lose a solid border. Pictures without
transparency, fully transparent ones and multi-frame animations stay as
they are. On the images donut's back face after "Remove background"; the
schema 33 upgrade adds it there when it has room.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
)

Excel 97-2003 files are binary, so the check that keeps text needing
shaping away from rhwp (ComplexScripts) skipped them: an Arabic .xls went
to PDF through rhwp, letters unjoined and left to right. Its cells are now
read with the built-in XLS reader, so such a sheet goes to LibreOffice or
is refused with the reason, as .xlsx and .ods already were since 2.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KnifeLemon

Copy link
Copy Markdown
Owner

Thanks a lot, @cre8ive-marketing, four issues in one tidy PR, each with its own commit and tests. I ran it locally (format, build, Core 462, the related engine tests 169 with FFmpeg 9.0.2 and rhwp, App 96). I also checked raw .h264 at 30 fps and .h265 at 15 fps → MP4: frame counts and durations come out right.

We’d like to merge it first among the PRs that add a settings migration, so it keeps schema 33. We’ll make a few small changes on your branch before merging, so nothing is needed from you unless you’d rather do them:

  1. Trim on pictures without transparency: on a JPG it writes photo_trimmed.jpg, a re-encoded copy of the same picture (smaller, with one more generation of JPEG loss). We’ll either grey the preset out for formats that can’t hold alpha or skip writing when there’s nothing to trim.
  2. The .xls branch in ComplexScripts.FindInFile sits between the “Web archives and mail are MIME” comment and its if, so we’ll move the comment back to its block.
  3. We’ll replace the // shortcut: marker with a plain comment, since the repository doesn’t use that convention.
  4. One line each in docs/ENGINES.md for HAR, raw H.264/H.265 (including that a stream without timing info is read at FFmpeg’s default 25 fps) and Trim.

About #332: the requester asked for in-place by default. We’ll keep your name_trimmed copy as the default, which is the safe choice, and answer there.

CI for fork runs is waiting for approval; we’ll start it with our changes. Thanks again!

…lain comment, docs, all 12 languages

Trim transparent borders is greyed out for JPG and other formats without alpha, and a JPG in a mixed selection fails with that reason instead of being re-encoded (ImageEncoder.HoldsAlpha). The shortcut marker is a plain comment. docs/ENGINES.md gets HAR, raw H.264 / H.265 (read at FFmpeg's default 25 fps without timing info) and Trim. fr and zh-TW, added to main since, get the preset's name.
@cre8ive-marketing

Copy link
Copy Markdown
Collaborator Author

@KnifeLemon Thanks for the review. Since #332 and #345 are now assigned to me, I made the four changes on the branch myself, so you don't need to:

  1. Trim on pictures without transparency (Feature request: trim transparent borders of PNG images (single & batch, in-place) #332): both options together.
    • The preset is greyed out when every selected file is in a format that can't be transparent (JPG, HEIC, PPM, … — the existing ImageEncoder.NoAlpha list, through a new ImageEncoder.HoldsAlpha, checked in PresetAvailability).
    • A JPG in a mixed selection (PNG + JPG) fails with the reason "This format has no transparency, so there's nothing to trim" (error.no_transparency), instead of writing photo_trimmed.jpg with one more JPEG generation.
    • I didn't skip writing silently, because a skipped file's toast says "Skipped (file exists)", which would be wrong here.
  2. ComplexScripts.FindInFile: the MIME comment is back with its if. The .xls branch now has only its own comment (Arabic issue #345).
  3. // shortcut: is now a plain comment.
  4. docs/ENGINES.md: one entry each:
    • HAR, in the Data table;
    • raw H.264 / H.265, in the FFmpeg section, including that a stream without timing info is read at FFmpeg's default 25 fps;
    • Trim transparent borders, under Images.

Also:

  • I merged main into the branch (no conflicts). fr.json and zh-TW.json were added after the branch was made and lacked preset.trim_transparent; both now have it, and the new error string is in all 12 languages.
  • The default stays name_trimmed (a copy), as you decided. Nothing else changed, and the settings schema stays 33.

Tests:

  • New: TrimTransparentTests.A_jpg_has_nothing_to_trim_and_is_not_re_encoded (the job fails with error.no_transparency and only photo.jpg is in the folder).
  • dotnet format --verify-no-changes is clean; full dotnet test with FFmpeg 9.0.2 and rhwp 0.8.7: Platform 48, Core 463, Cli 27, Setup 145, Engines 1474 pass; App 806 pass and 1 fails, SingleInstanceTests.Arguments_reach_a_first_instance_that_starts_listening_late, a timing test under the full run's load, which passes 3/3 alone and isn't touched here.

HAR to Markdown goes through Unhwp, which Linux ARM64 lacks, so the portable linux-arm64 job found no route. CSV is the table step every table route starts from.
@flexeykinDev flexeykinDev mentioned this pull request Oct 22, 2026
5 tasks done
- The .xls branch of ComplexScripts.FindInFile takes the scan's classifier, so old Excel files are also checked for
  words rhwp has no widths for (KnifeLemon#378), with a test.
- Nepali strings for the trim preset and its error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KnifeLemon
KnifeLemon merged commit 9d0e035 into KnifeLemon:main Oct 23, 2026
9 checks passed
KnifeLemon added a commit to cre8ive-marketing/Filee that referenced this pull request Oct 23, 2026
Main took settings schema 33 for KnifeLemon#351, so the Lua / CSS text-donut step becomes v34
after it, AppSettings.CurrentSchemaVersion goes to 34 and the migration test starts
from 33. KnifeLemon#393 adds no UI strings; all 13 language files already match en.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features formats New formats and engines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Format request: .har

2 participants