--- fim-0.3-beta-prerelease.orig/src/FbiStuffTiff.cpp
+++ fim-0.3-beta-prerelease/src/FbiStuffTiff.cpp
@@ -1,4 +1,4 @@
-/* $Id: FbiStuffTiff.cpp 210 2009-02-15 17:53:08Z dezperado $ */
+/* $Id: FbiStuffTiff.cpp 271 2009-12-13 00:03:48Z dezperado $ */
/*
FbiStuffTiff.cpp : fbi functions for TIFF files, modified for fim
@@ -60,7 +60,7 @@
struct tiff_state *h;
fclose(fp);
- h = (struct tiff_state *) calloc(sizeof(*h),1);
+ h = (struct tiff_state *) fim_calloc(sizeof(*h),1);
if(!h)goto oops;
memset(h,0,sizeof(*h));
@@ -84,7 +84,7 @@
TIFFGetField(h->tif, TIFFTAG_BITSPERSAMPLE, &h->depth);
TIFFGetField(h->tif, TIFFTAG_FILLORDER, &h->fillorder);
TIFFGetField(h->tif, TIFFTAG_PHOTOMETRIC, &h->photometric);
- h->row = (uint32*)malloc(TIFFScanlineSize(h->tif));
+ h->row = (uint32*)fim_malloc(TIFFScanlineSize(h->tif));
if(!h->row)goto oops;
if (FbiStuff::fim_filereading_debug())
#ifndef PRId32
@@ -108,13 +108,13 @@
* progressive loading and decode everything here */
if (FbiStuff::fim_filereading_debug())
FIM_FBI_PRINTF("tiff: reading whole image [TIFFReadRGBAImage]\n");
- h->image=(uint32*)malloc(4*h->width*h->height);
+ h->image=(uint32*)fim_malloc(4*h->width*h->height);
if(!h->image)goto oops;
TIFFReadRGBAImage(h->tif, h->width, h->height, h->image, 0);
} else {
if (FbiStuff::fim_filereading_debug())
FIM_FBI_PRINTF("tiff: reading scanline by scanline\n");
- h->row = (uint32*)malloc(TIFFScanlineSize(h->tif));
+ h->row = (uint32*)fim_malloc(TIFFScanlineSize(h->tif));
if(!h->row)goto oops;
}
@@ -141,9 +141,9 @@
oops:
if (h && h->tif)
TIFFClose(h->tif);
- if(h && h->row)free(h->row);
- if(h && h->image)free(h->image);
- if(h)free(h);
+ if(h && h->row)fim_free(h->row);
+ if(h && h->image)fim_free(h->image);
+ if(h)fim_free(h);
return NULL;
}
@@ -208,29 +208,29 @@
TIFFClose(h->tif);
if (h->row)
- free(h->row);
+ fim_free(h->row);
if (h->image)
- free(h->image);
- free(h);
+ fim_free(h->image);
+ fim_free(h);
}
static struct ida_loader tiff1_loader = {
- magic: "MM\x00\x2a",
- moff: 0,
- mlen: 4,
- name: "libtiff",
- init: tiff_init,
- read: tiff_read,
- done: tiff_done,
+ /*magic:*/ "MM\x00\x2a",
+ /*moff:*/ 0,
+ /*mlen:*/ 4,
+ /*name:*/ "libtiff",
+ /*init:*/ tiff_init,
+ /*read:*/ tiff_read,
+ /*done:*/ tiff_done,
};
static struct ida_loader tiff2_loader = {
- magic: "II\x2a\x00",
- moff: 0,
- mlen: 4,
- name: "libtiff",
- init: tiff_init,
- read: tiff_read,
- done: tiff_done,
+ /*magic:*/ "II\x2a\x00",
+ /*moff:*/ 0,
+ /*mlen:*/ 4,
+ /*name:*/ "libtiff",
+ /*init:*/ tiff_init,
+ /*read:*/ tiff_read,
+ /*done:*/ tiff_done,
};
static void __init init_rd(void)
@@ -281,9 +281,9 @@
}
static struct ida_writer tiff_writer = {
- label: "TIFF",
- ext: { "tif", "tiff", NULL},
- write: tiff_write,
+ /* label:*/ "TIFF",
+ /* ext:*/ { "tif", "tiff", NULL},
+ /* write:*/ tiff_write,
};
static void __init init_wr(void)