summaryrefslogtreecommitdiff
path: root/fitz/res_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'fitz/res_image.c')
-rw-r--r--fitz/res_image.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/fitz/res_image.c b/fitz/res_image.c
new file mode 100644
index 00000000..4379cf17
--- /dev/null
+++ b/fitz/res_image.c
@@ -0,0 +1,23 @@
+#include "fitz-base.h"
+#include "fitz-world.h"
+
+fz_image *
+fz_keepimage(fz_image *image)
+{
+ image->refs ++;
+ return image;
+}
+
+void
+fz_dropimage(fz_image *image)
+{
+ if (image && --image->refs == 0)
+ {
+ if (image->drop)
+ image->drop(image);
+ if (image->cs)
+ fz_dropcolorspace(image->cs);
+ fz_free(image);
+ }
+}
+