Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Disable cover re-sizing if image is smaller than the requested resolut (Read 2057 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Disable cover re-sizing if image is smaller than the requested resolut

Hey everyone! First post here.

I will try to explain this with pictures:


This is how my player looks like.


This is what happens when there's no higher resolution art available.


This is what I want foobar to do in such cases. I added borders to this one through gimp.

Do you guys think it is possible? I've searched all over, but there doesn't seem to be an option for this.
I'm on Columns UI, if you need more information please let me know.
Thanks for your time all.

PS: Ran out of title space

Disable cover re-sizing if image is smaller than the requested resolut

Reply #1
this is possible with the WSH panel mod component and a script i've made. first read this setup guide carefully: http://marc2003.x10host.com/setup

the script you want to use is named artreader.txt

by default, it doesn't do what you want but you can easily change it. with the editor open, look for this on line 19...

Code: [Select]
function on_paint(gr) {
    p.draw_background(gr);
    a.draw(gr);
}


replace it with...

Code: [Select]
function on_paint(gr) {
    p.draw_background(gr);
    if (a.img && a.img.Width < p.w && a.img.Height < p.h) {
        p.draw_image(gr, a.img, Math.round((p.w - a.img.Width) / 2), Math.round((p.h - a.img.Height) / 2), a.img.Width, a.img.Height, "centre");
    } else {
        a.draw(gr);
    }
}

Disable cover re-sizing if image is smaller than the requested resolut

Reply #2
this is possible with the WSH panel mod component and a script i've made. first read this setup guide carefully: http://marc2003.x10host.com/setup

the script you want to use is named artreader.txt

by default, it doesn't do what you want but you can easily change it. with the editor open, look for this on line 19...

Code: [Select]
function on_paint(gr) {
    p.draw_background(gr);
    a.draw(gr);
}


replace it with...

Code: [Select]
function on_paint(gr) {
    p.draw_background(gr);
    if (a.img && a.img.Width < p.w && a.img.Height < p.h) {
        p.draw_image(gr, a.img, Math.round((p.w - a.img.Width) / 2), Math.round((p.h - a.img.Height) / 2), a.img.Width, a.img.Height, "centre");
    } else {
        a.draw(gr);
    }
}


Done

However...



This works as an independent panel, and I don't quite know how to reproduce the filter results panel. Is there any way to edit the filter results panel? If not, I'll have to find a way to make this work.

Thank you very much for your help!

Disable cover re-sizing if image is smaller than the requested resolut

Reply #3
it doesn't have to look like that - it can go anywhere! file>preferences>display>columns UI>layout tab. you can remove the default artwork panel and put the WSH panel there instead. as for filters, you can customise those on the filters tab.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #4
Sorry, I think I meant I can't reproduce the "NG Playlist", nor edit it. It only allows me to choose whether I want to display artwork or not. Should I scratch this playlist?

Disable cover re-sizing if image is smaller than the requested resolut

Reply #5
sorry, i didn't realise your original screenshot was actually of the album art as part of the playlist. i don't think i've seen anybody with it set so big.

you can either:

a) put the WSH panel to the left of the playlist and resize the art column in the playlist to something much smaller. this means you can see the main image for what is playing but still see artwork for albums if you're scrolling through it.

b) disable artwork in the playlist and just use the panel.

there is no way to fix your problem in the playlist itself.

edit: an example of a)


Disable cover re-sizing if image is smaller than the requested resolut

Reply #6
sorry, i didn't realise your original screenshot was actually of the album art as part of the playlist. i don't think i've seen anybody with it set so big.

you can either:

a) put the WSH panel to the left of the playlist and resize the art column in the playlist to something much smaller. this means you can see the main image for what is playing but still see artwork for albums if you're scrolling through it.

b) disable artwork in the playlist and just use the panel.

there is no way to fix your problem in the playlist itself.


Thanks, you've been very helpful.

Nice site btw

edit:


1400x artwork




Awesome.

Thanks again m8

Disable cover re-sizing if image is smaller than the requested resolut

Reply #7
I don't want to be a pain in the tush, but the plugin is reading the smaller embedded files when there's a bigger folder.jpg available. marc2003, please rescue me again!

Disable cover re-sizing if image is smaller than the requested resolut

Reply #8
look at file>preferences>advanced>display>album art>embedded vs external.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #9
look at file>preferences>advanced>display>album art>embedded vs external.


Silly me, I hadn't hit "refresh" once I changed that, so I was seeing no changes. A million thanks!

edit: Just a friendly suggestion: you may want to look into the issue, since "Prefer Larger" is actually not working correctly for this plugin.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #10
i wouldn't rely on what i see in columns UI to troubleshoot this. switch to default UI and put my panel side by side with the default artwork view and see if they display different images. i'm really expecting they won't.

if they do display the same images but you believe the advanced settings are not being obeyed then i think the problem would be with how foobar is deciding which image is larger.

edit: just to be clear, it's not something i have any control over. i use a function to get an image for the chosen type (front/artist/etc) and it displays what it's given.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #11
You're right, it is a foobar problem (maybe columns UI, couldn't figure how to do this test in the default interface):



The folder.jpg I have for this one is larger than what is shown in the player, and the NG playlist artwork is the same small image expanded. The artwork reader is not doing it's job properly! Should this be reported somewhere?

edit: The issue with this is that sometimes, there may be a "folder.jpg" file present in your music folder which is smaller than embedded ones, so "prefer external" is not an ideal solution.

I've also noticed that the "prefer larger" option DOES work when the embedded image is small (tested with 200x200), but changing every album's embedded file is not really an option.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #12
if you're only looking for one filename (for example, folder.jpg), i can actually totally ignore the foobar preferences. i can get embedded art and folder.jpg, compare the 2 in purely size terms and use the biggest.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #13
if you're only looking for one filename (for example, folder.jpg), i can actually totally ignore the foobar preferences. i can get embedded art and folder.jpg, compare the 2 in purely size terms and use the biggest.


So folder.png, or cover.jpg wouldn't get a chance? I think I can roll with what you're offering though. (If you can at least include folder.png you'd be god and the issue would be 99% solved)

Disable cover re-sizing if image is smaller than the requested resolut

Reply #14
i've not really tested it much but you can try this. in the editor, replace

Code: [Select]
function on_metadb_changed() {
    a.metadb_changed();
}

with

Code: [Select]
function on_metadb_changed() {
if (!p.metadb) return;
if (a.id != 0) return a.metadb_changed();
var embed_img = utils.GetAlbumArtEmbedded(p.metadb.RawPath, 0);
if (!embed_img) return a.metadb_changed();
a.img && a.img.Dispose();
a.path = "";
var folder = tf("$directory_path(%path%)\\", p.metadb);
var big_img = embed_img;
var big_path = p.metadb.Path;
var images = [];
images = images.concat(utils.Glob(folder + "folder.*").toArray(), utils.Glob(folder + "cover.*").toArray());
for (var i in images) {
var temp_img = gdi.Image(images[i]);
if (temp_img.Width > big_img.Width && temp_img.Height > big_img.Height) {
big_img = temp_img;
big_path = images[i];
}
}
a.img = big_img;
a.path = big_path;
window.RepaintRect(a.x, a.y, a.w, a.h);
}

edited to fix small typo.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #15


Hot damn! Thank you so much dude, finally I can watch my covers in peace, knowing they're gonna be big as shit. I'm forever indebted to you.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #16
With "Prefer larger," larger refers to the image's size, not its dimensions.

foobar is working correctly. The 500x500 embedded art is 441 KB while the 950x950 external art is 251 KB.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #17
With "Prefer larger," larger refers to the image's size, not its dimensions.

foobar is working correctly. The 500x500 embedded art is 441 KB while the 950x950 external art is 251 KB.


Dang, you're right. I'm glad I don't have to worry about that anymore though. Looking forward for a "Prefer size/dimensions" toggle.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #18
With "Prefer larger," larger refers to the image's size, not its dimensions.


now you mention it, i do have vague recollections of this being discussed before. unfortunately, i forgot about it.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #19
The current "Prefer larger" by size is actually faster for the player to process, since it doesn't actually have to decode the image. Of course, I don't expect user interfaces to load artwork at such a pace that actually decoding multiple images per image would slow it down much, so long as it caches the dimensions and modification timestamp of all of the image candidates.

Disable cover re-sizing if image is smaller than the requested resolut

Reply #20
Marc, what would be code for  thumbs?