Repository navigation
fix(plugin): the GraalVM AppX gets its logos, at every scale and target size - #894
Merged
Merged
Conversation
…et size
packageGraalvmAppX never received the appx { } logos (only the JVM task did), and its
fallback, the Windows .ico, cannot be read by ImageIO: nothing was staged and the package
shipped electron-builder's sample logos, which the Microsoft Store rejects as generic.
- the GraalVM pipeline wires the four logos and the Linux PNG fallback, as the JVM one
- the fallback reads .ico files (their largest PNG or 32/24 bit bitmap entry)
- each logo is generated at scale-100 to 400 and the app icon at targetsize-16 to 256,
plated and unplated, so electron-builder indexes them in resources.pri and Windows picks
the one for the display instead of stretching a single 44 px image
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.
Problem
A GraalVM AppX (
packageGraalvmAppX) shipped electron-builder's sample logos (the Electron atom), and the Microsoft Store rejects it as a generic icon. Seen on Zayit's submission: theappx.mappingof electron-builder mapsSampleAppx.*.pngto everyassets\*Logo.png.configureGraalvmPlatformPackageSettingsnever set theappx { }logos on the task: only the JVM pipeline (configureElectronBuilderPackageTask) did..ico, whichImageIOcannot read; the Linux PNG was not wired on Windows for GraalVM. So nothing was staged inbuild/appx.Even with the logos wired, each one was a single unscaled image: Windows stretched the 44 px app icon for the taskbar and Start at high display scaling, on a plate.
Fix
readIconImagereads.icofiles: the largest entry, PNG or 32/24 bit bitmap (with its AND mask).AppXAssets.kt: each logo is generated atscale-100/125/150/200/400, and the app icon (Square44x44Logo) attargetsize-16/24/32/48/256, plated,altform-unplatedandaltform-lightunplated, as Visual Studio does. Only qualified names, so electron-builder runsmakepriand indexes them inresources.pri. A logo may now be an image of any size (≥ 4× recommended); a warning names the files a small source is enlarged for, and another when a logo falls back to electron-builder's sample.Verification
AppXAssetsTest(10 tests): file names and sizes, fitting on a transparent canvas, enlargement report, ICO PNG / 32 bit / 24 bit masked entries, invalid input.ktlintCheck,detektMain,ElectronBuilderPackageTaskInputsTestpass.packageGraalvmAppXof Zayit with this plugin (--include-build): the package carries the 35 assets,resources.priandresources.scale-*.pri, and the logos are Zayit's.