<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I am using a libFLAC8.dylib that I have compiled with the original Makefile of flac 1.3.1 distribution, in a project with a custom flac.h header file which is an amalgamation of all the flac header files.<div class="">I can get this pair ( flac.h & libFLAC8.dylib ) working fine to convert flac file to other supported audio file formats both ways. It work also fine to get Vorbis Comment and other metadata ( like "bits per sample" for instance ).</div><div class="">But when I use the following code, FLAC__metadata_get_picture() always return false :</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">FLAC__StreamMetadata</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> *smet= </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">NULL</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> const char *filename="/[...]/musicfile.flac";</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(49, 89, 93);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">for</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> (</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">FLAC__StreamMetadata_Picture_Type</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> pic_type = </span><span style="font-variant-ligatures: no-common-ligatures" class="">FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(49, 89, 93);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> pic_type < </span><span style="font-variant-ligatures: no-common-ligatures" class="">FLAC__STREAM_METADATA_PICTURE_TYPE_UNDEFINED</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">; pic_type++)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> (</span><span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">FLAC__metadata_get_picture</span><span style="font-variant-ligatures: no-common-ligatures" class="">(filename</span><span style="font-variant-ligatures: no-common-ligatures" class="">, &smet, pic_type, </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">NULL</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">NULL</span><span style="font-variant-ligatures: no-common-ligatures" class="">, (</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">unsigned</span><span style="font-variant-ligatures: no-common-ligatures" class="">)(-</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">) , (</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">unsigned</span><span style="font-variant-ligatures: no-common-ligatures" class="">)(-</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">), (</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">unsigned</span><span style="font-variant-ligatures: no-common-ligatures" class="">)(-</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">), (</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">unsigned</span><span style="font-variant-ligatures: no-common-ligatures" class="">)(-</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures" class="">)) )</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">FLAC__StreamMetadata_Picture</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> pict = smet-></span><span style="font-variant-ligatures: no-common-ligatures" class="">data</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">.</span><span style="font-variant-ligatures: no-common-ligatures" class="">picture</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ( pict.</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">data_length</span><span style="font-variant-ligatures: no-common-ligatures" class=""> )</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">printf</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"found image %s : %s"</span><span style="font-variant-ligatures: no-common-ligatures" class="">, pict.</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">mime_type</span><span style="font-variant-ligatures: no-common-ligatures" class="">, pict.</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">description</span><span style="font-variant-ligatures: no-common-ligatures" class="">);</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> } </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">else</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">printf</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);" class="">« no data %s : %s\n"</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, pict.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">mime_type</span><span style="font-variant-ligatures: no-common-ligatures;" class="">, pict.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">description</span><span style="font-variant-ligatures: no-common-ligatures;" class="">);</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">break</span><span style="font-variant-ligatures: no-common-ligatures" class="">;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> } </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">else</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">printf</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"get_picture %u returned false\n"</span><span style="font-variant-ligatures: no-common-ligatures" class="">, pic_type );</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">I have tried to use -1 instead of pic_type as 3rd argument on a single call to </span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">FLAC__metadata_get_picture</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">()</span></div><div class=""><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">I have tried different flac files which all returns a valid image file when I use the command line tool </span><span style="color: rgb(0, 249, 0); font-family: 'Andale Mono'; background-color: rgb(0, 0, 0);" class="">metaflac --export-picture-to=</span></div><div class="">The command line tools had been successfully compiled at the same time than the dylib library</div><div class="">( on Mac OS 10.11, intel x86_64 )</div><div class=""><br class=""></div><div class="">in my project FLAC__metadata_get_picture always return false !!!</div><div class=""><br class=""></div><div class="">Anyone has an idea what could be going wrong ?</div></body></html>