From 34ed3770863899755ff688cc86c29aacaf924a5d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 17 Jun 2013 22:38:48 +0200 Subject: Move fz_write_pixmap wrapper into pdfextract (its only user). --- fitz/image_save.c | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 fitz/image_save.c (limited to 'fitz') 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); -} -- cgit v1.2.3