Menu

#153 an albumart.c patch for change the resolution of album_art easier.

Unstable (example)
open
nobody
None
5
2018-01-01
2015-11-22
No

I really love minidlna except one thing that is a poor resolution of the album arts. The fixed value "160" is hard coded on several lines of albert.c. This patch can define the max resolution on the top of the albumart.c by #define.
In my patch, the value is 500 for example. It is good value for my 1080p display with Kodi. Of course, you can change your favorite value.

Regards,
NK.

1 Attachments

Discussion

  • Naoya Kotani

    Naoya Kotani - 2015-11-22

    Also, I've already made enough test on my Rhaspberry Pi 2.
    I attach the before and after test image on Kodi (1080p and album art resolution is 500).

     

    Last edit: Naoya Kotani 2015-11-22
  • Darkvater

    Darkvater - 2016-01-27

    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.

     
  • entrast

    entrast - 2016-01-28

    Hi darkvater,

    i applied the changes you made in your multiple_sized_thumbnails branch to the official 1.1.5 minidlna sources and was able to build it.
    The minidlnad started an created the cache files, but stop after some mp3 files. I could reproduce the error by adding this jpeg file http://ecx.images-amazon.com/images/I/41OCLOrHiIL.SL160.jpg as cover to a mp3 file.
    After this file is cached, i get this error message *** Error in '/usr/sbin/minidlnad': corrupted double-linked list: 0x00007f32b01ea060 *** and the daemon gets aborted.
    I don't get any errors with that file when i use minidlnad without the patch.
    Maybe you could look into it.

     
  • Darkvater

    Darkvater - 2016-01-29

    Hi, could you have a look at the features branch? I think I did some changes and stopped backporting them as I gave up on merging anything back to master. The url is https://github.com/Darkvater/minidlna/tree/features?files=1

     
  • entrast

    entrast - 2016-01-29

    I build your features branch and get the same error, when i move the attached file to a media dir. I think this happens when the diameter of the embedded cover is exactly 160 pixels long or wide.

     
  • Naoya Kotani

    Naoya Kotani - 2016-01-29

    Hi darkvater,
    Thank you for your branch. I think your solution seems to be much smarter than my simplest patch (but easy to understand :-). I have still no time and spare machine to try, confirm and read your code. I have to keep DLNA service for my family.
    Wait some days.

     
  • Darkvater

    Darkvater - 2016-01-31

    Hi entrast, you are right. The image_resize method returns the same pointer for destination if the requested image size is the same as the input size. If we don't check this, we will free the same memory twice. Pushed a fix for it.

    As this is an issue in my branch only, can you do any further feedback on github? Don't want to mix non-trunk stuff in here.

     
    • entrast

      entrast - 2016-01-31

      I'll. Thanks for looking into it.

       
  • nymous

    nymous - 2016-05-22

    Hey folks.
    My two cents on this topic. I've merged Naoya's approach with previous "No cover art resize" patch. Mine would add integer resize_covers option to config, which you can use to specify your max cover size without recompiling from source. The value of 0 completelly disables resizing.

     
    • Naoya Kotani

      Naoya Kotani - 2016-08-28

      Hi nymous.
      Your patch runs pretty well. I hope this will be merged into the main line :-)

       

      Last edit: Naoya Kotani 2016-08-28
  • Biolog.Hubinka

    Biolog.Hubinka - 2017-12-12

    Hello gyus, for few days I am looking for this solution. But I am not able to find out how to implement it. Can you please advice me in this? I am using Freenas 11, I have installed the miniDLNA using JoeSchmuck tutorial but I am not able to find out location of "albumart.c". Is it a file?

    And to be honest, I do not know what version of minidlna I have. I tried pkg update, and eveyrthing should be uptodate, but I dont know how to check this :(

     

    Last edit: Biolog.Hubinka 2017-12-12
    • nymous

      nymous - 2017-12-12

      It's in the sources. You have to recompile your minidla manually.

       
      • Biolog.Hubinka

        Biolog.Hubinka - 2017-12-13

        well I am doomed then :( Pity, but thanks anyways

         
  • Nenad Grbic

    Nenad Grbic - 2017-12-16

    Hi all, i searched google for apply patch tutorial and i can't find anything about it..
    I installed latest 1.2.1 minidlna from source using this guide
    https://www.htpcguides.com/install-readymedia-minidlna-1-1-4-raspberry-pi/
    How to apply a patch, when i download tar file, what then i must to to
    Also is this guide is ok for installing latest minidlna?
    And one more question, what patch to use from this page, the one in the atachment or one of these patches from comments..
    Thanks for help

     
  • Shrimpkin

    Shrimpkin - 2017-12-18

    Any of the patches should work. After downloading and unpacking minidlna, use the patch command to patch the files. Ex:

    patch -p1 < filename.patch
    

    Search online for tutorials on how to use the patch command.

     
  • Nenad Grbic

    Nenad Grbic - 2017-12-19

    hi, i learned how to patch, thanks for directions on that subject..
    so i downloaded latest version of minidlna and applied latest patch in this thread "minidlna-1.1.5-cover-resize.patch" and i get error, can you update patch for latest version..thanks

    root@DietPi:/home/dietpi/minidlna-1.2.1# patch -p1 < minidlna-1.1.5-cover-resize.patch
    patching file albumart.c
    Hunk #2 succeeded at 219 (offset 3 lines).
    Hunk #3 succeeded at 341 (offset 3 lines).
    patching file minidlna.c
    Hunk #1 succeeded at 538 (offset 6 lines).
    Hunk #2 succeeded at 753 with fuzz 2 (offset 14 lines).
    patching file minidlnatypes.h
    patching file options.c
    Hunk #1 FAILED at 64.
    1 out of 1 hunk FAILED -- saving rejects to file options.c.rej
    patching file options.h
    Hunk #1 FAILED at 57.
    1 out of 1 hunk FAILED -- saving rejects to file options.h.rej

    and when i enter make command i get error

    minidlna.c: In function ‘init’:
    minidlna.c:756:8: error: ‘RESIZE_COVER_ART’ undeclared (first use in this function)
    case RESIZE_COVER_ART:
    ^~~~~~~~~~~~~~~~
    minidlna.c:756:8: note: each undeclared identifier is reported only once for each function it appears in
    Makefile:592: recipe for target 'minidlna.o' failed
    make[2]: [minidlna.o] Error 1
    make[2]: Leaving directory '/home/dietpi/minidlna-1.2.1'
    Makefile:614: recipe for target 'all-recursive' failed
    make[1]:
    [all-recursive] Error 1
    make[1]: Leaving directory '/home/dietpi/minidlna-1.2.1'
    Makefile:438: recipe for target 'all' failed
    make: *** [all] Error 2

     

    Last edit: Nenad Grbic 2017-12-19
  • Shrimpkin

    Shrimpkin - 2018-01-01

    Normally, you use the same source version as the patch was made for. Somtimes you can use other versions, if the source has not changed much.

    Here is user nymous@sf.net patch updated for v1.2.1. I have not tested it. In the future, ask the original patch author for an updated patch.

     

Log in to post a comment.