Diff of /tiff.c [b11426] .. [1efbe6] Maximize Restore

  Switch to side-by-side view

--- a/tiff.c
+++ b/tiff.c
@@ -1359,6 +1359,7 @@
 
  error:
     myfree((void**)im->data);
+    im->data = NULL;
     return 0;
 }
 
@@ -1552,6 +1553,23 @@
 }
 
 
+// THis functions clens any memory currently used by the Image 
+// data structure
+void panoImageDispose(Image *im) 
+{
+    if (im != NULL) {
+
+	// Release metadata
+	panoMetadataFree(&(im->metadata));
+
+	// Release image data
+	if (im->data != NULL) {
+	    myfree((void **) im->data);
+	    im->data = NULL;
+	}
+    }
+}
+
 
 void panoTiffErrorHandler(const char *module, const char *fmt, va_list ap)
 {
@@ -1822,7 +1840,7 @@
 	
 	for (column = 0; column < width; column++) {
 
-	    alphaChannel = panoStitchPixelChannelGet(pixel, bytesPerPixel, 0);
+	    alphaChannel = panoStitchPixelChannelGet(pixel, bytesPerPixel/4, 0);
 
 	    if (alphaChannel != 0) {
 		// Only set the row the first time
@@ -1980,12 +1998,11 @@
     printf("Dimensions: %d,%d\n", meta->imageWidth, meta->imageHeight);
     if (meta->isCropped) {
 	printf("Cropped tiff. Full size: %d,%d Offset: %d,%d\n", 
-	       meta->cropInfo.fullWidth, meta->cropInfo.fullHeight,
-	       meta->cropInfo.xOffset, meta->cropInfo.yOffset);
+	       (int)meta->cropInfo.fullWidth, (int)meta->cropInfo.fullHeight,
+	       (int)meta->cropInfo.xOffset, (int)meta->cropInfo.yOffset);
     }
     printf("Samples per pixel: %d\n", meta->samplesPerPixel);
     printf("Bits per sample: %d\n", meta->bitsPerSample);
-    printf("Compression: %d\n",     meta->compression);
 
     if (meta->iccProfile.size == 0) {
 	printf("Contains ICC profile\n");
@@ -2010,5 +2027,5 @@
 	}
     }
 
-    
-}
+    return 1;
+}