Menu

#192 Supporting multiple sizes of thumbnails larger than JPEG_TN (160x160)

Unstable (example)
open
nobody
None
5
2021-12-21
2021-11-07
No

I'm heavily using ReadyMedia for long time and satisfied for this except for poor resolution of the thumbnail like other users. (#153 #70)
It seems that the reason why the thumbnail is too small is JPEG_TN(160x160) is mandated for the thumbnail format to provide in DLNA specification.
On the other hand, DLNA spec expects multiple image formats if it includes JPEG_TN.

I created a patch to support multiple resolution thumbnails against ReadyMedia 1.3.0.
I only tested with a few DLNA clients on Windows and Android.

1 Attachments

Discussion

  • negan07

    negan07 - 2021-11-15

    After patching I noticed this error when starting minidlna -R with >1000 db files and some thumbs inside.

    rm: can't remove '/mnt/shares/U/.ReadyDLNA/art_cache/mnt/shares/U/files': Directory not empty
    minidlna.c: fatal: Failed to clean old file cache /mnt/shares/U/.ReadyDLNA. EXITING
    

    Related to:
    minidlna.c/init()

        case 'R':
            snprintf(buf, sizeof(buf), "rm -rf %s/files.db %s/art_cache", db_path, db_path);
            if (system(buf) != 0)
                DPRINTF(E_FATAL, L_GENERAL, "Failed to clean old file cache %s. EXITING\n", db_path);
            break;
    
     
  • Akihiro Nomura

    Akihiro Nomura - 2021-11-15

    Hmm, sounds strange if you are not running multiple copies of minidlnad simultaneously.
    As you mentioned, it's clearly the failure of rm -rf command, which 1) scans the directory and 2) remove files and then 3) remove parent directory. If some new files are created between 1) and 3), such failure may occur.
    This patch will increase the number of thumbnail cache files to 4 times more, for JPEG_{LRG,MED,SM} and JPEG_TN, and some of them are hard-linked if the image is identical (content and size).

     
  • negan07

    negan07 - 2021-11-16

    Investigating, it looks an outside to minidlnad problem, not related, because running manually rm -rf art_cache files.db bring to the same issue into the same specific directory

    It seems that the directory involved, creating 120 thumb files, fails first removal (16 files remaining) then gives successful result retrying with the remaining files...

    Same issue happens deleting dir through samba.

    It is an inode issue coming from NetUSB driver on my router storage device. confirmed by dmesg trace error log.

     
  • Sérgio M. Basto

    we got another approach to this problem here: https://sf.net/p/minidlna/patches/153/

     

    Last edit: Sérgio M. Basto 2021-12-20
  • Akihiro Nomura

    Akihiro Nomura - 2021-12-20

    I saw that patch, but in that thread, on 2016-01-27 by Darkvater, an issue about conformance to DLNA spec is posed as follows:

    The album size is correct, this is the only one that minidlna is advertising. UPNP/DLNA has support for multiple sizes through JPEG_SM, JPEG_MED and JPEG_LRG. You would need to make some changes in upnpsoap.c in the callback method lines 1080-1090 and of course save multiple-sized thumbnails. Have a look at branch https://github.com/Darkvater/minidlna/blob/multiple_sized_thumbnails/ where I've made these changes if you need inspiration.

    My patch is to just reincarnate this idea to the latest impl of readymedia.

     

    Last edit: Akihiro Nomura 2021-12-20
  • Sérgio M. Basto

    Hello, I also use minidlna for long time .
    I'm trying collect some nice features that aren't in official repo here https://sourceforge.net/p/minidlna/git/merge-requests/37/ I'm planing include your patch soon . If you want to help you are welcome , you may send me pull request as well .

    Thank you

     

    Last edit: Sérgio M. Basto 2021-12-21

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.