Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon Size Recognized as 0x0 on Linux #5294

Open
Hyperdraw opened this issue Sep 13, 2020 · 8 comments
Open

Icon Size Recognized as 0x0 on Linux #5294

Hyperdraw opened this issue Sep 13, 2020 · 8 comments
Labels

Comments

@Hyperdraw
Copy link

Hyperdraw commented Sep 13, 2020

  • electron builder 22.8.1:
  • electron 10.1.1:
  • current:
  • Linux Deb x64:

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
Copy link

stale bot commented Nov 13, 2020

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
Copy link

tmtron commented Jul 14, 2022

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
Copy link

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

@mmaietta
Copy link
Collaborator

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
Copy link

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

@mmaietta
Copy link
Collaborator

Sure

@ensonic
Copy link

ensonic commented Nov 3, 2024

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
Copy link
Collaborator

mmaietta commented Nov 3, 2024

I think we're dealing with this code here during icon resolution

// convert if need, validate size (it is a reason why tool is called even if file has target extension (already specified as foo.icns for example))
async resolveIcon(sources: Array<string>, fallbackSources: Array<string>, outputFormat: IconFormat): Promise<Array<IconInfo>> {
const output = this.expandMacro(this.config.directories!.output!)
const args = [
"icon",
"--format",
outputFormat,
"--root",
this.buildResourcesDir,
"--root",
this.projectDir,
"--out",
path.resolve(this.projectDir, output, `.icon-${outputFormat}`),
]
for (const source of sources) {
args.push("--input", source)
}
for (const source of fallbackSources) {
args.push("--fallback-input", source)
}
const result: IconConvertResult = await executeAppBuilderAsJson(args)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants