-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
app.getFileIcon() does not return the expected file icon #15809
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines. |
This is expected behavior, |
GitHub issues are for feature requests and bug reports, questions about using Electron or code assistance requests should be directed to the community or to the Slack Channel. |
I think this should be reopened.
Not to @oliverschwendener, it seems, and not to me either.
That description of the current behavior explains exactly why the current behavior should not be expected. As acknowledged in the description, a file and a file type are not the same thing. A file is a specific thing, which can and often does have its own icon apart from any file type icon. As the name of the method in question is For a method named
As mentioned above, in the case of #2, #3, and #4 I think there should be some way for developers to tell that fallback icons are being used.
"app.getFileIcon() does not return the expected file icon" looks like a bug report to me. If that is rejected as a bug report then how about "Please enable app.getFileIcon to get file icons instead of only file type icons" as a feature request? |
@MarshallOfSound Not true. On Windows, it returns a valid app icon using .exe path, but on macOS not. I think it should be considered as a bug report. |
+1 |
This is still a valid bug on electron v6.0.12, since on Windows I'm getting a real application icon just fine, and on macOS it's just giving back a same generic icon for all the apps. Looks like this should be a bug for chromium, since electron is just using it's API, but that might never get fixed. |
I would also like this. It's really hard to get app icons otherwise. You have to do a bunch of hacking with NodObjC and ICNS parsing which makes an Electron app prone to native crashes. |
@MarshallOfSound This is not a question about using Electron. This is a feature request. Please consider reopening this issue. In my opinion |
This is indeed either a bug or an unfortunate name for the method. |
@MarshallOfSound So I guess this is solved now with |
I'm trying to get the native file icons on macOS and Windows. When I use
app.getFileIcon()
I don't get the expected icons. For example on macOS (using TypeScript):What I expected:
What I got:
I tried using other 3rd party libraries to extract the native icons
but the problems I ran into were:
I read this conversation and saw that I have to
normalize
the file path but it didn't help. Is there a way to optimize this API to get the file icon the operating system's file browser displays? And maybe also support icons lager than 32x32?Info
Cheers
The text was updated successfully, but these errors were encountered: