hhannine / superpaper

A cross-platform multi monitor wallpaper manager.
MIT License
1.14k stars 46 forks source link

Windows: Applying wallpaper just sets the background to black #48

Closed mcoolidge closed 4 years ago

mcoolidge commented 4 years ago

image

I've tried all different ways, but the background is always black when applying an image.

image

hhannine commented 4 years ago

This is on Windows 10 by the looks of it?

I've run into something similar on Win10 but it has happened only randomly, maybe with some specific problematic images. Have you tried with different source images?

Try turning on the logging in the settings and post the log file contents if there would be something in there?

mcoolidge commented 4 years ago

Yes with any of the images and windows 10. It seems to change the desktop to "Solid Color" for some reason. I am unable to open the settings. When I click it doesn't do anything. Is there a file I can edit?

hhannine commented 4 years ago

Ah yes I've made a commit to fix the settings panel since it was broken and its waiting for a new release.. Yes you can edit the general_settings file in the config directory in Appdata or the portable folder.

mcoolidge commented 4 years ago

Done. Where is the log file?

mcoolidge commented 4 years ago

Never mind I found it.

mcoolidge commented 4 years ago

Here are the steps:

  1. Close superpaper.
  2. Change background setting in windows to random picture
  3. Open super paper.
  4. The background is now a solid color and the settings changed in the windows UI.
  5. Select profile (none were selected)
  6. Click apply (cursor changes to show its processing)
  7. Nothing happens.

log.txt

hhannine commented 4 years ago

Unfortunately there doesn't seem to be anything in the log that would help. Would you test a couple of things:

  1. Does the align test function do anything/change the wallpaper?
  2. Does the wallpaper change if you rename the image file to something simple like 'a.png' (or whatever the type is) and place it in the root directory C:\?
  3. What is the background fit style in Windows 10 personalisation settings?
hhannine commented 4 years ago

I've now discovered that the problematic samples that I have make the desktop black even if I set them as the background from the explorer context menu! I've no idea why this is the case.

Could you try some more images from different sources?

mcoolidge commented 4 years ago

I tried a few different ones, all of which work if I select them from explorer. Windows background fit is fill.

I don't see a test function?

hhannine commented 4 years ago

I just now realized that the problem arises with the temporary image created with the Pillow image library and the original image does indeed work from the explorer..

The align test feature is available in the advanced span mode in the lower left corner.

hhannine commented 4 years ago

Would you test two more things:

  1. Does the wallpaper become black if you navigate to the temp folder and try to set one of the temp images as the background from Explorer?

  2. Replace one of the temp images with a copy of the original source image and give it the name of the temp image. Then try to apply that profile from superpaper. Does the wallpaper become black or does the image show up at least temporarily?

mcoolidge commented 4 years ago
  1. Yes
  2. Yes it works temporarily

It does seem like something in the conversion is corrupting the file and it makes windows choke. I assume windows defaults to the solid color when that happens.

hhannine commented 4 years ago

Thanks a lot for testing, this helps narrowing it down quite tremendously.

Yeah it would seem that it's an issue with the conversion and not really related to anything that superpaper is doing, at least I'm hoping.

mcoolidge commented 4 years ago

No problem! Let me know if there is something I can test.

hhannine commented 4 years ago

I've now narrowed it down that just with simply opening and saving an affected image with

from PIL import Image

img = Image.open("a.jpg")
img.save("a2png.png", "PNG")

causes the Windows wallpaper application to fail. Original jpg can be set as background from Explorer but the "a2png.png" cannot, wallpaper will go black.

hhannine commented 4 years ago

I think it's this asinine limitation we're hitting: https://superuser.com/questions/1110432/how-to-remove-the-25mb-file-size-limit-on-png-desktop-wallpaper-for-windows-10

mcoolidge commented 4 years ago

Whats strange is the source file is over 25MB and works fine, but the converted one does not and its actually smaller.

hhannine commented 4 years ago

What are the sizes and what if the type of the source image?

mcoolidge commented 4 years ago

Source: jpg 29,199 KB converted: png 28,406KB

hhannine commented 4 years ago

Wonderful! It is my understanding that the ~~25Mb limitation does not apply to JPGs, which would fit your scenario.

hhannine commented 4 years ago

I just released a new version that hopefully fixes this, would you try it?

mcoolidge commented 4 years ago

Looks good! Settings are also working now and setting wallpaper works.

Is the preview not supposed to update until you hit apply?

hhannine commented 4 years ago

Superb! Thanks a lot for helping to get this sorted out; without the clue that it failed 100% of the time on 2x4K displays I don't know if I ever would've figured this out, and it would've kept bothering me..

Yes the preview currently is updated only when saving the profile or when the profile is applied.