Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Cover thumbnails come out as black if path too long
#1
I have noticed only recently - with the first 7.1.0 betas IIRC - that some of my thumbnails are replaced by a black square in the lists and as a "broken link" icon in other contexts – see the two attached pictures. The bug is still there with 7.2.0.

By shortening the names of a few directories and updating the library, these reappear. In the first attached picture most of the icons where black squares before shortening the name of the enclosing directory. now only one remains black, and you can see that the name of the directory is quite long. I use sometimes deeply nested structures and long file names. I do not know what the limit currently is (I am going to dig into the source code) but I guess that a change to, say, max 256 (or 255...) characters for the full path should solve all cases except the weirdest.

 Roberto

   

   
Reply
#2
Thats odd. Look in /var/www/command/thmcache.php. The code performs an md5 hash on the string represented by the path containing the Album's tracks.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(05-03-2021, 04:37 PM)Tim Curtis Wrote: Thats odd. Look in /var/www/command/thmcache.php. The code performs an md5 hash on the string represented by the path containing the Album's tracks.

I found something weird in function createThumb($file, $dir, $search_pri, $thm_w, $thm_q)

it seems that the string can contain either a path or an image - if it was embedded, and the selection is made on length. This is highly suspicious to me, if I understood correctly. There should be a flag that tells us whether it was a file or embedded.
Reply
#4
lol, it is pretty suspicious code but it's worked ok until it encountered your super long paths ;-)

Maybe just bump it to 512 ?
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
(05-03-2021, 09:36 PM)Tim Curtis Wrote: lol, it is pretty suspicious code but it's worked ok until it encountered your super long paths ;-)

Maybe just bump it to 512 ?

Well, it is a hack :-)

And: what happens if we have a very unusual cover that compresses to less than 512 bytes?

I also have noticed that this happens with some visually shorter paths as well. I cannot completely understand why it is that. Maybe they have some unicode encoding or some invisible characters?

I'll give it a try.

TWO HOURS LATER: it works, until I have even longer paths...
Reply
#6
(05-04-2021, 08:49 AM)moodenigo Wrote:
(05-03-2021, 09:36 PM)Tim Curtis Wrote: lol, it is pretty suspicious code but it's worked ok until it encountered your super long paths ;-)

Maybe just bump it to 512 ?

TWO HOURS LATER: it works, until I have even longer paths...

Ok, so I suggest for the moment that you bump that to 512 in the distribution as well, until some less suspicious code is written ;-)

 best
  Roberto
Reply
#7
I'll push a commit today.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: