- Always return metadata struct, but set asoc to null iff j2k.

This commit is contained in:
hw 2018-05-28 14:49:54 +02:00
parent ec4aec11e2
commit 58c19b648b
3 changed files with 12 additions and 7 deletions

View File

@ -10510,8 +10510,13 @@ opj_codestream_info_v2_t* j2k_get_cstr_info(opj_j2k_t* p_j2k)
opj_jp2_metadata_t* j2k_get_metadata( opj_j2k_t* p_j2k )
{
/* A J2K stream can not contain jp2 meta data */
return NULL;
opj_jp2_metadata_t* p_metadata = opj_malloc(sizeof(opj_jp2_metadata_t));
/* A J2K stream can not contain ASOC boxes */
p_metadata->nbasoc = 0;
p_metadata->asoc_info = 00;
return p_metadata;
}
opj_codestream_index_t* j2k_get_cstr_index(opj_j2k_t* p_j2k)

View File

@ -799,7 +799,7 @@ opj_codestream_info_v2_t* j2k_get_cstr_info(opj_j2k_t* p_j2k);
*
*@param p_j2k the component image header to dump.
*
*@return NULL for j2k streams. The metadata extract from the jpg2000 codec
*@return The metadata extract from the jpg2000 codec
*/
opj_jp2_metadata_t* j2k_get_metadata( opj_j2k_t* p_j2k );

View File

@ -3387,11 +3387,11 @@ opj_codestream_info_v2_t* jp2_get_cstr_info(opj_jp2_t* p_jp2)
return p_info;
}
OPJ_BOOL jp2_copy_asoc_data(opj_jp2_t* p_jp2, opj_codestream_info_v2_t* p_info)
opj_jp2_metadata_t* jp2_get_metadata( opj_jp2_t* p_jp2 )
{
opj_jp2_metadata_t* p_metadata = opj_malloc(sizeof(opj_jp2_metadata_t));
jp2_copy_asoc_data( p_jp2, p_metadata );
return p_metadata;
opj_jp2_metadata_t* p_metadata = opj_malloc(sizeof(opj_jp2_metadata_t));
jp2_copy_asoc_data(p_jp2, p_metadata);
return p_metadata;
}
OPJ_BOOL jp2_copy_asoc_data( opj_jp2_t* p_jp2, opj_jp2_metadata_t* p_jp2_metadata )