Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dummy parsing of HTJ2K CAP and CPF marker to avoid annoying warning #1

Merged
merged 2 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,32 @@ static OPJ_BOOL opj_j2k_read_cbd(opj_j2k_t *p_j2k,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager);

/**
* Reads a CAP marker (extended capabilities definition). Empty implementation.
* Found in HTJ2K files
*
* @param p_header_data the data contained in the CAP box.
* @param p_j2k the jpeg2000 codec.
* @param p_header_size the size of the data contained in the CAP marker.
* @param p_manager the user event manager.
*/
static OPJ_BOOL opj_j2k_read_cap(opj_j2k_t *p_j2k,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager);

/**
* Reads a CPF marker (corresponding profile). Empty implementation. Found in HTJ2K files
* @param p_header_data the data contained in the CPF box.
* @param p_j2k the jpeg2000 codec.
* @param p_header_size the size of the data contained in the CPF marker.
* @param p_manager the user event manager.
*/
static OPJ_BOOL opj_j2k_read_cpf(opj_j2k_t *p_j2k,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager);


/**
* Writes COC marker for each component.
Expand Down Expand Up @@ -1399,6 +1425,8 @@ static const opj_dec_memory_marker_handler_t j2k_memory_marker_handler_tab [] =
{J2K_MS_COM, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_com},
{J2K_MS_MCT, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_mct},
{J2K_MS_CBD, J2K_STATE_MH, opj_j2k_read_cbd},
{J2K_MS_CAP, J2K_STATE_MH, opj_j2k_read_cap},
{J2K_MS_CPF, J2K_STATE_MH, opj_j2k_read_cpf},
{J2K_MS_MCC, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_mcc},
{J2K_MS_MCO, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_mco},
#ifdef USE_JPWL
Expand Down Expand Up @@ -6594,6 +6622,60 @@ static OPJ_BOOL opj_j2k_read_cbd(opj_j2k_t *p_j2k,
return OPJ_TRUE;
}

/**
* Reads a CAP marker (extended capabilities definition). Empty implementation.
* Found in HTJ2K files.
*
* @param p_header_data the data contained in the CAP box.
* @param p_j2k the jpeg2000 codec.
* @param p_header_size the size of the data contained in the CAP marker.
* @param p_manager the user event manager.
*/
static OPJ_BOOL opj_j2k_read_cap(opj_j2k_t *p_j2k,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager
)
{
/* preconditions */
assert(p_header_data != 00);
assert(p_j2k != 00);
assert(p_manager != 00);

(void)p_j2k;
(void)p_header_data;
(void)p_header_size;
(void)p_manager;

return OPJ_TRUE;
}

/**
* Reads a CPF marker (corresponding profile). Empty implementation. Found in HTJ2K files
* @param p_header_data the data contained in the CPF box.
* @param p_j2k the jpeg2000 codec.
* @param p_header_size the size of the data contained in the CPF marker.
* @param p_manager the user event manager.
*/
static OPJ_BOOL opj_j2k_read_cpf(opj_j2k_t *p_j2k,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager
)
{
/* preconditions */
assert(p_header_data != 00);
assert(p_j2k != 00);
assert(p_manager != 00);

(void)p_j2k;
(void)p_header_data;
(void)p_header_size;
(void)p_manager;

return OPJ_TRUE;
}

/* ----------------------------------------------------------------------- */
/* J2K / JPT decoder interface */
/* ----------------------------------------------------------------------- */
Expand Down
2 changes: 2 additions & 0 deletions src/lib/openjp2/j2k.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ The functions in J2K.C have for goal to read/write the several parts of the code
#define J2K_MS_SOT 0xff90 /**< SOT marker value */
#define J2K_MS_SOD 0xff93 /**< SOD marker value */
#define J2K_MS_EOC 0xffd9 /**< EOC marker value */
#define J2K_MS_CAP 0xff50 /**< CAP marker value */
#define J2K_MS_SIZ 0xff51 /**< SIZ marker value */
#define J2K_MS_COD 0xff52 /**< COD marker value */
#define J2K_MS_COC 0xff53 /**< COC marker value */
#define J2K_MS_CPF 0xff59 /**< CPF marker value */
#define J2K_MS_RGN 0xff5e /**< RGN marker value */
#define J2K_MS_QCD 0xff5c /**< QCD marker value */
#define J2K_MS_QCC 0xff5d /**< QCC marker value */
Expand Down