summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/image.c2
-rw-r--r--source/fitz/load-jpx.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/source/fitz/image.c b/source/fitz/image.c
index 8fe49c0d..f71b5d23 100644
--- a/source/fitz/image.c
+++ b/source/fitz/image.c
@@ -436,7 +436,7 @@ compressed_image_get_pixmap(fz_context *ctx, fz_image *image_, fz_irect *subarea
tile = fz_load_jxr(ctx, image->buffer->buffer->data, image->buffer->buffer->len);
break;
case FZ_IMAGE_JPX:
- tile = fz_load_jpx(ctx, image->buffer->buffer->data, image->buffer->buffer->len, NULL, 0);
+ tile = fz_load_jpx(ctx, image->buffer->buffer->data, image->buffer->buffer->len, NULL);
break;
case FZ_IMAGE_JPEG:
/* Scan JPEG stream and patch missing height values in header */
diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c
index e947f5d5..c32f66a4 100644
--- a/source/fitz/load-jpx.c
+++ b/source/fitz/load-jpx.c
@@ -192,7 +192,7 @@ jpx_write(unsigned char * pucData, short sComponent, unsigned long ulRow,
}
static fz_pixmap *
-jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size, fz_colorspace *defcs, int indexed, int onlymeta)
+jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size, fz_colorspace *defcs, int onlymeta)
{
JP2_Decomp_Handle doc;
JP2_Channel_Def_Params *chans = NULL;
@@ -424,11 +424,11 @@ jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size
}
fz_pixmap *
-fz_load_jpx(fz_context *ctx, unsigned char *data, size_t size, fz_colorspace *defcs, int indexed)
+fz_load_jpx(fz_context *ctx, unsigned char *data, size_t size, fz_colorspace *defcs)
{
fz_jpxd state = { 0 };
- return jpx_read_image(ctx, &state, data, size, defcs, indexed, 0);
+ return jpx_read_image(ctx, &state, data, size, defcs, 0);
}
void
@@ -436,7 +436,7 @@ fz_load_jpx_info(fz_context *ctx, unsigned char *data, size_t size, int *wp, int
{
fz_jpxd state = { 0 };
- jpx_read_image(ctx, &state, data, size, NULL, 0, 1);
+ jpx_read_image(ctx, &state, data, size, NULL, 1);
*cspacep = state.cs;
*wp = state.width;
@@ -657,7 +657,7 @@ l2subfactor(fz_context *ctx, unsigned int max_w, unsigned int w)
}
static fz_pixmap *
-jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size, fz_colorspace *defcs, int indexed, int onlymeta)
+jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size, fz_colorspace *defcs, int onlymeta)
{
fz_pixmap *img;
opj_dparameters_t params;
@@ -684,7 +684,7 @@ jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size
format = OPJ_CODEC_JP2;
opj_set_default_decoder_parameters(&params);
- if (indexed)
+ if (fz_colorspace_is_indexed(ctx, defcs))
params.flags |= OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
codec = opj_create_decompress(format);
@@ -887,7 +887,7 @@ jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size
}
fz_pixmap *
-fz_load_jpx(fz_context *ctx, unsigned char *data, size_t size, fz_colorspace *defcs, int indexed)
+fz_load_jpx(fz_context *ctx, unsigned char *data, size_t size, fz_colorspace *defcs)
{
fz_jpxd state = { 0 };
fz_pixmap *pix;
@@ -895,7 +895,7 @@ fz_load_jpx(fz_context *ctx, unsigned char *data, size_t size, fz_colorspace *de
fz_try(ctx)
{
opj_lock(ctx);
- pix = jpx_read_image(ctx, &state, data, size, defcs, indexed, 0);
+ pix = jpx_read_image(ctx, &state, data, size, defcs, 0);
}
fz_always(ctx)
opj_unlock(ctx);
@@ -913,7 +913,7 @@ fz_load_jpx_info(fz_context *ctx, unsigned char *data, size_t size, int *wp, int
fz_try(ctx)
{
opj_lock(ctx);
- jpx_read_image(ctx, &state, data, size, NULL, 0, 1);
+ jpx_read_image(ctx, &state, data, size, NULL, 1);
}
fz_always(ctx)
opj_unlock(ctx);