Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created June 28, 2012 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save springmeyer/3007985 to your computer and use it in GitHub Desktop.
Save springmeyer/3007985 to your computer and use it in GitHub Desktop.
C program to check if a tiff is tiled or stripped (internally)
#include <tiffio.h>
/*
clang -o tiff-is-tiled tiff-is-tiled.c -I/usr/local/include -ltiff;
./tiff-is-tiled test.tiff
*/
int main(int argc, char **argv) {
if (argv[1]) {
TIFF * tif = TIFFOpen(argv[1], "r");
if (TIFFIsTiled(tif))
printf("%s is tiled\n",argv[1]);
else
printf("%s is NOT tiled (stripped)\n",argv[1]);
return 0;
} else {
printf("please provide a path to a tiff file\n");
return 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment