|
|
@ -129,11 +129,11 @@ int TIFFGetRawTagListIndex(ctiff_t * ctif, tag_t tag) { /* find n-th entry in IF |
|
|
|
case unknown_tag_order: |
|
|
|
{ |
|
|
|
ctif->tagorder=has_sorted_tags; |
|
|
|
int count = get_ifd0_count( ctif); |
|
|
|
uint16 count = get_ifd0_count( ctif); |
|
|
|
if (0 == count) { return -1; } |
|
|
|
tag_t last = TIFFGetRawTagListEntry(ctif, 0); |
|
|
|
ctif->tag_cache[last] = 0; |
|
|
|
for (int i= 1; i < get_ifd0_count( ctif ); i++) { |
|
|
|
for (uint i= 1; i < count; i++) { |
|
|
|
tag_t current = TIFFGetRawTagListEntry( ctif, i ); |
|
|
|
if (last >= current) { |
|
|
|
ctif->tagorder=has_unsorted_tags; |
|
|
@ -337,8 +337,7 @@ ret_t get_first_IFD(ctiff_t * ctif, uint32 * ifd) { |
|
|
|
/* scans first IDF and returns the n-th tag */ |
|
|
|
tag_t TIFFGetRawTagListEntry( ctiff_t * ctif, int tagidx ) { |
|
|
|
int byteswapped = is_byteswapped(ctif); |
|
|
|
int count = get_ifd0_count( ctif); |
|
|
|
assert( count > 0); |
|
|
|
uint16 count = get_ifd0_count( ctif); |
|
|
|
/* ct_read count of tags (2 Bytes) */ |
|
|
|
uint32 adress = ctif->ifd0pos+2+tagidx*12; |
|
|
|
if (ct_seek(ctif, adress , SEEK_SET) != adress) { /* IFD0 plus 2byte to get IFD-entries, then nth tag */ |
|
|
@ -504,7 +503,7 @@ ret_t read_offsetdata(ctiff_t * ctif, const uint32 address, const uint32 count, |
|
|
|
|
|
|
|
/* scans first IDF and returns the type of the n-th tag */ |
|
|
|
ifd_entry_t TIFFGetRawTagIFDListEntry( ctiff_t * ctif, int tagidx ) { |
|
|
|
int tagcount = get_ifd0_count( ctif); |
|
|
|
uint16 tagcount = get_ifd0_count( ctif); |
|
|
|
assert( tagcount > 0); |
|
|
|
int byteswapped = is_byteswapped(ctif); |
|
|
|
#ifdef DEBUG |
|
|
@ -637,7 +636,7 @@ ifd_entry_t TIFFGetRawTagIFDListEntry( ctiff_t * ctif, int tagidx ) { |
|
|
|
/* TODO */ |
|
|
|
ifd_entry_t TIFFGetRawIFDEntry( ctiff_t * ctif, tag_t tag) { |
|
|
|
int tagidx = -1; |
|
|
|
for (int i= 0; i < get_ifd0_count( ctif ); i++) { |
|
|
|
for (uint16 i= 0; i < get_ifd0_count( ctif ); i++) { |
|
|
|
if (tag > 253 && tag == TIFFGetRawTagListEntry( ctif, i )) { |
|
|
|
tagidx= i; |
|
|
|
break; |
|
|
@ -675,7 +674,7 @@ if (tagidx >= 0) { |
|
|
|
*/ |
|
|
|
TIFFDataType TIFFGetRawTagType(ctiff_t * ctif, tag_t tag) { |
|
|
|
int tagidx = -1; |
|
|
|
for (int i= 0; i < get_ifd0_count( ctif ); i++) { |
|
|
|
for (uint16 i= 0; i < get_ifd0_count( ctif ); i++) { |
|
|
|
if (tag > 253 && tag == TIFFGetRawTagListEntry( ctif, i )) { |
|
|
|
tagidx= i; |
|
|
|
break; |
|
|
|