Ottodix / Eole-foobar-theme

Eole blows gently into your ear his nicest melodies.
1.29k stars 85 forks source link

Black outline on the cover #285

Closed kcoure closed 4 months ago

kcoure commented 4 months ago

Hey. Sorry, if I'm opening too many issues lately.

I notice that almost always when foobar starts up, the covers have a black outline. When I refresh the image via "Refresh this image" it disappears and no longer appears in this session, but as soon as I restart it's there again. What could be the problem?

image image

I've tried removing the cover art from the file itself, but it doesn't help. Doesn't matter if it's external or internal. Here are the settings I use for Covers & Memory Usage, but changing them doesn't help, I've tried different values. I've also tried turning off the shadow under the cover, but it doesn't help either.

image

Thank you.

JadeTank commented 4 months ago

Almost wish you never posted this, will never be able to unsee it now 😭. I will try to fix it if I can, but I don't fully understand the cover system so I don't know how far I'll get.

From what I can tell, the issue doesn't seem to be with the display itself, but rather with how the cover cache is being saved. If you navigate to the eole cover cache at foobar2000\profile\wsh-data\eole-img-cache, you can see that the 1px border on the top and left side is actually part of the image, and isn't actually a black outline but differs depending on the album. When you refresh it, it still saves the image with the border but displays the original album cover, which is why it reappears on a restart.

kcoure commented 4 months ago

Great, thank you. I'll be looking forward to updates :)

Ottodix commented 4 months ago

Hi,

The fix is to change the InterpolationMode of the resize function, in JStheme_common.js, inside the function named formatCover(), line 2892 & 2894. The interpolation mode is saved in a var named globalProperties.ResizeQLY, defined line 66 of this same file.

And the corresponding flags are as below : const InterpolationMode = { Invalid: -1, Default: 0, LowQuality: 1, HighQuality: 2, Bilinear: 3, Bicubic: 4, NearestNeighbor: 5, HighQualityBilinear: 6, HighQualityBicubic: 7 };

And the doc is there: https://learn.microsoft.com/fr-fr/windows/win32/api/gdiplusenums/ne-gdiplusenums-interpolationmode?redirectedfrom=MSDN

The question is to find the right balance between quality and speed. I guess it would be ok to use a good resizing algorithm when the cover is saved in Eole cache as a file, because it is done only once, and a faster one when the cover is resized everywhere else on the skin. It would be doable by adding a new argument to the formatCover function. I'll try to take a look at that

Ottodix commented 4 months ago

I just pushed a fix https://github.com/Ottodix/Eole-foobar-theme/commit/15e33ad80ab3d3a67cd64e9f6a671aa047acc7be The nice thing is that it may speed up the scrolling of the library, because the resizing algorithm used there is now a little bit faster. Maybe the quality will be a little bit less good, maybe it won't be noticeable, I dont know

JadeTank commented 4 months ago

Great, thank you! I figured it had to do something with the resizing of the images when being saved