Browse Source

- added TIFFTypeName()

pull/3/head
Andreas Romeyke 4 years ago
parent
commit
d4a713b448
  1. 1
      src/headers/check_helper.h
  2. 23
      src/helper/check_tiffparse.c

1
src/headers/check_helper.h

@ -21,6 +21,7 @@ long long fsize(int fd);
ret_t check_tag_has_fvalue(ctiff_t * ctif, tag_t tag, float value);
ret_t check_tag_has_u16value(ctiff_t * ctif, tag_t tag, uint16 value);
ret_t check_tag_has_u32value(ctiff_t * ctif, tag_t tag, uint32 value);
const char * TIFFTypeName( uint16 tagtype );
const char * TIFFTagName (tag_t tag);
uint32 TIFFGetRawTagTypeListEntry( ctiff_t * ctif, int tagidx );
tag_t TIFFGetRawTagListEntry( ctiff_t * ctif, int tagidx ) ;

23
src/helper/check_tiffparse.c

@ -85,6 +85,29 @@ ssize_t ct_read(ctiff_t * ctif, void *buf, size_t count) {
}
}
const char * TIFFTypeName( uint16 tagtype ) {
switch (tagtype) {
case TIFF_NOTYPE: return "NOTYPE"; break;
case TIFF_BYTE: return "BYTE"; break;
case TIFF_ASCII: return "ASCII"; break;
case TIFF_SHORT: return "SHORT"; break;
case TIFF_LONG: return "LONG"; break;
case TIFF_RATIONAL: return "RATIONAL"; break;
case TIFF_SBYTE: return "SBYTE"; break;
case TIFF_UNDEFINED: return "UNDEFINED"; break;
case TIFF_SSHORT: return "SSHORT"; break;
case TIFF_SLONG: return "SLONG"; break;
case TIFF_SRATIONAL: return "SRATIONAL"; break;
case TIFF_FLOAT: return "FLOAT"; break;
case TIFF_DOUBLE: return "DOUBLE"; break;
case TIFF_IFD: return "IFD"; break;
case TIFF_LONG8: return "LONG8"; break;
case TIFF_SLONG8: return "SLONG8"; break;
case TIFF_IFD8: return "IFD8"; break;
default: return "unknown type"; break;
}
}
const char * TIFFTagName( tag_t tag ) {
switch (tag) {

Loading…
Cancel
Save