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 returns empty PNG #8767
Comments
@karacas what is the value of |
console.log(err) // null |
@karacas can you include the path you are specifying to |
i try all options \, / , nomalice... direct nativeImage works well
|
@YurySolovyov would you be able to take a look into this? I'm able to reproduce on Windows 10 with running the following from the dev tools: require('electron').remote.app.getFileIcon(__filename, (err, icon) => console.log(icon.toDataURL())) |
|
|
This might be more of an issue with the |
Also, can you try writing the buffer to file and opening it in some image viewer? |
|
@karacas can you also attach |
@karacas I was able to get the icon using the API, but you probably need to call @kevinsawicki should we fix this in API, or just note in the docs? |
I think the API, what was the difference between the two paths? |
I think ATM we only do separators conversion, but really, we should call |
@YurySolovyov my prj needs absolute paths.
Anyway i will try path.resolve |
Meaning you do get expected icon and all that, right? Makes me think it fails to decode png on that other machine for some reason. |
yes, in second machine works fine. |
i can convert data from res.toBitmap() with https://gist.github.com/vukicevic/8112515 and works well:
Electron app for test: Example code:
|
Looks like this happens when the DPI scale is non-1. The image is loaded with the machine's DPI scale here, electron/chromium_src/chrome/browser/icon_loader_win.cc Lines 61 to 62 in 9547ff1
But
So this probably works on any machine with 1x scale, but fails on others. |
The text was updated successfully, but these errors were encountered: