summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mupdf/fitz/image.h2
-rw-r--r--platform/win32/libmupdf.vcproj4
-rw-r--r--source/fitz/image.c4
-rw-r--r--source/fitz/load-jxr.c15
4 files changed, 23 insertions, 2 deletions
diff --git a/include/mupdf/fitz/image.h b/include/mupdf/fitz/image.h
index 216f98cf..7254ace0 100644
--- a/include/mupdf/fitz/image.h
+++ b/include/mupdf/fitz/image.h
@@ -83,9 +83,11 @@ struct fz_image_s
fz_pixmap *fz_load_jpx(fz_context *ctx, unsigned char *data, int size, fz_colorspace *cs, int indexed);
fz_pixmap *fz_load_png(fz_context *ctx, unsigned char *data, int size);
fz_pixmap *fz_load_tiff(fz_context *ctx, unsigned char *data, int size);
+fz_pixmap *fz_load_jxr(fz_context *ctx, unsigned char *data, int size);
void fz_load_jpeg_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
void fz_load_png_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
void fz_load_tiff_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
+void fz_load_jxr_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);
#endif
diff --git a/platform/win32/libmupdf.vcproj b/platform/win32/libmupdf.vcproj
index 29cee7bc..74f6df79 100644
--- a/platform/win32/libmupdf.vcproj
+++ b/platform/win32/libmupdf.vcproj
@@ -562,6 +562,10 @@
>
</File>
<File
+ RelativePath="..\..\source\fitz\load-jxr.c"
+ >
+ </File>
+ <File
RelativePath="..\..\source\fitz\load-png.c"
>
</File>
diff --git a/source/fitz/image.c b/source/fitz/image.c
index 10a8bda4..2144674a 100644
--- a/source/fitz/image.c
+++ b/source/fitz/image.c
@@ -273,7 +273,7 @@ fz_image_get_pixmap(fz_context *ctx, fz_image *image, int w, int h)
tile = fz_load_tiff(ctx, image->buffer->buffer->data, image->buffer->buffer->len);
break;
case FZ_IMAGE_JXR:
- fz_throw(ctx, FZ_ERROR_GENERIC, "JPEG-XR codec is not available");
+ tile = fz_load_jxr(ctx, image->buffer->buffer->data, image->buffer->buffer->len);
break;
default:
native_l2factor = l2factor;
@@ -468,7 +468,7 @@ fz_new_image_from_buffer(fz_context *ctx, fz_buffer *buffer)
else if (memcmp(buf, "II", 2) == 0 && buf[2] == 0xBC)
{
bc->params.type = FZ_IMAGE_JXR;
- fz_throw(ctx, FZ_ERROR_GENERIC, "JPEG-XR codec is not available");
+ fz_load_jxr_info(ctx, buf, len, &w, &h, &xres, &yres, &cspace);
}
else if (memcmp(buf, "MM", 2) == 0 || memcmp(buf, "II", 2) == 0)
{
diff --git a/source/fitz/load-jxr.c b/source/fitz/load-jxr.c
new file mode 100644
index 00000000..00c0568f
--- /dev/null
+++ b/source/fitz/load-jxr.c
@@ -0,0 +1,15 @@
+#include "mupdf/fitz.h"
+
+/* TODO: implement JPEG-XR support */
+
+fz_pixmap *
+fz_load_jxr(fz_context *ctx, unsigned char *data, int size)
+{
+ fz_throw(ctx, FZ_ERROR_GENERIC, "JPEG-XR codec is not available");
+}
+
+void
+fz_load_jxr_info(fz_context *ctx, unsigned char *data, int size, int *wp, int *hp, int *xresp, int *yresp, fz_colorspace **cspacep)
+{
+ fz_throw(ctx, FZ_ERROR_GENERIC, "JPEG-XR codec is not available");
+}