Repository navigation
feat(image): read the icon of Windows programs and libraries (.exe, .dll) - #1357
Merged
Merged
Conversation
A dropped .exe or .dll is read as the icon Explorer shows for it: the first RT_GROUP_ICON of its resources, put back together as an .ico in memory by Filee's own PE reader (ProgramIcon). Only the headers and the icon are read; the file is never loaded or run. - ICO is the icon as the program stores it, every size it has, unless the preset changes the picture or asks for other icon sizes; PNG and every other picture target use the largest size. - No icon of its own and unreadable/16-bit/damaged files give translated errors (error.exe_no_icon, error.exe_unreadable) in all 22 languages. - Programs are converted only when dropped or named: watch folders and CLI folder inputs skip them, and Recent conversions never opens one. - Settings schema 77: the images donut learns exe and dll; custom claims stay put. (Schema 77 may be renumbered if another change takes it first.) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1355 took schema 77 for .osm. The images donut now learns exe and dll in schema 78; FormatFieldsTests counts include both new formats. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What users notice
.exe,.dll) dropped on Filee opens the images donut and converts to its icon: the one Explorer shows for the file..exestay refused as before.What changed
src/Filee.Engines/Magick/ProgramIcon.cs(new): PE32/PE32+ reader that finds the firstRT_GROUP_ICON(the icon Explorer shows) and rebuilds an.icofrom itsRT_ICONentries, with random-access reads and caps (16 MB per size, 64 MB per icon, 16,384 directory entries).ImageReader/ImageEncoder:exeis a package like LIVP and KRA (read as the ICO inside it, largest size converted).MagickImageConverter: program → ICO copies the icon as it is when the preset leaves the picture alone (ProgramIcon.KeptAsItIs).FormatRegistry: new formatexe("Windows program icon (EXE, DLL)", Image, read only) plusFormatRegistry.Program/IsProgram.FormatFields: graded general, image field.exeanddll; custom claims stay put.FolderWatcher.ShouldIgnore,Cli.ExpandInputs,HistoryItemViewModel.CanOpen(HomePageViewModel.cs): leave programs out as described above.error.exe_unreadable,error.exe_no_iconin all 22 files.docs/ENGINES.md: ImageMagick row and an EXE / DLL paragraph.Tests
tests/Filee.Engines.Tests/ProgramIconTests.cs(new): builds 32 and 64-bit programs and a DLL in the test (MZ/PE headers, one.rsrcsection, the resource tree), with icons made by ImageMagick (BMP sizes plus a PNG 256 px size). Covers: PNG of the largest size, ICO byte-identical to the embedded icon, other icon sizes rebuilt from the largest, first group taken, a missing size left out, no icon, cut-short / not-a-program / 16-bit / too-short files.tests/Filee.Core.Tests/ProgramFormatTests.cs(new): detection, images donut, schema 77 → 78 migration without taking custom claims.FolderWatcherTestsandCliTestsgained a program case;FormatFieldsTestscount updated.Filee.Core.Tests(all pass),Filee.Cli.Tests(all pass exceptZip_to_iso_converts_archive_contents_without_manual_extraction, which fails the same way onmainhere: no 7-Zip in a fresh worktree), the Magick/route/tracing/3D/Krita/ICNS slice ofFilee.Engines.Tests(onlyFolderIso632Tests.Archive_to_iso_uses_a_direct_archive_route_without_enabling_unrelated_inputsfails, also onmain), and App localization/recent-conversion/toolbar tests.explorer.exe,regedit.exe,dotnet.exe, 32-bitnotepad.exegive their full icon (8 to 13 sizes) and a 256 px PNG;kernel32.dllandSystem32\imageres.dll(icons moved to the.munfile on Windows 11) say they have no icon.Not covered / for the maintainer
.mun,.scr,.cpl,.ocxand 16-bit (NE) programs aren't recognised.imageres.dll).Closes #1188
Also answers #1314 (the same request, filed later); it is left open for the maintainer to close.
🤖 Generated with Claude Code