[Flac-dev] Re: Get multiple pictures in Flac tags

Jérôme COUDERC jerome.couderc at gmail.com
Sun Dec 2 12:52:15 PST 2007


Hi again,

May be solution found here :
        for (pic_type = FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER; 
pic_type < FLAC__STREAM_METADATA_PICTURE_TYPE_UNDEFINED; pic_type++)
        {
            if (FLAC__metadata_get_picture(filename, &picture,
                                           
/*type=*/(FLAC__StreamMetadata_Picture_Type)pic_type,
                                           /*mime_type=*/0, 
/*description=*/0,
                                           /*max_width=*/(unsigned)(-1), 
/*max_height=*/(unsigned)(-1),
                                           /*max_depth=*/(unsigned)(-1), 
/*max_colors=*/(unsigned)(-1)))
            {
               ...
            }
        }

but the only problem is if two pictures have the same type : so the last 
one will be returned.

If it works correctly, this will be implemented in EasyTAG 2.1.4 ;-)

Regards,
Jerome


Jérôme COUDERC wrote, the 02.12.2007 20:49 :
> Hi,
>
>     I'm currently adding the support of pictures in Flac tags for EasyTAG.
> Helped with examples contained in the package 1.2.1, the first tests 
> seems correct. But I don't understand how to get all the pictures of 
> the tag.
> For example, the attached file was generated with the 
> "flac-1.2.1/test/test_metaflac.sh" script and contains 2 pictures (one 
> of 446 bytes, and one of 462 bytes)
>
> To read the picture, I use the following function :
> FLAC__bool FLAC__metadata_get_picture 	(  	const char *  	/filename/,
>
> 	
> 	FLAC__StreamMetadata 
> <http://flac.sourceforge.net/api/structFLAC____StreamMetadata.html> 
> **  	/picture/,
>
> 	
> 	FLAC__StreamMetadata_Picture_Type 
> <http://flac.sourceforge.net/api/group__flac__format.html#ga114>  
> /type/,
>
> 	
> 	const char *  	/mime_type/,
>
> 	
> 	const FLAC__byte *  	/description/,
>
> 	
> 	unsigned  	/max_width/,
>
> 	
> 	unsigned  	/max_height/,
>
> 	
> 	unsigned  	/max_depth/,
>
> 	
> 	unsigned  	/max_colors/
>
> 	) 
>
>
> but this function seems to return only the last one...
>
> How to get all the pictures?
>
> Thanks in advance,
> Regards,
> Jerome
>


More information about the Flac-dev mailing list