occivink / mpv-gallery-view

Gallery-view scripts for mpv
The Unlicense
189 stars 20 forks source link

Windows 8.1 - Thumbnails Improperly Displayed #10

Closed Stannks closed 5 years ago

Stannks commented 5 years ago

Not sure if this is a known issue or not, but when I open the gallery with g, it generates thumbnails for all files in a playlist because evidently the files are in mpv/gallery-thumbs-dir. But in the gallery, the thumbnails just turn to the color of the gallery's background color.

I am running Windows 8.1 so I tested it on a new Windows 10 vm and everything works as expected. So I'm not sure if it's a quick fix with something I'm lacking due to running 8.1 or if it's just not supported for 8.1.

I get that this isn't really a big issue seeing it seems as though I'm the only one experiencing it. But any help would be greatly appreciated.

occivink commented 5 years ago

That sounds strange, I cannot imagine why it would work on windows 10 and not 8. If you launch mpv from the console, can you see any error being printed?

Stannks commented 5 years ago

Wow, I'm not sure how I did not include that, my bad.

[input] The overlay-add option must be an integer: *myname*\AppData\Roaming\mpv\
gallery-thumbs-dir/a6d53a50f7c2_192_108
[input] Command overlay-add: argument 5 can't be parsed: option parameter could
not be parsed.
[input] Command was defined at gallery.

The above is what is printed for every thumbnail file in mpv/gallery-thumbs-dir. That is in the current playlist I presume.

occivink commented 5 years ago

That's very surprising, especially since argument 5 of overlay-add is hardcoded to 0. Can you make sure you're using the latest release of mpv and that the script is up-to-date? If it still occurs, replace mp.command at line 637 with msg.warn and tell me what it prints to the console.

Stannks commented 5 years ago

This line? https://github.com/occivink/mpv-gallery-view/blob/master/scripts/gallery.lua#L637

I'm guessing you mistyped the line reference so I tried changing mp.command at line 650 to msg.warn and it instead gives me this:

[gallery] overlay-add 0 18 30 C:\Users\*me*\AppData\Roaming\mpv\galle
ry-thumbs-dir/db2fb4e99cf1_192_108 0 bgra 192 108 768;

For every thumbnail generated in the current playlist with overlay-add # increasing by 1 with the number of files in the playlist.

occivink commented 5 years ago

Oh I think this might be due to the backslashes, there is some path normalization shenanigans going on. Or does your username contain spaces by any change? Anyway it probably wouldn't hurt to use mp.commandv, try replacing the whole mp.command function with this real quick:

mp.commandv("overlay-add",
    tostring(index_0),
    tostring(g.margin_x + (g.margin_x + g.size_x) * (index_0 % g.columns)),
    tostring(g.margin_y + (g.margin_y + g.size_y) * math.floor(index_0 / g.columns)),
    tostring(thumb_path),
    "0",
    "bgra",
    tostring(g.size_x),
    tostring(g.size_y),
    tostring(4*g.size_x)
)

edit: Try the latest commit instead

Stannks commented 5 years ago

Thank you! Works perfectly with no errors. 😊 And yes my username does contain a space.