diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-11-13 12:10:26 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-11-13 13:41:23 +0100 |
commit | d3a097de722b4fc39e108e30c5b2f6207bdf4b17 (patch) | |
tree | e6fb4fe3aba0329cd5289ebae0ae526a7d1a63e1 /source/tools | |
parent | 019859d98079c0cf0c287e54d515b0ccb4004d52 (diff) | |
download | mupdf-d3a097de722b4fc39e108e30c5b2f6207bdf4b17.tar.xz |
js: Use Image.toPixmap arguments.
Diffstat (limited to 'source/tools')
-rw-r--r-- | source/tools/murun.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c index 36c66978..281d5ec0 100644 --- a/source/tools/murun.c +++ b/source/tools/murun.c @@ -2320,10 +2320,16 @@ static void ffi_Image_toPixmap(js_State *J) { fz_context *ctx = js_getcontext(J); fz_image *image = js_touserdata(J, 0, "fz_image"); + fz_matrix matrix_, *matrix = NULL; fz_pixmap *pixmap = NULL; + if (js_isnumber(J, 1) && js_isnumber(J, 2)) { + matrix_ = fz_scale(js_tonumber(J, 1), js_tonumber(J, 2)); + matrix = &matrix_; + } + fz_try(ctx) - pixmap = fz_get_pixmap_from_image(ctx, image, NULL, NULL, NULL, NULL); + pixmap = fz_get_pixmap_from_image(ctx, image, NULL, matrix, NULL, NULL); fz_catch(ctx) rethrow(J); |