Browse Source

- bugfix, memleak in tifp_check(), it only uses assertions now

- bugfix, reused ret_t res to reduce memory fingerprint
- bugfix, memleak in check_icc() free allocated buffer after check
pull/3/head
Andreas Romeyke 4 years ago
parent
commit
02eae55473
  1. 6
      src/helper/check_print.c
  2. 11
      src/tagrules/check_datetime.c
  3. 9
      src/tagrules/check_icc.c
  4. 8
      src/tagrules/check_notag.c
  5. 6
      src/tagrules/check_tag.c
  6. 118
      src/tagrules/check_tag_has_some_of_these_values.c
  7. 7
      src/tagrules/check_tag_has_valid_asciivalue.c
  8. 9
      src/tagrules/check_tag_has_valid_type.c
  9. 17
      src/tagrules/check_tag_has_value.c
  10. 6
      src/tagrules/check_tag_has_value_in_range.c
  11. 8
      src/tagrules/check_tag_has_value_quiet.c
  12. 183
      src/tagrules/check_tag_has_valuelist.c
  13. 2
      src/tagrules/check_tag_quiet.c

6
src/helper/check_print.c

@ -11,6 +11,7 @@
#include <string.h>
#include "check.h"
#include "check_helper.h"
#include <assert.h>
#ifdef WIN32
static inline char *strndup(const char *s, size_t n)
@ -158,9 +159,14 @@ ret_t tif_files(const char *msg) {
}
void tifp_check( ctiff_t * ctif) {
/*
if (NULL == ctif) { tif_fails("ctif_t pointer is empty\n"); };
if (0 > ctif->fd) { tif_fails("TIFF FD pointer is empty\n"); };
if (NULL == ctif->streamp) { tif_fails("TIFF stream pointer is empty\n"); };
*/
assert(NULL != ctif);
assert(0 <= ctif->fd);
assert(NULL == ctif->streamp);
}
/* TODO: add tif_returns specialized for types */

11
src/tagrules/check_datetime.c

@ -49,13 +49,16 @@ int test_plausibility (int * year, int * month, int * day, int * hour, int * min
* @param filename filename which should be processed, repaired
*/
ret_t check_datetime(ctiff_t * ctif ) {
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
tifp_check( ctif);
//printf("check if tag %u (%s) is correct\n", TIFFTAG_DATETIME, TIFFTagName(tif, TIFFTAG_DATETIME));
tif_rules_tag(TIFFTAG_DATETIME, "is correct");
/* find date-tag and fix it */
TIFFDataType datatype = TIFFGetRawTagType( ctif, TIFFTAG_DATETIME );
if (datatype != TIFF_ASCII) {
return tif_fails_tag(TIFFTAG_DATETIME, "", "has not the expected datatype ASCII");
return tif_fails_tag(TIFFTAG_DATETIME, "", "has not the expected datatype ASCII");
}
int count=0;
char *datetime=NULL;
@ -81,9 +84,6 @@ ret_t check_datetime(ctiff_t * ctif ) {
if (0 == r) {
if (6 == sscanf(datetime, "%04d:%02d:%02d%02d:%02d:%02d", &year, &month, &day, &hour, &min, &sec)) {
if (0 == test_plausibility(&year, &month, &day, &hour, &min, &sec)) {
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
return res;
} else {
@ -104,9 +104,6 @@ ret_t check_datetime(ctiff_t * ctif ) {
return tif_fails_tag( TIFFTAG_DATETIME, "should be \"yyyy:MM:DD hh:mm:ss\"", array);
//tif_fails("tag %u (%s) value of datetime should be \"yyyy:MM:DD hh:mm:ss\", but was \"%s\" and contains a \\0 at %i (count=%u)\n", TIFFTAG_DATETIME, TIFFTagName(tif, TIFFTAG_DATETIME), datetime, r, count);
}
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
return res;
}

9
src/tagrules/check_icc.c

@ -13,9 +13,10 @@
/** checks a ICC tag, see Annex B of http://www.color.org/specification/ICC1v43_2010-12.pdf
*/
ret_t check_icc(ctiff_t * ctif ) {
// printf("DEBUG: check_icc()\n");
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
tifp_check( ctif);
//printf("DEBUG: check_icc() 2\n");
tif_rules_tag(TIFFTAG_ICCPROFILE, "is correct");
ifd_entry_t ifd_entry = TIFFGetRawIFDEntry(ctif, TIFFTAG_ICCPROFILE);
// printf("DEBUG: count=%i\n", ifd_entry.count);
@ -61,13 +62,11 @@ ret_t check_icc(ctiff_t * ctif ) {
char * errmessage = malloc(sizeof(char) * ERRSIZE);
unsigned long errsize = ERRSIZE;
int ret = parse_icc(icc_profile_size, icc_profile, errsize, errmessage);
if (NULL != icc_profile) free(icc_profile);
if (0 != ret) {
return tif_fails_tag( TIFFTAG_ICCPROFILE, "pointing to valid ICC profile", errmessage);
}
free (errmessage);
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
return res;
}

8
src/tagrules/check_notag.c

@ -13,11 +13,17 @@
/* checks if TIF does not have a specified tag,
* needed only for checks to ensure whitelist */
ret_t check_notag(ctiff_t * ctif, tag_t tag) {
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
tifp_check( ctif);
ret_t res = check_tag_quiet( ctif, tag);
res = check_tag_quiet( ctif, tag);
if (res.returncode == 0) {
return tif_no_tag( tag);
} else {
if (NULL != res.returnmsg) {
free(res.returnmsg);
}
res.returnmsg=NULL;
res.returncode=0;
return res;

6
src/tagrules/check_tag.c

@ -12,10 +12,12 @@
/* checks if TIF has a specified tag */
ret_t check_tag(ctiff_t * ctif, tag_t tag) {
//printf("check if tag %u (%s) exists\n", tag, TIFFTagName(tif, tag));
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
tifp_check( ctif);
tif_rules_tag(tag, "exists");
ret_t res = check_tag_quiet( ctif, tag);
res = check_tag_quiet( ctif, tag);
if (res.returncode == 0) {
return check_tag_has_valid_type( ctif, tag);
} else {

118
src/tagrules/check_tag_has_some_of_these_values.c

@ -14,7 +14,9 @@
*/
ret_t check_tag_has_some_of_these_values(ctiff_t * ctif, tag_t tag, int count, unsigned int * values) {
//printf("check if tag %u (%s) has some of these %i-values", tag, TIFFTagName(tif, tag), count);
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
tifp_check( ctif);
char msg[EXPECTSTRLEN];
char expected[EXPECTSTRLEN]="";
@ -27,74 +29,74 @@ ret_t check_tag_has_some_of_these_values(ctiff_t * ctif, tag_t tag, int count, u
}
secstrcat (msg, expected, EXPECTSTRLEN);
tif_rules_tag(tag, strdup(msg));
ret_t res = check_tag_has_valid_type( ctif, tag);
res = check_tag_has_valid_type( ctif, tag);
if (res.returncode == 0) {
TIFFDataType datatype = TIFFGetRawTagType( ctif, tag );
switch (datatype) {
case TIFF_LONG: {
p = values;
ret_t tmp_res;
for (int i=0; i< count; i++) {
TIFFDataType datatype = TIFFGetRawTagType( ctif, tag );
switch (datatype) {
case TIFF_LONG: {
p = values;
ret_t tmp_res;
for (int i=0; i< count; i++) {
#ifdef DEBUG
printf("### value = %u", *p);
printf("### value = %u", *p);
#endif
tmp_res = check_tag_has_u32value(ctif, tag, *p);
if (tmp_res.returncode == 0) return tmp_res;
p++;
tmp_res = check_tag_has_u32value(ctif, tag, *p);
if (tmp_res.returncode == 0) return tmp_res;
p++;
}
uint32 * valp = NULL;
uint32 val;
TIFFGetFieldLONG(ctif, tag, &valp);
val = *valp;
return tif_fails_tag( tag, strdup(expected), int2str(val));
break;
}
uint32 * valp = NULL;
uint32 val;
TIFFGetFieldLONG(ctif, tag, &valp);
val = *valp;
return tif_fails_tag( tag, strdup(expected), int2str(val));
break;
}
case TIFF_SHORT: {
p = values;
ret_t tmp_res;
for (int i=0; i< count; i++) {
case TIFF_SHORT: {
p = values;
ret_t tmp_res;
for (int i=0; i< count; i++) {
#ifdef DEBUG
printf("### value = %u", *p);
printf("### value = %u", *p);
#endif
tmp_res = check_tag_has_u16value(ctif, tag, *p);
if (tmp_res.returncode == 0) return tmp_res;
p++;
tmp_res = check_tag_has_u16value(ctif, tag, *p);
if (tmp_res.returncode == 0) return tmp_res;
p++;
}
uint16 * valp = NULL;
uint16 val;
TIFFGetFieldSHORT(ctif, tag, &valp);
val = *valp;
return tif_fails_tag( tag, strdup(expected), int2str(val));
break;
}
uint16 * valp = NULL;
uint16 val;
TIFFGetFieldSHORT(ctif, tag, &valp);
val = *valp;
return tif_fails_tag( tag, strdup(expected), int2str(val));
break;
}
case TIFF_RATIONAL: {
p = values;
ret_t tmp_res;
for (int i=0; i< count; i++) {
case TIFF_RATIONAL: {
p = values;
ret_t tmp_res;
for (int i=0; i< count; i++) {
#ifdef DEBUG
printf("### value = %u", *p);
printf("### value = %u", *p);
#endif
tmp_res = check_tag_has_fvalue(ctif, tag, *p);
if (tmp_res.returncode == 0) return tmp_res;
p++;
tmp_res = check_tag_has_fvalue(ctif, tag, *p);
if (tmp_res.returncode == 0) return tmp_res;
p++;
}
float * valp = NULL;
float val;
TIFFGetFieldRATIONAL(ctif, tag, &valp);
val = * valp;
return tif_fails_tag( tag, strdup(expected), float2str(val));
//tif_fails("tag %u (%s) does not have some of expected values (but have:%f)\n", tag, TIFFTagName(tif, tag), val);
break;
}
float * valp = NULL;
float val;
TIFFGetFieldRATIONAL(ctif, tag, &valp);
val = * valp;
return tif_fails_tag( tag, strdup(expected), float2str(val));
//tif_fails("tag %u (%s) does not have some of expected values (but have:%f)\n", tag, TIFFTagName(tif, tag), val);
break;
}
default: /* none */
{
// tif_fails("tag %u (%s) should have values of type long, short or float, but was:%i\n", tag, TIFFTagName(tif, tag), datatype);
char array[VALUESTRLEN];
snprintf(array, sizeof(array), "but was:%i", datatype);
return tif_fails_tag( tag, "of type long, short or float", array);
}
}
default: /* none */
{
// tif_fails("tag %u (%s) should have values of type long, short or float, but was:%i\n", tag, TIFFTagName(tif, tag), datatype);
char array[VALUESTRLEN];
snprintf(array, sizeof(array), "but was:%i", datatype);
return tif_fails_tag( tag, "of type long, short or float", array);
}
}
}
return res;
}

7
src/tagrules/check_tag_has_valid_asciivalue.c

@ -14,8 +14,11 @@
/* checks if TIF with tag and type ASCII */
ret_t check_tag_has_valid_asciivalue(ctiff_t * ctif, tag_t tag) {
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
tifp_check( ctif);
TIFFDataType datatype = TIFFGetRawTagType( ctif, tag );
TIFFDataType datatype = TIFFGetRawTagType( ctif, tag );
#ifdef DEBUG
printf("### datatype=%i \n", datatype);
#endif
@ -36,7 +39,7 @@ ret_t check_tag_has_valid_asciivalue(ctiff_t * ctif, tag_t tag) {
}
}
} else {
return tif_fails_tag(tag, "", "has not the expected datatype ASCII");
return tif_fails_tag(tag, "", "has not the expected datatype ASCII");
}
if (0 != r) {
char array[VALUESTRLEN];

9
src/tagrules/check_tag_has_valid_type.c

@ -12,7 +12,9 @@
/* checks if TIF has a specified tag */
ret_t check_tag_has_valid_type(ctiff_t * ctif, tag_t tag) {
//printf("check if tag %u (%s) has valid type\n", tag, TIFFTagName(tif, tag));
ret_t ret;
ret.returnmsg=NULL;
ret.returncode=0;
tifp_check( ctif);
//tif_rules_tag(tag, "has valid type");
TIFFDataType datatype = TIFFGetRawTagType( ctif, tag );
@ -100,10 +102,7 @@ ret_t check_tag_has_valid_type(ctiff_t * ctif, tag_t tag) {
snprintf(array, sizeof(array), "with incorrect type: %s (%i)", TIFFTypeName(datatype), datatype);
return tif_returns( tag, "", array);
} else {
ret_t tmp_res;
tmp_res.returnmsg=NULL;
tmp_res.returncode=0;
return tmp_res;
return ret;
}
/* we check only count, because we evaluate only int-values */
}

17
src/tagrules/check_tag_has_value.c

@ -17,18 +17,19 @@
ret_t check_tag_has_value(ctiff_t * ctif, tag_t tag, unsigned int value) {
// printf("check if tag %u (%s) has value %u\n", tag, TIFFTagName( tag), value);
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
tifp_check( ctif);
// tif_rules_tag(tag, "has value");
ret_t ret;
ret = check_tag_has_valid_type( ctif, tag);
if (ret.returncode == 0) {
ret = check_tag_has_value_quiet( ctif, tag, value);
if (ret.returncode == 0) {
return ret;
res = check_tag_has_valid_type( ctif, tag);
if (res.returncode == 0) {
res = check_tag_has_value_quiet( ctif, tag, value);
if (res.returncode == 0) {
return res;
}
}
return tif_fails_by_returns( ret );
return tif_fails_by_returns( res );
}

6
src/tagrules/check_tag_has_value_in_range.c

@ -18,12 +18,14 @@
*/
ret_t check_tag_has_value_in_range(ctiff_t * ctif, tag_t tag, unsigned int a, unsigned int b) {
//printf("check if tag %u (%s) has value in range %u - %u\n", tag, TIFFTagName(tif, tag), a, b);
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
tifp_check( ctif);
char msg[EXPECTSTRLEN];
snprintf(msg, sizeof(msg), "has value in range %u - %u", a, b);
tif_rules_tag(tag, strdup(msg));
ret_t res = check_tag_has_valid_type( ctif, tag);
res = check_tag_has_valid_type( ctif, tag);
if (res.returncode == 0) {
if (a > b) { unsigned int c=a; a=b; b=c; }
TIFFDataType datatype = TIFFGetRawTagType( ctif, tag );

8
src/tagrules/check_tag_has_value_quiet.c

@ -17,8 +17,11 @@
ret_t check_tag_has_value_quiet(ctiff_t * ctif, tag_t tag, unsigned int expected_value) {
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
tifp_check( ctif);
ifd_entry_t ifd_entry = TIFFGetRawIFDEntry(ctif, tag);
ifd_entry_t ifd_entry = TIFFGetRawIFDEntry(ctif, tag);
if (ifd_entry.count > 1) {
char array[VALUESTRLEN];
snprintf(array, sizeof(array), "but has type:%i and count:%i",ifd_entry.datatype, ifd_entry.count);
@ -54,7 +57,6 @@ ret_t check_tag_has_value_quiet(ctiff_t * ctif, tag_t tag, unsigned int expected
};
};
ret_t ret;
ret.returncode=0; ret.returnmsg=NULL; return ret;
return res;
}
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 smarttab expandtab :*/

183
src/tagrules/check_tag_has_valuelist.c

@ -16,127 +16,126 @@
*/
ret_t check_tag_has_valuelist(ctiff_t * ctif, tag_t tag, int count, unsigned int * values) {
//printf("check if tag %u (%s) has these %i-values", tag, TIFFTagName(tif, tag), count);
ret_t res;
res.returnmsg=NULL;
res.returncode=0;
tifp_check( ctif);
if (count < 0) {
perror ("count should be positive!");
exit( EXIT_FAILURE );
perror ("count should be positive!");
exit( EXIT_FAILURE );
}
char msg[EXPECTSTRLEN];
snprintf(msg, sizeof(msg), "has these %i-values: ", count);
unsigned int * p = values;
for (int i=0; i< count; i++) {
if (0 < i) { secstrcat (msg, ", ", EXPECTSTRLEN);
}
}
secstrcat (msg, int2str(*p), EXPECTSTRLEN);
p++;
}
tif_rules_tag(tag, strdup(msg));
ret_t res = check_tag_has_valid_type( ctif, tag);
if (res.returncode == 0) {
res = check_tag_has_valid_type( ctif, tag);
if (res.returncode == 0) {
unsigned int v[count];
for (int i=0; i< count; i++) {
v[i] = *values;
values++;
}
ifd_entry_t ifd_entry = TIFFGetRawIFDEntry(ctif, tag);
if (count != ifd_entry.count) {
char expected[EXPECTSTRLEN];
snprintf(expected, sizeof(expected), "list has %u values", count);
char value[VALUESTRLEN];
snprintf(value, sizeof(value), "has %u values", ifd_entry.count);
return tif_fails_tag( tag, strdup(expected), strdup(value));
}
ret_t tmp_res;
tmp_res.returncode=0;
tmp_res.returnmsg=NULL;
switch (ifd_entry.datatype) {
case TIFF_LONG: {
/* value */
if (ifd_entry.value_or_offset == is_value) {
for (int i=0; i< count; i++) {
if (v[i] != ifd_entry.data32) {
char expected[EXPECTSTRLEN];
snprintf(expected, sizeof(expected), "at [%u]=%u", i, v[i]);
char value[VALUESTRLEN];
snprintf(value, sizeof(value), "at [%u]=%u", i, ifd_entry.data32);
return tif_fails_tag( tag, strdup(expected), strdup(value));
//tif_fails_tag( tag2str(tif, tag), "tag %u (%s), tagvalue[%i]=%u differs from value=%u (long)\n", tag, TIFFTagName(tif, tag), i, ifd_entry.data32, v[i]);
unsigned int v[count];
for (int i=0; i< count; i++) {
v[i] = *values;
values++;
}
ifd_entry_t ifd_entry = TIFFGetRawIFDEntry(ctif, tag);
if (count != ifd_entry.count) {
char expected[EXPECTSTRLEN];
snprintf(expected, sizeof(expected), "list has %u values", count);
char value[VALUESTRLEN];
snprintf(value, sizeof(value), "has %u values", ifd_entry.count);
return tif_fails_tag( tag, strdup(expected), strdup(value));
}
switch (ifd_entry.datatype) {
case TIFF_LONG: {
/* value */
if (ifd_entry.value_or_offset == is_value) {
for (int i=0; i< count; i++) {
if (v[i] != ifd_entry.data32) {
char expected[EXPECTSTRLEN];
snprintf(expected, sizeof(expected), "at [%u]=%u", i, v[i]);
char value[VALUESTRLEN];
snprintf(value, sizeof(value), "at [%u]=%u", i, ifd_entry.data32);
return tif_fails_tag( tag, strdup(expected), strdup(value));
//tif_fails_tag( tag2str(tif, tag), "tag %u (%s), tagvalue[%i]=%u differs from value=%u (long)\n", tag, TIFFTagName(tif, tag), i, ifd_entry.data32, v[i]);
}
}
}
}
/* offset */
if (ifd_entry.value_or_offset == is_offset) {
offset_t offset = read_offsetdata(ctif, ifd_entry.data32offset, count, ifd_entry.datatype);
uint32 * p = offset.data32p;
for (int i=0; i< count; i++) {
uint32 pval = *p;
/* offset */
if (ifd_entry.value_or_offset == is_offset) {
offset_t offset = read_offsetdata(ctif, ifd_entry.data32offset, count, ifd_entry.datatype);
uint32 * p = offset.data32p;
for (int i=0; i< count; i++) {
uint32 pval = *p;
#ifdef DEBUG
printf("OFFSET: v[%i]=%u p[%i]=%u\n", i,v[i],i,pval);
printf("OFFSET: v[%i]=%u p[%i]=%u\n", i,v[i],i,pval);
#endif
if (v[i] != *p) {
char expected[EXPECTSTRLEN];
snprintf(expected, sizeof(expected), "at [%u]=%u", i, v[i]);
char value[VALUESTRLEN];
snprintf(value, sizeof(value), "at [%u]=%u", i, pval);
return tif_fails_tag( tag, strdup(expected), strdup(value));
if (v[i] != *p) {
char expected[EXPECTSTRLEN];
snprintf(expected, sizeof(expected), "at [%u]=%u", i, v[i]);
char value[VALUESTRLEN];
snprintf(value, sizeof(value), "at [%u]=%u", i, pval);
return tif_fails_tag( tag, strdup(expected), strdup(value));
}
p++;
}
p++;
}
}
return tmp_res;
break;
}
case TIFF_SHORT: {
/* value */
if (ifd_entry.value_or_offset == is_value) {
for (int i=0; i< count; i++) {
int c = (v[i]) == (ifd_entry.data16[i]);
if (!c) {
char expected[EXPECTSTRLEN];
snprintf(expected, sizeof(expected), "at [%u]=%u", i, v[i]);
char value[VALUESTRLEN];
snprintf(value, sizeof(value), "at [%u]=%u", i, ifd_entry.data16[i]);
return tif_fails_tag( tag, strdup(expected), strdup(value));
//tif_fails("tag %u (%s), tagvalue[%i]=%u differs from value[%i]=%u (short)\n", tag, TIFFTagName(tif, tag), i, ifd_entry.data16[i], i, v[i]);
return res;
break;
}
case TIFF_SHORT: {
/* value */
if (ifd_entry.value_or_offset == is_value) {
for (int i=0; i< count; i++) {
int c = (v[i]) == (ifd_entry.data16[i]);
if (!c) {
char expected[EXPECTSTRLEN];
snprintf(expected, sizeof(expected), "at [%u]=%u", i, v[i]);
char value[VALUESTRLEN];
snprintf(value, sizeof(value), "at [%u]=%u", i, ifd_entry.data16[i]);
return tif_fails_tag( tag, strdup(expected), strdup(value));
//tif_fails("tag %u (%s), tagvalue[%i]=%u differs from value[%i]=%u (short)\n", tag, TIFFTagName(tif, tag), i, ifd_entry.data16[i], i, v[i]);
}
}
}
}
/* offset */
if (ifd_entry.value_or_offset == is_offset) {
offset_t offset = read_offsetdata(ctif, ifd_entry.data32offset, count, ifd_entry.datatype);
uint16 * p = offset.data16p;
for (int i=0; i< count; i++) {
uint16 pval = *p;
/* offset */
if (ifd_entry.value_or_offset == is_offset) {
offset_t offset = read_offsetdata(ctif, ifd_entry.data32offset, count, ifd_entry.datatype);
uint16 * p = offset.data16p;
for (int i=0; i< count; i++) {
uint16 pval = *p;
#ifdef DEBUG
printf("SHORTOFFSET (tag=%i): v[%i]=%u p[%i]=0x%04x\n", tag, i,v[i],i,pval);
printf("SHORTOFFSET (tag=%i): v[%i]=%u p[%i]=0x%04x\n", tag, i,v[i],i,pval);
#endif
if (v[i] != pval) {
char expected[EXPECTSTRLEN];
snprintf(expected, sizeof(expected), "at [%u]=%u", i, v[i]);
char value[VALUESTRLEN];
snprintf(value, sizeof(value), "at [%u]=%u", i, pval);
return tif_fails_tag( tag, strdup(expected), strdup(value));
// tif_fails("tag %u (%s), tagvalue[%i]=%u differs from value=%u (short offset)\n", tag, TIFFTagName(tif, tag), i, pval, v[i]);
if (v[i] != pval) {
char expected[EXPECTSTRLEN];
snprintf(expected, sizeof(expected), "at [%u]=%u", i, v[i]);
char value[VALUESTRLEN];
snprintf(value, sizeof(value), "at [%u]=%u", i, pval);
return tif_fails_tag( tag, strdup(expected), strdup(value));
// tif_fails("tag %u (%s), tagvalue[%i]=%u differs from value=%u (short offset)\n", tag, TIFFTagName(tif, tag), i, pval, v[i]);
}
p++;
}
p++;
}
}
return tmp_res;
break;
}
default: /* none */
{
char array[VALUESTRLEN];
snprintf(array, sizeof(array), "type:%i", ifd_entry.datatype);
return tif_fails_tag( tag, "of type long, short or float", array);
}
return res;
break;
}
default: /* none */
{
char array[VALUESTRLEN];
snprintf(array, sizeof(array), "type:%i", ifd_entry.datatype);
return tif_fails_tag( tag, "of type long, short or float", array);
}
}
}
}
return tif_fails_by_returns( res );
}
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 smarttab expandtab :*/

2
src/tagrules/check_tag_quiet.c

@ -13,9 +13,9 @@
/* checks if TIF has a specified tag */
ret_t check_tag_quiet(ctiff_t * ctif, tag_t tag) {
tifp_check( ctif);
ret_t res;
res.returnmsg=NULL;
tifp_check( ctif);
if (-1 < TIFFGetRawTagListIndex(ctif, tag)) {
res.returncode=0;
return res;

Loading…
Cancel
Save