summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-06-17 22:38:48 +0200
committerTor Andersson <tor.andersson@artifex.com>2013-06-18 17:37:13 +0200
commit34ed3770863899755ff688cc86c29aacaf924a5d (patch)
treefe2b6e3b80bb6c39323dd1bf8fec77755710f648 /fitz
parent923ab857eed6cd29b539910bf74be2aa26d71f39 (diff)
downloadmupdf-34ed3770863899755ff688cc86c29aacaf924a5d.tar.xz
Move fz_write_pixmap wrapper into pdfextract (its only user).
Diffstat (limited to 'fitz')
-rw-r--r--fitz/image_save.c33
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);
-}