Menu

#132 Full PNG Support, User-supplied Icons

Unstable (example)
open
nobody
None
5
2025-09-14
2015-02-03
R.L. Horn
No

Full PNG support using libpng, though PNG metadata support is completely built-in (i.e. no additional dependencies for basic PNG support).

This patch also supersedes and extends ticket #130. In addition to the new options in that ticket, if built against libpng you can supply a single PNG icon image which will be resized, composited and converted as necessary with:

icon=pngfile,[bgcolor]

where [bgcolor] is an optional RGB background color supplied as a 24-bit integer in any format recognized by strtol() (e.g. 0x7f7f7f for 50% gray, 0xff0000 for red, 0x00ff00 for green, 0x0000ff for blue, etc.).

Makefile.am and configure.ac are modified, so running autogen.sh is required.

Requires pkg-config for libpng build options.

1 Attachments

Discussion

  • TeHashX

    TeHashX - 2015-02-26

    Thanks for this patch but where should I specify which icon to use?
    icon=pngfile,[bgcolor] ??????????

     

    Last edit: TeHashX 2015-02-26
  • R.L. Horn

    R.L. Horn - 2015-02-27

    In the configuration file.

    But don't use this patch. Clone or get a snapshot of my fork (eastcheap / minidlna) instead. It's what I actually run, so it's better tested and up-to-date. And there's a smidgen of documentation at the bottom of minidlna.conf.

    In fact, the PNG/opus/ogg patches should probably be closed at this point.

     

    Last edit: R.L. Horn 2015-02-27
  • TeHashX

    TeHashX - 2015-02-28

    Works great, now I have to integrate thumbnails patch https://sourceforge.net/p/minidlna/patches/92/?limit=25&page=1#038b
    Can you add it to your git?
    Thanks

     
  • TeHashX

    TeHashX - 2015-02-28

    I made video thumbnails patch, needs libffmpegthumbnailer-dev to be installed and run ./configure --enable-thumbnail
    Please add it to your git.
    Thanks

     
  • TeHashX

    TeHashX - 2015-03-05

    Cloning your git and compiled minidlna with any other modification, scan will end after about 10 seconds without any error, minidlna running fine but only 3-4 video files in db.

     
    • R.L. Horn

      R.L. Horn - 2015-03-06

      Ah, nuts. There's an error all right, almost certainly a segfault. The
      scanner fork()s off and does its thing independently, so tracking problems
      down can be fiendishly difficult.

      Probably some bad PNG or a bad METADATA_BLOCK_PICTURE tag that I'm not
      handling well. I'll mock up some corrupt album art to try and duplicate
      the problem. I'll also look into adding some logging to the SIGCHLD
      handler so at least this won't be able to go unnoticed.

      It would help if you could attach the output from "minidlnad -d".
      (Compressed, please. Those suckers can get BIG.) Or email it to me.

      And I haven't forgotton about the video thumbnails. I just can't decide
      what to do. Unfortunately, it just got pushed down a notch on the
      priority scale...

       
  • TeHashX

    TeHashX - 2015-03-06

    Some errors compiling:

    CC tivo_commands.o
    CC playlist.o
    CC image_utils.o
    image_utils.c: In function ‘image_new_from_png’:
    image_utils.c:704:34: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
    CC albumart.o
    CC log.o
    image_utils.c: In function ‘image_bgcolor_composite’:
    image_utils.c:1037:21: warning: ‘bbg2’ may be used uninitialized in this function [-Wuninitialized]
    image_utils.c:1036:21: warning: ‘gbg2’ may be used uninitialized in this function [-Wuninitialized]
    image_utils.c:1035:21: warning: ‘rbg2’ may be used uninitialized in this function [-Wuninitialized]
    CC containers.o
    sed -e s@:SBINDIR:@/usr/local/sbin@ <linux minidlna.init.d.script.tmpl="">linux/minidlna.init.d.script
    CC tagutils/tagutils.o
    CCLD minidlnad
    make[2]: Leaving directory /var/tmp/u-eastcheap-minidlna' make[1]: Leaving directory/var/tmp/u-eastcheap-minidlna'</linux>

    And error scanning:

    *** glibc detected *** /usr/local/sbin/minidlnad: malloc(): memory corruption: 0x0009f308 ***
    [2015/03/06 17:54:49] process.c:139: error: Process 20582 terminated by signal 6. A core dump was not produced.

     
    • R.L. Horn

      R.L. Horn - 2015-03-06

      God bless you for using MALLOC_CHECK_. I think it's fixed. I know it's
      hard to believe looking at the diff, but I actually remembered to count
      the '\0'. It was another character ('/') I neglected to count.

      I expect new and interesting failures now: running minidlnad through
      valgrind produced some unpleasant surprises, not quite all of which were
      my fault. Looks like I'll be hunting memory leaks over the weekend.

      The compiler warnings are just sound and fury. I'll eventually get around
      to suppressing them when I'm absolutely positive they signify nothing.

       
  • TeHashX

    TeHashX - 2015-03-07

    Recompiled and scanning all db :) Thanks
    Now I want to try with thumbnails patch enabled

     
  • TeHashX

    TeHashX - 2015-08-27

    Hi, I want to apply your patch to original minidlna git but to include latest commits to, can you give me a hint?

     
  • Kurt Fitzner

    Kurt Fitzner - 2021-12-14

    Is there a version of this against 1.3.0? Or an up-to-date minidlna fork that incorporates it?

     

Log in to post a comment.