electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.71k stars 1.74k forks source link

Icon Size Recognized as 0x0 on Linux #5294

Open Hyperdraw opened 4 years ago

Hyperdraw commented 4 years ago

The icon file in the .deb generated by electron-builder is placed under /usr/share/icons/hicolor/0x0 (even if the file has the size in the name: 512x512.png), and thus not displayed properly by the desktop environment.

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

tmtron commented 2 years ago

I also had this issue, the electron build failed with ⨯ symlink usr/share/icons/hicolor/0x0/apps/RETACTED.png /home/RETACTED/shared-folder/dist/apps/RETACTED-executables/__appImage-x64/RETACTED.png: operation not supported

The build was started on Ubuntu 22.04 in a Hyper-V.
The issue was that I have accidentally started the build in the wrong folder: which was mounted as readonly from the windows host.

When we used the correct linux folder, the issue was gone (i..e copy the source files from the windows folder, install node modules, build everything, ..)

aaroncarlucci commented 1 year ago

This issue definitely seems like it should still be open... Could @mmaietta or someone from the team reconsider the stale / closed status?

mmaietta commented 1 year ago

Would love to have a community contribution on this. Setting up a local dev environment is fairly straight forward too https://github.com/electron-userland/electron-builder/blob/master/CONTRIBUTING.md#to-setup-a-local-dev-environment

aaroncarlucci commented 1 year ago

@mmaietta Sure, but are you willing to consider reopening the ticket status so both users and contributors know it's an active issue?

mmaietta commented 1 year ago

Sure

ensonic commented 2 weeks ago

Same issue happens for appimages. The have the icons referenced as '0x0'. As a result appimagelint complains that there is no valid icon and the desktop icon shows a fallback image. Code starting point seems to be https://github.com/electron-userland/electron-builder/blob/HEAD/packages/app-builder-lib/src/targets/LinuxTargetHelper.ts (and https://github.com/electron-userland/electron-builder/blob/HEAD/packages/app-builder-lib/src/targets/AppImageTarget.ts) but I have not yet found where it creates the package file structure / checks the the icons-sizes (did search for icon.png).

My theory is that the png size is checked, but the path is not correctly resolved (or the icons is smaller that the requested 512x512 and as a consequence it uses (0,0) (aka some error check is missing).

mmaietta commented 2 weeks ago

I think we're dealing with this code here during icon resolution https://github.com/electron-userland/electron-builder/blob/b06c5effd35051c6b953696aec90b68a67456bed/packages/app-builder-lib/src/platformPackager.ts#L770-L791 It's hard to track down errors with icon conversion though as it's happening in an upstream Golang binary https://github.com/develar/app-builder/blob/master/pkg/icons/icon-converter.go

Might be worth re-exporting your icon or trying to use a different format converter.