diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-06-17 22:38:48 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2013-06-18 17:37:13 +0200 |
commit | 34ed3770863899755ff688cc86c29aacaf924a5d (patch) | |
tree | fe2b6e3b80bb6c39323dd1bf8fec77755710f648 /fitz | |
parent | 923ab857eed6cd29b539910bf74be2aa26d71f39 (diff) | |
download | mupdf-34ed3770863899755ff688cc86c29aacaf924a5d.tar.xz |
Move fz_write_pixmap wrapper into pdfextract (its only user).
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/image_save.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/fitz/image_save.c b/fitz/image_save.c deleted file mode 100644 index 0a564ed1..00000000 --- a/fitz/image_save.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "mupdf/fitz.h" - -void fz_write_pixmap(fz_context *ctx, fz_pixmap *img, char *file, int rgb) -{ - char name[1024]; - fz_pixmap *converted = NULL; - - if (!img) - return; - - if (rgb && img->colorspace && img->colorspace != fz_device_rgb(ctx)) - { - fz_irect bbox; - converted = fz_new_pixmap_with_bbox(ctx, fz_device_rgb(ctx), fz_pixmap_bbox(ctx, img, &bbox)); - fz_convert_pixmap(ctx, converted, img); - img = converted; - } - - if (img->n <= 4) - { - sprintf(name, "%s.png", file); - printf("extracting image %s\n", name); - fz_write_png(ctx, img, name, 0); - } - else - { - sprintf(name, "%s.pam", file); - printf("extracting image %s\n", name); - fz_write_pam(ctx, img, name, 0); - } - - fz_drop_pixmap(ctx, converted); -} |