nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.28k stars 3.88k forks source link

NWJS adds undesired dark border or shadow to app icon #4616

Open Yonezpt opened 8 years ago

Yonezpt commented 8 years ago

Original icon file (it is a 256x256 white dot with transparency around it to show the problem with accuracy, the original below shouldn't be able to be seen with GitHub's white background):

icon

One of the resulting icon examples (128x128) created by NWJS, notice the dark border around the icon:

128

All the other sizes (except original size) also have the same problem. This dark border should not be added to the icon when converting the image to .ico

The problem is present for any image I use as icon in package.json "window": {"icon": "icon.png"} I also tried using a .ico file but it wouldn't work.

NWJS: v.0.13.0 SDK OS: Win7x64

rogerwang commented 8 years ago

Where did you see the "resulting icon examples (128x128) created by NWJS"? Is it on the taskbar or somewhere else?

Yonezpt commented 8 years ago

The one it loads in the taskbar does have the dark border as well and the one on the tray. The resulting icons converted by NWJS are located in the AppData\Local\\User Data\Default\Web Applications\

They are all contained in the single .ico file located in that place, which contains 13 different of the same icon in different sizes. All of them have the dark border added to them except the one with the original size.

Yonezpt commented 8 years ago

After some code inspection this issue might be caused by chromium since I cannot find any possible relation in NWJS's source code to icon conversion.

With the inability to set custom sizes directly via the manifest in NWJS, working around this problem might be a challenge since we appear to be restricted to just one icon size. Is there any way to solve this problem?

Yonezpt commented 8 years ago

Can't replicated in Chrome's package app, the icon displays without border, so this issue appears to be related to NWJS. Latest 0.14.0rc3 version still has the same issue as well.

Christywl commented 7 years ago

@Yonezpt , I use your original icon(256x256) in my manifest.json. Chrome App icon also has the black border.

{
  "manifest_version": 2,
  "name": "ChromeIcon",
  "version": "1",
  "icons": {
    "256": "256_256.png"
  },
  "permissions": [],
  "app": {
    "background": {
      "scripts": ["background.js"]
    }
  },
  "minimum_chrome_version": "28"
}

Chrome App: AppData\Local\Google\Chrome\User Data\Default\Web Applications\_crx_akmjpelahcmmolocmhkgjnoikaankijl\ChromeIcon.ico has the black border. nwjs v0.22.0: AppData\Local\NWIcon\User Data\Default\Web Applications\_crx_hanjfjfanpogipjgijjeknpmobookbcb\NWIcon.ico also has the black border.

Or could you please share your tests for me to double check on Chrome?