+ if(m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD) {
+ if(metadata_picture_has_type1) /* there should only be 1 per stream */
+ return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA;
+ metadata_picture_has_type1 = true;
+ /* standard icon must be 32x32 pixel PNG */
+ if(
+ m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD &&
+ (
+ (strcmp(m->data.picture.mime_type, "image/png") && strcmp(m->data.picture.mime_type, "-->")) ||
+ m->data.picture.width != 32 ||
+ m->data.picture.height != 32
+ )
+ )
+ return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA;
+ }
+ else if(m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON) {
+ if(metadata_picture_has_type2) /* there should only be 1 per stream */
+ return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA;
+ metadata_picture_has_type2 = true;
+ }