ReactOS  0.4.14-dev-55-g2da92ac
tif_dirinfo.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1988-1997 Sam Leffler
3  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
4  *
5  * Permission to use, copy, modify, distribute, and sell this software and
6  * its documentation for any purpose is hereby granted without fee, provided
7  * that (i) the above copyright notices and this permission notice appear in
8  * all copies of the software and related documentation, and (ii) the names of
9  * Sam Leffler and Silicon Graphics may not be used in any advertising or
10  * publicity relating to the software without the specific, prior written
11  * permission of Sam Leffler and Silicon Graphics.
12  *
13  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
14  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
15  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
18  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
19  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
21  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
22  * OF THIS SOFTWARE.
23  */
24 
25 /*
26  * TIFF Library.
27  *
28  * Core Directory Tag Support.
29  */
30 #include <precomp.h>
31 //#include <stdlib.h>
32 
33 /*
34  * NOTE: THIS ARRAY IS ASSUMED TO BE SORTED BY TAG.
35  *
36  * NOTE: The second field (field_readcount) and third field (field_writecount)
37  * sometimes use the values TIFF_VARIABLE (-1), TIFF_VARIABLE2 (-3)
38  * and TIFF_SPP (-2). The macros should be used but would throw off
39  * the formatting of the code, so please interpret the -1, -2 and -3
40  * values accordingly.
41  */
42 
43 /* const object should be initialized */
44 #ifdef _MSC_VER
45 #pragma warning( push )
46 #pragma warning( disable : 4132 )
47 #endif
50 #ifdef _MSC_VER
51 #pragma warning( pop )
52 #endif
53 
54 static const TIFFField
62  { TIFFTAG_PHOTOMETRIC, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_PHOTOMETRIC, 0, 0, "PhotometricInterpretation", NULL },
123  /* begin SGI tags */
128  /* end SGI tags */
129  /* begin Pixar tags */
133  { TIFFTAG_PIXAR_WRAPMODES, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "TextureWrapModes", NULL },
134  { TIFFTAG_PIXAR_FOVCOT, 1, 1, TIFF_FLOAT, 0, TIFF_SETGET_FLOAT, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FieldOfViewCotangent", NULL },
140  /* end Pixar tags */
145  { TIFFTAG_GPSIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "GPSIFDOffset", NULL },
151  { TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_UNDEFINED, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InteroperabilityIFDOffset", NULL },
152  /* begin DNG tags */
155  { TIFFTAG_UNIQUECAMERAMODEL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "UniqueCameraModel", NULL },
183  { TIFFTAG_CAMERASERIALNUMBER, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "CameraSerialNumber", NULL },
202  /* end DNG tags */
203  /* begin TIFF/FX tags */
205  { TIFFTAG_GLOBALPARAMETERSIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "GlobalParametersIFD", NULL },
216  /* end TIFF/FX tags */
217  /* begin pseudo tags */
218 };
219 
220 static const TIFFField
225  { EXIFTAG_SPECTRALSENSITIVITY, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SpectralSensitivity", NULL },
227  { EXIFTAG_OECF, -1, -1, TIFF_UNDEFINED, 0, TIFF_SETGET_C16_UINT8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 1, "OptoelectricConversionFactor", NULL },
229  { EXIFTAG_DATETIMEORIGINAL, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DateTimeOriginal", NULL },
230  { EXIFTAG_DATETIMEDIGITIZED, 20, 20, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "DateTimeDigitized", NULL },
247  { EXIFTAG_SUBSECTIMEORIGINAL, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubSecTimeOriginal", NULL },
248  { EXIFTAG_SUBSECTIMEDIGITIZED, -1, -1, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "SubSecTimeDigitized", NULL },
253  { EXIFTAG_RELATEDSOUNDFILE, 13, 13, TIFF_ASCII, 0, TIFF_SETGET_ASCII, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "RelatedSoundFile", NULL },
258  { EXIFTAG_FOCALPLANERESOLUTIONUNIT, 1, 1, TIFF_SHORT, 0, TIFF_SETGET_UINT16, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 1, 0, "FocalPlaneResolutionUnit", NULL },
278 };
279 
280 static const TIFFFieldArray
282 static const TIFFFieldArray
284 
285 /*
286  * We have our own local lfind() equivalent to avoid subtle differences
287  * in types passed to lfind() on different systems.
288  */
289 
290 static void *
291 td_lfind(const void *key, const void *base, size_t *nmemb, size_t size,
292  int(*compar)(const void *, const void *))
293 {
294  char *element, *end;
295 
296  end = (char *)base + *nmemb * size;
297  for (element = (char *)base; element < end; element += size)
298  if (!compar(key, element)) /* key found */
299  return element;
300 
301  return NULL;
302 }
303 
304 const TIFFFieldArray*
306 {
307  return(&tiffFieldArray);
308 }
309 
310 const TIFFFieldArray*
312 {
313  return(&exifFieldArray);
314 }
315 
316 void
317 _TIFFSetupFields(TIFF* tif, const TIFFFieldArray* fieldarray)
318 {
319  if (tif->tif_fields && tif->tif_nfields > 0) {
320  uint32 i;
321 
322  for (i = 0; i < tif->tif_nfields; i++) {
323  TIFFField *fld = tif->tif_fields[i];
324  if (fld->field_bit == FIELD_CUSTOM &&
325  strncmp("Tag ", fld->field_name, 4) == 0) {
326  _TIFFfree(fld->field_name);
327  _TIFFfree(fld);
328  }
329  }
330 
331  _TIFFfree(tif->tif_fields);
332  tif->tif_fields = NULL;
333  tif->tif_nfields = 0;
334  }
335  if (!_TIFFMergeFields(tif, fieldarray->fields, fieldarray->count)) {
336  TIFFErrorExt(tif->tif_clientdata, "_TIFFSetupFields",
337  "Setting up field info failed");
338  }
339 }
340 
341 static int
342 tagCompare(const void* a, const void* b)
343 {
344  const TIFFField* ta = *(const TIFFField**) a;
345  const TIFFField* tb = *(const TIFFField**) b;
346  /* NB: be careful of return values for 16-bit platforms */
347  if (ta->field_tag != tb->field_tag)
348  return (int)ta->field_tag - (int)tb->field_tag;
349  else
350  return (ta->field_type == TIFF_ANY) ?
351  0 : ((int)tb->field_type - (int)ta->field_type);
352 }
353 
354 static int
355 tagNameCompare(const void* a, const void* b)
356 {
357  const TIFFField* ta = *(const TIFFField**) a;
358  const TIFFField* tb = *(const TIFFField**) b;
359  int ret = strcmp(ta->field_name, tb->field_name);
360 
361  if (ret)
362  return ret;
363  else
364  return (ta->field_type == TIFF_ANY) ?
365  0 : ((int)tb->field_type - (int)ta->field_type);
366 }
367 
368 int
370 {
371  static const char module[] = "_TIFFMergeFields";
372  static const char reason[] = "for fields array";
373  /* TIFFField** tp; */
374  uint32 i;
375 
376  tif->tif_foundfield = NULL;
377 
378  if (tif->tif_fields && tif->tif_nfields > 0) {
379  tif->tif_fields = (TIFFField**)
380  _TIFFCheckRealloc(tif, tif->tif_fields,
381  (tif->tif_nfields + n),
382  sizeof(TIFFField *), reason);
383  } else {
384  tif->tif_fields = (TIFFField **)
385  _TIFFCheckMalloc(tif, n, sizeof(TIFFField *),
386  reason);
387  }
388  if (!tif->tif_fields) {
390  "Failed to allocate fields array");
391  return 0;
392  }
393 
394  /* tp = tif->tif_fields + tif->tif_nfields; */
395  for (i = 0; i < n; i++) {
396  const TIFFField *fip =
397  TIFFFindField(tif, info[i].field_tag, TIFF_ANY);
398 
399  /* only add definitions that aren't already present */
400  if (!fip) {
401  tif->tif_fields[tif->tif_nfields] = (TIFFField *) (info+i);
402  tif->tif_nfields++;
403  }
404  }
405 
406  /* Sort the field info by tag number */
407  qsort(tif->tif_fields, tif->tif_nfields,
408  sizeof(TIFFField *), tagCompare);
409 
410  return n;
411 }
412 
413 void
415 {
416  uint32 i;
417 
418  fprintf(fd, "%s: \n", tif->tif_name);
419  for (i = 0; i < tif->tif_nfields; i++) {
420  const TIFFField* fip = tif->tif_fields[i];
421  fprintf(fd, "field[%2d] %5lu, %2d, %2d, %d, %2d, %5s, %5s, %s\n"
422  , (int)i
423  , (unsigned long) fip->field_tag
424  , fip->field_readcount, fip->field_writecount
425  , fip->field_type
426  , fip->field_bit
427  , fip->field_oktochange ? "TRUE" : "FALSE"
428  , fip->field_passcount ? "TRUE" : "FALSE"
429  , fip->field_name
430  );
431  }
432 }
433 
434 /*
435  * Return size of TIFFDataType in bytes
436  */
437 int
439 {
440  switch(type)
441  {
442  case 0: /* nothing */
443  case TIFF_BYTE:
444  case TIFF_ASCII:
445  case TIFF_SBYTE:
446  case TIFF_UNDEFINED:
447  return 1;
448  case TIFF_SHORT:
449  case TIFF_SSHORT:
450  return 2;
451  case TIFF_LONG:
452  case TIFF_SLONG:
453  case TIFF_FLOAT:
454  case TIFF_IFD:
455  return 4;
456  case TIFF_RATIONAL:
457  case TIFF_SRATIONAL:
458  case TIFF_DOUBLE:
459  case TIFF_LONG8:
460  case TIFF_SLONG8:
461  case TIFF_IFD8:
462  return 8;
463  default:
464  return 0; /* will return 0 for unknown types */
465  }
466 }
467 
468 /*
469  * Return size of TIFFDataType in bytes.
470  *
471  * XXX: We need a separate function to determine the space needed
472  * to store the value. For TIFF_RATIONAL values TIFFDataWidth() returns 8,
473  * but we use 4-byte float to represent rationals.
474  */
475 int
477 {
478  switch (type)
479  {
480  case TIFF_BYTE:
481  case TIFF_SBYTE:
482  case TIFF_ASCII:
483  case TIFF_UNDEFINED:
484  return 1;
485  case TIFF_SHORT:
486  case TIFF_SSHORT:
487  return 2;
488  case TIFF_LONG:
489  case TIFF_SLONG:
490  case TIFF_FLOAT:
491  case TIFF_IFD:
492  case TIFF_RATIONAL:
493  case TIFF_SRATIONAL:
494  return 4;
495  case TIFF_DOUBLE:
496  case TIFF_LONG8:
497  case TIFF_SLONG8:
498  case TIFF_IFD8:
499  return 8;
500  default:
501  return 0;
502  }
503 }
504 
505 const TIFFField*
507 {
508  TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
509  TIFFField* pkey = &key;
510  const TIFFField **ret;
511  if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag &&
512  (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
513  return tif->tif_foundfield;
514 
515  /* If we are invoked with no field information, then just return. */
516  if (!tif->tif_fields)
517  return NULL;
518 
519  /* NB: use sorted search (e.g. binary search) */
520 
521  key.field_tag = tag;
522  key.field_type = dt;
523 
524  ret = (const TIFFField **) bsearch(&pkey, tif->tif_fields,
525  tif->tif_nfields,
526  sizeof(TIFFField *), tagCompare);
527  return tif->tif_foundfield = (ret ? *ret : NULL);
528 }
529 
530 static const TIFFField*
531 _TIFFFindFieldByName(TIFF* tif, const char *field_name, TIFFDataType dt)
532 {
533  TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
534  TIFFField* pkey = &key;
535  const TIFFField **ret;
536  if (tif->tif_foundfield
537  && streq(tif->tif_foundfield->field_name, field_name)
538  && (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
539  return (tif->tif_foundfield);
540 
541  /* If we are invoked with no field information, then just return. */
542  if (!tif->tif_fields)
543  return NULL;
544 
545  /* NB: use linear search since list is sorted by key#, not name */
546 
547  key.field_name = (char *)field_name;
548  key.field_type = dt;
549 
550  ret = (const TIFFField **)
551  td_lfind(&pkey, tif->tif_fields, &tif->tif_nfields,
552  sizeof(TIFFField *), tagNameCompare);
553 
554  return tif->tif_foundfield = (ret ? *ret : NULL);
555 }
556 
557 const TIFFField*
559 {
560  const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY);
561  if (!fip) {
562  TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithTag",
563  "Internal error, unknown tag 0x%x",
564  (unsigned int) tag);
565  }
566  return (fip);
567 }
568 
569 const TIFFField*
570 TIFFFieldWithName(TIFF* tif, const char *field_name)
571 {
572  const TIFFField* fip =
573  _TIFFFindFieldByName(tif, field_name, TIFF_ANY);
574  if (!fip) {
575  TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithName",
576  "Internal error, unknown tag %s", field_name);
577  }
578  return (fip);
579 }
580 
581 uint32
583 {
584  return fip->field_tag;
585 }
586 
587 const char *
589 {
590  return fip->field_name;
591 }
592 
595 {
596  return fip->field_type;
597 }
598 
599 int
601 {
602  return fip->field_passcount;
603 }
604 
605 int
607 {
608  return fip->field_readcount;
609 }
610 
611 int
613 {
614  return fip->field_writecount;
615 }
616 
617 const TIFFField*
619 
620 {
621  const TIFFField *fld;
622 
623  fld = TIFFFindField(tif, tag, dt);
624  if (fld == NULL) {
625  fld = _TIFFCreateAnonField(tif, tag, dt);
626  if (!_TIFFMergeFields(tif, fld, 1))
627  return NULL;
628  }
629 
630  return fld;
631 }
632 
633 TIFFField*
635 {
636  TIFFField *fld;
637  (void) tif;
638 
639  fld = (TIFFField *) _TIFFmalloc(sizeof (TIFFField));
640  if (fld == NULL)
641  return NULL;
642  _TIFFmemset(fld, 0, sizeof(TIFFField));
643 
644  fld->field_tag = tag;
647  fld->field_type = field_type;
648  fld->reserved = 0;
649  switch (field_type)
650  {
651  case TIFF_BYTE:
652  case TIFF_UNDEFINED:
655  break;
656  case TIFF_ASCII:
659  break;
660  case TIFF_SHORT:
663  break;
664  case TIFF_LONG:
667  break;
668  case TIFF_RATIONAL:
669  case TIFF_SRATIONAL:
670  case TIFF_FLOAT:
673  break;
674  case TIFF_SBYTE:
677  break;
678  case TIFF_SSHORT:
681  break;
682  case TIFF_SLONG:
685  break;
686  case TIFF_DOUBLE:
689  break;
690  case TIFF_IFD:
691  case TIFF_IFD8:
694  break;
695  case TIFF_LONG8:
698  break;
699  case TIFF_SLONG8:
702  break;
703  default:
706  break;
707  }
708  fld->field_bit = FIELD_CUSTOM;
709  fld->field_oktochange = TRUE;
710  fld->field_passcount = TRUE;
711  fld->field_name = (char *) _TIFFmalloc(32);
712  if (fld->field_name == NULL) {
713  _TIFFfree(fld);
714  return NULL;
715  }
716  fld->field_subfields = NULL;
717 
718  /*
719  * note that this name is a special sign to TIFFClose() and
720  * _TIFFSetupFields() to free the field
721  */
722  (void) snprintf(fld->field_name, 32, "Tag %d", (int) tag);
723 
724  return fld;
725 }
726 
727 /****************************************************************************
728  * O B S O L E T E D I N T E R F A C E S
729  *
730  * Don't use this stuff in your applications, it may be removed in the future
731  * libtiff versions.
732  ****************************************************************************/
733 
734 static TIFFSetGetFieldType
735 _TIFFSetGetType(TIFFDataType type, short count, unsigned char passcount)
736 {
737  if (type == TIFF_ASCII && count == TIFF_VARIABLE && passcount == 0)
738  return TIFF_SETGET_ASCII;
739 
740  else if (count == 1 && passcount == 0) {
741  switch (type)
742  {
743  case TIFF_BYTE:
744  case TIFF_UNDEFINED:
745  return TIFF_SETGET_UINT8;
746  case TIFF_ASCII:
747  return TIFF_SETGET_ASCII;
748  case TIFF_SHORT:
749  return TIFF_SETGET_UINT16;
750  case TIFF_LONG:
751  return TIFF_SETGET_UINT32;
752  case TIFF_RATIONAL:
753  case TIFF_SRATIONAL:
754  case TIFF_FLOAT:
755  return TIFF_SETGET_FLOAT;
756  case TIFF_SBYTE:
757  return TIFF_SETGET_SINT8;
758  case TIFF_SSHORT:
759  return TIFF_SETGET_SINT16;
760  case TIFF_SLONG:
761  return TIFF_SETGET_SINT32;
762  case TIFF_DOUBLE:
763  return TIFF_SETGET_DOUBLE;
764  case TIFF_IFD:
765  case TIFF_IFD8:
766  return TIFF_SETGET_IFD8;
767  case TIFF_LONG8:
768  return TIFF_SETGET_UINT64;
769  case TIFF_SLONG8:
770  return TIFF_SETGET_SINT64;
771  default:
772  return TIFF_SETGET_UNDEFINED;
773  }
774  }
775 
776  else if (count >= 1 && passcount == 0) {
777  switch (type)
778  {
779  case TIFF_BYTE:
780  case TIFF_UNDEFINED:
781  return TIFF_SETGET_C0_UINT8;
782  case TIFF_ASCII:
783  return TIFF_SETGET_C0_ASCII;
784  case TIFF_SHORT:
785  return TIFF_SETGET_C0_UINT16;
786  case TIFF_LONG:
787  return TIFF_SETGET_C0_UINT32;
788  case TIFF_RATIONAL:
789  case TIFF_SRATIONAL:
790  case TIFF_FLOAT:
791  return TIFF_SETGET_C0_FLOAT;
792  case TIFF_SBYTE:
793  return TIFF_SETGET_C0_SINT8;
794  case TIFF_SSHORT:
795  return TIFF_SETGET_C0_SINT16;
796  case TIFF_SLONG:
797  return TIFF_SETGET_C0_SINT32;
798  case TIFF_DOUBLE:
799  return TIFF_SETGET_C0_DOUBLE;
800  case TIFF_IFD:
801  case TIFF_IFD8:
802  return TIFF_SETGET_C0_IFD8;
803  case TIFF_LONG8:
804  return TIFF_SETGET_C0_UINT64;
805  case TIFF_SLONG8:
806  return TIFF_SETGET_C0_SINT64;
807  default:
808  return TIFF_SETGET_UNDEFINED;
809  }
810  }
811 
812  else if (count == TIFF_VARIABLE && passcount == 1) {
813  switch (type)
814  {
815  case TIFF_BYTE:
816  case TIFF_UNDEFINED:
817  return TIFF_SETGET_C16_UINT8;
818  case TIFF_ASCII:
819  return TIFF_SETGET_C16_ASCII;
820  case TIFF_SHORT:
821  return TIFF_SETGET_C16_UINT16;
822  case TIFF_LONG:
823  return TIFF_SETGET_C16_UINT32;
824  case TIFF_RATIONAL:
825  case TIFF_SRATIONAL:
826  case TIFF_FLOAT:
827  return TIFF_SETGET_C16_FLOAT;
828  case TIFF_SBYTE:
829  return TIFF_SETGET_C16_SINT8;
830  case TIFF_SSHORT:
831  return TIFF_SETGET_C16_SINT16;
832  case TIFF_SLONG:
833  return TIFF_SETGET_C16_SINT32;
834  case TIFF_DOUBLE:
835  return TIFF_SETGET_C16_DOUBLE;
836  case TIFF_IFD:
837  case TIFF_IFD8:
838  return TIFF_SETGET_C16_IFD8;
839  case TIFF_LONG8:
840  return TIFF_SETGET_C16_UINT64;
841  case TIFF_SLONG8:
842  return TIFF_SETGET_C16_SINT64;
843  default:
844  return TIFF_SETGET_UNDEFINED;
845  }
846  }
847 
848  else if (count == TIFF_VARIABLE2 && passcount == 1) {
849  switch (type)
850  {
851  case TIFF_BYTE:
852  case TIFF_UNDEFINED:
853  return TIFF_SETGET_C32_UINT8;
854  case TIFF_ASCII:
855  return TIFF_SETGET_C32_ASCII;
856  case TIFF_SHORT:
857  return TIFF_SETGET_C32_UINT16;
858  case TIFF_LONG:
859  return TIFF_SETGET_C32_UINT32;
860  case TIFF_RATIONAL:
861  case TIFF_SRATIONAL:
862  case TIFF_FLOAT:
863  return TIFF_SETGET_C32_FLOAT;
864  case TIFF_SBYTE:
865  return TIFF_SETGET_C32_SINT8;
866  case TIFF_SSHORT:
867  return TIFF_SETGET_C32_SINT16;
868  case TIFF_SLONG:
869  return TIFF_SETGET_C32_SINT32;
870  case TIFF_DOUBLE:
871  return TIFF_SETGET_C32_DOUBLE;
872  case TIFF_IFD:
873  case TIFF_IFD8:
874  return TIFF_SETGET_C32_IFD8;
875  case TIFF_LONG8:
876  return TIFF_SETGET_C32_UINT64;
877  case TIFF_SLONG8:
878  return TIFF_SETGET_C32_SINT64;
879  default:
880  return TIFF_SETGET_UNDEFINED;
881  }
882  }
883 
884  return TIFF_SETGET_UNDEFINED;
885 }
886 
887 int
889 {
890  static const char module[] = "TIFFMergeFieldInfo";
891  static const char reason[] = "for fields array";
892  TIFFField *tp;
893  size_t nfields;
894  uint32 i;
895 
896  if (tif->tif_nfieldscompat > 0) {
899  tif->tif_nfieldscompat + 1,
900  sizeof(TIFFFieldArray), reason);
901  } else {
903  _TIFFCheckMalloc(tif, 1, sizeof(TIFFFieldArray),
904  reason);
905  }
906  if (!tif->tif_fieldscompat) {
908  "Failed to allocate fields array");
909  return -1;
910  }
911  nfields = tif->tif_nfieldscompat++;
912 
913  tif->tif_fieldscompat[nfields].type = tfiatOther;
914  tif->tif_fieldscompat[nfields].allocated_size = n;
915  tif->tif_fieldscompat[nfields].count = n;
916  tif->tif_fieldscompat[nfields].fields =
917  (TIFFField *)_TIFFCheckMalloc(tif, n, sizeof(TIFFField),
918  reason);
919  if (!tif->tif_fieldscompat[nfields].fields) {
921  "Failed to allocate fields array");
922  return -1;
923  }
924 
925  tp = tif->tif_fieldscompat[nfields].fields;
926  for (i = 0; i < n; i++) {
927  tp->field_tag = info[i].field_tag;
928  tp->field_readcount = info[i].field_readcount;
929  tp->field_writecount = info[i].field_writecount;
930  tp->field_type = info[i].field_type;
931  tp->reserved = 0;
932  tp->set_field_type =
933  _TIFFSetGetType(info[i].field_type,
934  info[i].field_readcount,
935  info[i].field_passcount);
936  tp->get_field_type =
937  _TIFFSetGetType(info[i].field_type,
938  info[i].field_readcount,
939  info[i].field_passcount);
940  tp->field_bit = info[i].field_bit;
941  tp->field_oktochange = info[i].field_oktochange;
942  tp->field_passcount = info[i].field_passcount;
943  tp->field_name = info[i].field_name;
944  tp->field_subfields = NULL;
945  tp++;
946  }
947 
948  if (!_TIFFMergeFields(tif, tif->tif_fieldscompat[nfields].fields, n)) {
950  "Setting up field info failed");
951  return -1;
952  }
953 
954  return 0;
955 }
956 
957 int
959 {
960  /* Filter out non-codec specific tags */
961  switch (tag) {
962  /* Shared tags */
963  case TIFFTAG_PREDICTOR:
964  /* JPEG tags */
965  case TIFFTAG_JPEGTABLES:
966  /* OJPEG tags */
969  case TIFFTAG_JPEGQTABLES:
972  case TIFFTAG_JPEGPROC:
974  /* CCITT* */
975  case TIFFTAG_BADFAXLINES:
980  /* LERC */
982  break;
983  default:
984  return 1;
985  }
986  /* Check if codec specific tags are allowed for the current
987  * compression scheme (codec) */
988  switch (tif->tif_dir.td_compression) {
989  case COMPRESSION_LZW:
990  if (tag == TIFFTAG_PREDICTOR)
991  return 1;
992  break;
994  /* No codec-specific tags */
995  break;
997  /* No codec-specific tags */
998  break;
999  case COMPRESSION_NEXT:
1000  /* No codec-specific tags */
1001  break;
1002  case COMPRESSION_JPEG:
1003  if (tag == TIFFTAG_JPEGTABLES)
1004  return 1;
1005  break;
1006  case COMPRESSION_OJPEG:
1007  switch (tag) {
1008  case TIFFTAG_JPEGIFOFFSET:
1010  case TIFFTAG_JPEGQTABLES:
1011  case TIFFTAG_JPEGDCTABLES:
1012  case TIFFTAG_JPEGACTABLES:
1013  case TIFFTAG_JPEGPROC:
1015  return 1;
1016  }
1017  break;
1018  case COMPRESSION_CCITTRLE:
1019  case COMPRESSION_CCITTRLEW:
1020  case COMPRESSION_CCITTFAX3:
1021  case COMPRESSION_CCITTFAX4:
1022  switch (tag) {
1023  case TIFFTAG_BADFAXLINES:
1024  case TIFFTAG_CLEANFAXDATA:
1026  return 1;
1027  case TIFFTAG_GROUP3OPTIONS:
1029  return 1;
1030  break;
1031  case TIFFTAG_GROUP4OPTIONS:
1033  return 1;
1034  break;
1035  }
1036  break;
1037  case COMPRESSION_JBIG:
1038  /* No codec-specific tags */
1039  break;
1040  case COMPRESSION_DEFLATE:
1042  if (tag == TIFFTAG_PREDICTOR)
1043  return 1;
1044  break;
1045  case COMPRESSION_PIXARLOG:
1046  if (tag == TIFFTAG_PREDICTOR)
1047  return 1;
1048  break;
1049  case COMPRESSION_SGILOG:
1050  case COMPRESSION_SGILOG24:
1051  /* No codec-specific tags */
1052  break;
1053  case COMPRESSION_LZMA:
1054  if (tag == TIFFTAG_PREDICTOR)
1055  return 1;
1056  break;
1057  case COMPRESSION_ZSTD:
1058  if (tag == TIFFTAG_PREDICTOR)
1059  return 1;
1060  break;
1061  case COMPRESSION_LERC:
1063  return 1;
1064  break;
1065  case COMPRESSION_WEBP:
1066  if (tag == TIFFTAG_PREDICTOR)
1067  return 1;
1068  break;
1069  }
1070  return 0;
1071 }
1072 
1073 /* vim: set ts=8 sts=8 sw=8 noet: */
1074 
1075 /*
1076  * Local Variables:
1077  * mode: c
1078  * c-basic-offset: 8
1079  * fill-column: 78
1080  * End:
1081  */
#define TIFFTAG_REDUCTIONMATRIX2
Definition: tiff.h:489
#define TIFFTAG_FREEBYTECOUNTS
Definition: tiff.h:246
#define TIFFTAG_SUBFILETYPE
Definition: tiff.h:146
uint32 ttag_t
Definition: tiffio.h:69
int TIFFFieldWriteCount(const TIFFField *fip)
Definition: tif_dirinfo.c:612
#define TIFFTAG_JPEGTABLES
Definition: tiff.h:325
void _TIFFmemset(void *p, int v, tmsize_t c)
Definition: tif_unix.c:338
#define FIELD_IGNORE
Definition: tif_dir.h:134
#define TIFFTAG_ORIGINALRAWFILENAME
Definition: tiff.h:525
return
Definition: dirsup.c:529
#define TIFF_VARIABLE
Definition: tiffio.h:313
#define COMPRESSION_PACKBITS
Definition: tiff.h:171
#define TIFFTAG_CELLWIDTH
Definition: tiff.h:213
static const TIFFField * _TIFFFindFieldByName(TIFF *tif, const char *field_name, TIFFDataType dt)
Definition: tif_dirinfo.c:531
#define TRUE
Definition: types.h:120
uint32 TIFFFieldTag(const TIFFField *fip)
Definition: tif_dirinfo.c:582
#define FIELD_CUSTOM
Definition: tiffio.h:317
#define TIFFTAG_INTEROPERABILITYIFD
Definition: tiff.h:454
#define TIFFTAG_LINEARIZATIONTABLE
Definition: tiff.h:466
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define TIFFTAG_JPEGIFOFFSET
Definition: tiff.h:358
const TIFFField * _TIFFFindOrRegisterField(TIFF *tif, uint32 tag, TIFFDataType dt)
Definition: tif_dirinfo.c:618
#define EXIFTAG_DEVICESETTINGDESCRIPTION
Definition: tiff.h:680
#define EXIFTAG_FLASHENERGY
Definition: tiff.h:659
#define TIFFTAG_COPYRIGHT
Definition: tiff.h:411
#define FIELD_MINSAMPLEVALUE
Definition: tif_dir.h:152
#define FIELD_RESOLUTION
Definition: tif_dir.h:139
#define TIFFTAG_BITSPERSAMPLE
Definition: tiff.h:156
#define TIFFTAG_ROWSPERSTRIP
Definition: tiff.h:233
TIFFField * _TIFFCreateAnonField(TIFF *tif, uint32 tag, TIFFDataType field_type)
Definition: tif_dirinfo.c:634
#define TIFFTAG_DNGVERSION
Definition: tiff.h:458
#define COMPRESSION_WEBP
Definition: tiff.h:194
#define TIFF_ANY
Definition: tiffio.h:312
#define TIFFTAG_ICCPROFILE
Definition: tiff.h:440
#define FIELD_STRIPOFFSETS
Definition: tif_dir.h:158
#define TIFFTAG_STRIPBYTECOUNTS
Definition: tiff.h:234
#define TIFFTAG_COLORMAP
Definition: tiff.h:284
#define TIFFTAG_MODENUMBER
Definition: tiff.h:347
#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN
Definition: tiff.h:404
#define EXIFTAG_SUBJECTAREA
Definition: tiff.h:648
#define TIFFTAG_EXTRASAMPLES
Definition: tiff.h:304
void * _TIFFCheckRealloc(TIFF *tif, void *buffer, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Definition: tif_aux.c:62
#define TIFFTAG_ORIENTATION
Definition: tiff.h:223
#define TIFFTAG_DECODE
Definition: tiff.h:348
#define FIELD_IMAGEDIMENSIONS
Definition: tif_dir.h:137
#define TIFFTAG_STRIPROWCOUNTS
Definition: tiff.h:372
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define TIFFTAG_ORIGINALRAWFILEDATA
Definition: tiff.h:527
unsigned int uint32
Definition: types.h:32
#define TIFFTAG_IMAGEWIDTH
Definition: tiff.h:154
#define EXIFTAG_COLORSPACE
Definition: tiff.h:655
#define TIFFTAG_YRESOLUTION
Definition: tiff.h:238
#define FIELD_THRESHHOLDING
Definition: tif_dir.h:147
#define EXIFTAG_EXPOSUREINDEX
Definition: tiff.h:665
static int tagNameCompare(const void *a, const void *b)
Definition: tif_dirinfo.c:355
#define TIFFTAG_CALIBRATIONILLUMINANT2
Definition: tiff.h:521
#define TIFFTAG_DATATYPE
Definition: tiff.h:385
#define TIFFTAG_MINSAMPLEVALUE
Definition: tiff.h:235
#define TIFFTAG_BLACKLEVELREPEATDIM
Definition: tiff.h:467
static TIFFSetGetFieldType _TIFFSetGetType(TIFFDataType type, short count, unsigned char passcount)
Definition: tif_dirinfo.c:735
#define EXIFTAG_IMAGEUNIQUEID
Definition: tiff.h:684
#define TIFFTAG_INKNAMES
Definition: tiff.h:300
#define TIFFTAG_FILLORDER
Definition: tiff.h:215
#define COMPRESSION_CCITTFAX3
Definition: tiff.h:160
static const TIFFFieldArray tiffFieldArray
Definition: tif_dirinfo.c:48
#define COMPRESSION_SGILOG24
Definition: tiff.h:188
GLdouble n
Definition: glext.h:7729
#define TIFFTAG_BASELINEEXPOSURE
Definition: tiff.h:498
#define TIFFTAG_COLORMATRIX2
Definition: tiff.h:483
#define snprintf
Definition: wintirpc.h:48
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define TIFFTAG_CONSECUTIVEBADFAXLINES
Definition: tiff.h:295
#define EXIFTAG_FOCALPLANEXRESOLUTION
Definition: tiff.h:661
Definition: ecma_167.h:138
#define EXIFTAG_FOCALPLANERESOLUTIONUNIT
Definition: tiff.h:663
#define FIELD_HALFTONEHINTS
Definition: tif_dir.h:166
const TIFFFieldArray * _TIFFGetFields(void)
Definition: tif_dirinfo.c:305
#define EXIFTAG_MAKERNOTE
Definition: tiff.h:649
#define TIFFTAG_DOTRANGE
Definition: tiff.h:302
static int fd
Definition: io.c:51
TIFFFieldArray * field_subfields
Definition: tif_dir.h:290
#define TIFFTAG_STRIPOFFSETS
Definition: tiff.h:222
#define TIFFTAG_SUBIFD
Definition: tiff.h:296
#define TIFFTAG_PIXAR_FOVCOT
Definition: tiff.h:403
#define TIFFTAG_THRESHHOLDING
Definition: tiff.h:209
#define COMPRESSION_CCITTRLE
Definition: tiff.h:159
#define COMPRESSION_OJPEG
Definition: tiff.h:165
GLuint GLuint end
Definition: gl.h:1545
#define EXIFTAG_PIXELYDIMENSION
Definition: tiff.h:657
#define TIFFTAG_VERSIONYEAR
Definition: tiff.h:346
#define TIFFTAG_GPSIFD
Definition: tiff.h:444
static const TIFFField exifFields[]
Definition: tif_dirinfo.c:221
#define TIFFTAG_PIXAR_IMAGEFULLWIDTH
Definition: tiff.h:396
#define TIFFTAG_YCBCRSUBSAMPLING
Definition: tiff.h:367
#define TIFFTAG_SOFTWARE
Definition: tiff.h:274
thandle_t tif_clientdata
Definition: tiffiop.h:191
#define FIELD_RESOLUTIONUNIT
Definition: tif_dir.h:155
#define TIFFTAG_YPOSITION
Definition: tiff.h:244
#define TIFFTAG_SMINSAMPLEVALUE
Definition: tiff.h:315
int TIFFFieldPassCount(const TIFFField *fip)
Definition: tif_dirinfo.c:600
#define TIFFTAG_REFERENCEBLACKWHITE
Definition: tiff.h:371
#define TIFFTAG_CFAPATTERN
Definition: tiff.h:409
#define TIFFTAG_PLANARCONFIG
Definition: tiff.h:239
#define TIFFTAG_EXIFIFD
Definition: tiff.h:438
#define EXIFTAG_ISOSPEEDRATINGS
Definition: tiff.h:628
#define TIFFTAG_MATTEING
Definition: tiff.h:384
#define TIFFTAG_DATETIME
Definition: tiff.h:275
char * tif_name
Definition: tiffiop.h:103
#define TIFFTAG_ANTIALIASSTRENGTH
Definition: tiff.h:512
#define TIFFTAG_PRIMARYCHROMATICITIES
Definition: tiff.h:283
Definition: tiffiop.h:102
#define FIELD_YCBCRSUBSAMPLING
Definition: tif_dir.h:167
#define TIFFTAG_CURRENTPREPROFILEMATRIX
Definition: tiff.h:537
#define TIFFTAG_CAMERACALIBRATION2
Definition: tiff.h:486
#define FIELD_SMAXSAMPLEVALUE
Definition: tif_dir.h:163
#define TIFFTAG_PERSAMPLE
Definition: tiff.h:607
#define EXIFTAG_DATETIMEORIGINAL
Definition: tiff.h:632
#define TIFFTAG_FAXDCS
Definition: tiff.h:449
#define EXIFTAG_EXPOSURETIME
Definition: tiff.h:624
#define TIFFTAG_TILEBYTECOUNTS
Definition: tiff.h:289
#define TIFFTAG_YCBCRCOEFFICIENTS
Definition: tiff.h:366
#define EXIFTAG_LIGHTSOURCE
Definition: tiff.h:645
unsigned short field_bit
Definition: tif_dir.h:286
#define FIELD_SUBIFD
Definition: tif_dir.h:172
#define FIELD_TRANSFERFUNCTION
Definition: tif_dir.h:170
#define TIFFTAG_CURRENTICCPROFILE
Definition: tiff.h:536
#define FIELD_FILLORDER
Definition: tif_dir.h:148
#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA
Definition: tiff.h:405
#define FIELD_MAXSAMPLEVALUE
Definition: tif_dir.h:153
#define COMPRESSION_DEFLATE
Definition: tiff.h:181
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define EXIFTAG_WHITEBALANCE
Definition: tiff.h:672
#define FIELD_BITSPERSAMPLE
Definition: tif_dir.h:144
#define TIFFTAG_YCBCRPOSITIONING
Definition: tiff.h:368
#define TIFFTAG_PIXAR_WRAPMODES
Definition: tiff.h:402
#define TIFFTAG_MAKERNOTESAFETY
Definition: tiff.h:516
#define TIFFTAG_TILEWIDTH
Definition: tiff.h:286
#define TIFFTAG_IMAGEDESCRIPTION
Definition: tiff.h:219
#define EXIFTAG_SATURATION
Definition: tiff.h:678
char * field_name
Definition: tif_dir.h:289
#define FIELD_STRIPBYTECOUNTS
Definition: tif_dir.h:157
#define TIFFTAG_MASKEDAREAS
Definition: tiff.h:531
GLuint base
Definition: 3dtext.c:35
#define EXIFTAG_FLASH
Definition: tiff.h:646
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define TIFFTAG_LERC_PARAMETERS
Definition: tiff.h:456
#define TIFFTAG_INDEXED
Definition: tiff.h:323
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
void * _TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Definition: tif_aux.c:85
int _TIFFMergeFields(TIFF *tif, const TIFFField info[], uint32 n)
Definition: tif_dirinfo.c:369
#define COMPRESSION_CCITTFAX4
Definition: tiff.h:162
#define streq(a, b)
Definition: mkg3states.c:46
#define EXIFTAG_RELATEDSOUNDFILE
Definition: tiff.h:658
#define EXIFTAG_EXPOSUREBIASVALUE
Definition: tiff.h:641
#define TIFFTAG_LENSINFO
Definition: tiff.h:510
#define TIFFTAG_JPEGACTABLES
Definition: tiff.h:365
#define TIFFTAG_TILELENGTH
Definition: tiff.h:287
#define TIFFTAG_CAMERACALIBRATION1
Definition: tiff.h:485
#define EXIFTAG_USERCOMMENT
Definition: tiff.h:650
#define TIFFTAG_CAMERASERIALNUMBER
Definition: tiff.h:509
short field_writecount
Definition: tif_dir.h:281
smooth NULL
Definition: ftsmooth.c:416
#define EXIFTAG_SHUTTERSPEEDVALUE
Definition: tiff.h:638
#define TIFFTAG_ANALOGBALANCE
Definition: tiff.h:491
#define TIFFTAG_IMAGELENGTH
Definition: tiff.h:155
#define FIELD_PLANARCONFIG
Definition: tif_dir.h:154
size_t tif_nfields
Definition: tiffiop.h:201
#define TIFFTAG_TILEOFFSETS
Definition: tiff.h:288
#define EXIFTAG_SUBJECTLOCATION
Definition: tiff.h:664
#define EXIFTAG_FILESOURCE
Definition: tiff.h:667
#define TIFFTAG_SAMPLESPERPIXEL
Definition: tiff.h:232
TIFFFieldArray * tif_fieldscompat
Definition: tiffiop.h:207
#define TIFFTAG_BAYERGREENSPLIT
Definition: tiff.h:503
#define EXIFTAG_FOCALLENGTH
Definition: tiff.h:647
#define TIFFTAG_JPEGQTABLES
Definition: tiff.h:363
#define TIFFTAG_DNGBACKWARDVERSION
Definition: tiff.h:459
uint32 allocated_size
Definition: tif_dir.h:273
void * _TIFFmalloc(tmsize_t s)
Definition: tif_unix.c:309
TIFFSetGetFieldType get_field_type
Definition: tif_dir.h:285
#define EXIFTAG_EXIFVERSION
Definition: tiff.h:631
#define TIFFTAG_BASELINENOISE
Definition: tiff.h:500
#define TIFFTAG_IMAGEBASECOLOR
Definition: tiff.h:349
#define TIFFTAG_GLOBALPARAMETERSIFD
Definition: tiff.h:328
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2883
unsigned char field_passcount
Definition: tif_dir.h:288
#define TIFFTAG_FREEOFFSETS
Definition: tiff.h:245
#define EXIFTAG_EXPOSUREPROGRAM
Definition: tiff.h:626
#define TIFFTAG_ASSHOTWHITEXY
Definition: tiff.h:495
TIFFSetGetFieldType
Definition: tif_dir.h:199
void _TIFFSetupFields(TIFF *tif, const TIFFFieldArray *fieldarray)
Definition: tif_dirinfo.c:317
#define TIFFTAG_DOCUMENTNAME
Definition: tiff.h:218
#define EXIFTAG_FOCALPLANEYRESOLUTION
Definition: tiff.h:662
#define TIFFTAG_BESTQUALITYSCALE
Definition: tiff.h:522
#define COMPRESSION_CCITTRLEW
Definition: tiff.h:170
#define EXIFTAG_SUBSECTIMEORIGINAL
Definition: tiff.h:652
#define TIFFTAG_XMLPACKET
Definition: tiff.h:373
#define TIFFTAG_BLACKLEVELDELTAH
Definition: tiff.h:470
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TIFFTAG_ASSHOTICCPROFILE
Definition: tiff.h:533
#define TIFFTAG_FAXRECVTIME
Definition: tiff.h:448
#define TIFFTAG_GRAYRESPONSECURVE
Definition: tiff.h:253
GLsizeiptr size
Definition: glext.h:5919
#define EXIFTAG_EXPOSUREMODE
Definition: tiff.h:671
#define EXIFTAG_SHARPNESS
Definition: tiff.h:679
#define EXIFTAG_COMPRESSEDBITSPERPIXEL
Definition: tiff.h:637
#define EXIFTAG_DIGITALZOOMRATIO
Definition: tiff.h:673
#define TIFFTAG_CHROMABLURRADIUS
Definition: tiff.h:511
uint32 field_tag
Definition: tif_dir.h:279
TIFFField * fields
Definition: tif_dir.h:275
#define TIFFTAG_PIXAR_IMAGEFULLLENGTH
Definition: tiff.h:397
#define TIFFTAG_XPOSITION
Definition: tiff.h:243
#define COMPRESSION_PIXARLOG
Definition: tiff.h:180
static const TIFFField tiffFields[]
Definition: tif_dirinfo.c:55
int _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag)
Definition: tif_dirinfo.c:958
#define TIFFTAG_RAWDATAUNIQUEID
Definition: tiff.h:523
#define COMPRESSION_JBIG
Definition: tiff.h:186
uint32 reserved
Definition: tif_dir.h:283
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define TIFFTAG_HALFTONEHINTS
Definition: tiff.h:285
#define TIFFTAG_PAGENAME
Definition: tiff.h:242
#define TIFFTAG_GROUP3OPTIONS
Definition: tiff.h:254
#define COMPRESSION_LERC
Definition: tiff.h:190
#define COMPRESSION_LZMA
Definition: tiff.h:192
#define TIFFTAG_DNGPRIVATEDATA
Definition: tiff.h:515
#define FIELD_PHOTOMETRIC
Definition: tif_dir.h:146
#define TIFFTAG_DEFAULTSCALE
Definition: tiff.h:476
static const WCHAR tb[]
Definition: suminfo.c:286
#define TIFFTAG_LINEARRESPONSELIMIT
Definition: tiff.h:508
#define EXIFTAG_SUBSECTIME
Definition: tiff.h:651
#define EXIFTAG_SUBSECTIMEDIGITIZED
Definition: tiff.h:653
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
#define TIFFTAG_PHOTOMETRIC
Definition: tiff.h:195
#define TIFFTAG_ARTIST
Definition: tiff.h:276
TIFFFieldArrayType type
Definition: tif_dir.h:272
#define EXIFTAG_DATETIMEDIGITIZED
Definition: tiff.h:634
#define TIFFTAG_FAXPROFILE
Definition: tiff.h:332
#define EXIFTAG_FLASHPIXVERSION
Definition: tiff.h:654
#define TIFFTAG_PAGENUMBER
Definition: tiff.h:266
uint32 count
Definition: tif_dir.h:274
int TIFFMergeFieldInfo(TIFF *tif, const TIFFFieldInfo info[], uint32 n)
Definition: tif_dirinfo.c:888
#define FIELD_COMPRESSION
Definition: tif_dir.h:145
#define TIFFTAG_ASSHOTPREPROFILEMATRIX
Definition: tiff.h:534
#define FIELD_SMINSAMPLEVALUE
Definition: tif_dir.h:162
#define FIELD_ROWSPERSTRIP
Definition: tif_dir.h:151
#define EXIFTAG_BRIGHTNESSVALUE
Definition: tiff.h:640
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
#define TIFFTAG_GRAYRESPONSEUNIT
Definition: tiff.h:247
int TIFFFieldReadCount(const TIFFField *fip)
Definition: tif_dirinfo.c:606
int ret
#define TIFFTAG_BADFAXLINES
Definition: tiff.h:290
#define TIFFTAG_MODEL
Definition: tiff.h:221
#define TIFFTAG_JPEGPROC
Definition: tiff.h:355
#define TIFFTAG_PIXAR_TEXTUREFORMAT
Definition: tiff.h:401
#define TIFFTAG_BASELINESHARPNESS
Definition: tiff.h:501
#define TIFFTAG_HOSTCOMPUTER
Definition: tiff.h:277
#define EXIFTAG_SUBJECTDISTANCE
Definition: tiff.h:643
#define TIFFTAG_TRANSFERFUNCTION
Definition: tiff.h:273
#define FIELD_INKNAMES
Definition: tif_dir.h:171
#define TIFFTAG_WHITEPOINT
Definition: tiff.h:282
#define EXIFTAG_CFAPATTERN
Definition: tiff.h:669
#define TIFFTAG_SHADOWSCALE
Definition: tiff.h:514
#define TIFFTAG_CFAREPEATPATTERNDIM
Definition: tiff.h:408
#define COMPRESSION_SGILOG
Definition: tiff.h:187
#define TIFFTAG_DEFAULTCROPORIGIN
Definition: tiff.h:477
#define TIFFTAG_COMPRESSION
Definition: tiff.h:157
#define FIELD_ORIENTATION
Definition: tif_dir.h:149
#define COMPRESSION_JPEG
Definition: tiff.h:166
const char * TIFFFieldName(const TIFFField *fip)
Definition: tif_dirinfo.c:588
HKEY key
Definition: reg.c:42
#define TIFFTAG_INKSET
Definition: tiff.h:297
#define TIFFTAG_CFALAYOUT
Definition: tiff.h:465
#define TIFFTAG_JPEGDCTABLES
Definition: tiff.h:364
const TIFFFieldArray * _TIFFGetExifFields(void)
Definition: tif_dirinfo.c:311
#define EXIFTAG_SCENETYPE
Definition: tiff.h:668
#define TIFFArrayCount(a)
Definition: tiffiop.h:267
#define TIFFTAG_XCLIPPATHUNITS
Definition: tiff.h:319
#define TIFFTAG_NUMBEROFINKS
Definition: tiff.h:301
const TIFFField * TIFFFieldWithTag(TIFF *tif, uint32 tag)
Definition: tif_dirinfo.c:558
#define FIELD_IMAGEDEPTH
Definition: tif_dir.h:164
unsigned char field_oktochange
Definition: tif_dir.h:287
#define TIFFTAG_SMAXSAMPLEVALUE
Definition: tiff.h:316
#define TIFFTAG_JPEGIFBYTECOUNT
Definition: tiff.h:359
static void * td_lfind(const void *key, const void *base, size_t *nmemb, size_t size, int(*compar)(const void *, const void *))
Definition: tif_dirinfo.c:291
#define TIFFTAG_COLORMATRIX1
Definition: tiff.h:481
#define EXIFTAG_CONTRAST
Definition: tiff.h:677
#define FIELD_YCBCRPOSITIONING
Definition: tif_dir.h:168
TIFFDataType TIFFFieldDataType(const TIFFField *fip)
Definition: tif_dirinfo.c:594
int TIFFDataWidth(TIFFDataType type)
Definition: tif_dirinfo.c:438
void _TIFFPrintFieldInfo(TIFF *tif, FILE *fd)
Definition: tif_dirinfo.c:414
TIFFField ** tif_fields
Definition: tiffiop.h:200
#define TIFFTAG_LOCALIZEDCAMERAMODEL
Definition: tiff.h:461
#define EXIFTAG_GAINCONTROL
Definition: tiff.h:683
int _TIFFDataSize(TIFFDataType type)
Definition: tif_dirinfo.c:476
#define FIELD_EXTRASAMPLES
Definition: tif_dir.h:160
#define TIFFTAG_CELLLENGTH
Definition: tiff.h:214
#define TIFF_VARIABLE2
Definition: tiffio.h:315
#define TIFFTAG_ASSHOTNEUTRAL
Definition: tiff.h:493
#define TIFFTAG_STONITS
Definition: tiff.h:451
#define COMPRESSION_THUNDERSCAN
Definition: tiff.h:172
TIFFDataType field_type
Definition: tif_dir.h:282
#define TIFFTAG_TILEDEPTH
Definition: tiff.h:387
#define EXIFTAG_COMPONENTSCONFIGURATION
Definition: tiff.h:636
#define TIFFTAG_IMAGEDEPTH
Definition: tiff.h:386
#define TIFFTAG_RESOLUTIONUNIT
Definition: tiff.h:262
#define EXIFTAG_SCENECAPTURETYPE
Definition: tiff.h:675
TIFFSetGetFieldType set_field_type
Definition: tif_dir.h:284
#define EXIFTAG_FNUMBER
Definition: tiff.h:625
#define TIFFTAG_XRESOLUTION
Definition: tiff.h:237
#define TIFFTAG_BLACKLEVELDELTAV
Definition: tiff.h:472
#define TIFFTAG_DEFAULTCROPSIZE
Definition: tiff.h:479
#define COMPRESSION_ADOBE_DEFLATE
Definition: tiff.h:182
#define TIFFTAG_MAKE
Definition: tiff.h:220
#define FIELD_POSITION
Definition: tif_dir.h:140
#define TIFFTAG_COLORRESPONSEUNIT
Definition: tiff.h:267
TIFFDirectory tif_dir
Definition: tiffiop.h:135
#define FIELD_PAGENUMBER
Definition: tif_dir.h:156
#define FIELD_TILEDEPTH
Definition: tif_dir.h:165
#define EXIFTAG_APERTUREVALUE
Definition: tiff.h:639
#define TIFFTAG_CFAPLANECOLOR
Definition: tiff.h:463
#define TIFFTAG_GROUP4OPTIONS
Definition: tiff.h:259
#define FIELD_TILEDIMENSIONS
Definition: tif_dir.h:138
#define TIFFTAG_WHITELEVEL
Definition: tiff.h:474
#define TIFFTAG_ACTIVEAREA
Definition: tiff.h:529
#define EXIFTAG_SPATIALFREQUENCYRESPONSE
Definition: tiff.h:660
#define TIFFTAG_RICHTIFFIPTC
Definition: tiff.h:413
#define TIFFTAG_TARGETPRINTER
Definition: tiff.h:303
#define EXIFTAG_SPECTRALSENSITIVITY
Definition: tiff.h:627
size_t tif_nfieldscompat
Definition: tiffiop.h:208
#define TIFFTAG_UNIQUECAMERAMODEL
Definition: tiff.h:460
#define TIFFTAG_PREDICTOR
Definition: tiff.h:278
#define TIFFTAG_REDUCTIONMATRIX1
Definition: tiff.h:487
#define COMPRESSION_ZSTD
Definition: tiff.h:193
const TIFFField * TIFFFieldWithName(TIFF *tif, const char *field_name)
Definition: tif_dirinfo.c:570
#define EXIFTAG_CUSTOMRENDERED
Definition: tiff.h:670
#define EXIFTAG_OECF
Definition: tiff.h:629
#define FIELD_COLORMAP
Definition: tif_dir.h:159
#define FIELD_SAMPLESPERPIXEL
Definition: tif_dir.h:150
#define TIFFTAG_IMAGELAYER
Definition: tiff.h:441
#define TIFFTAG_YCLIPPATHUNITS
Definition: tiff.h:321
const TIFFField * TIFFFindField(TIFF *tif, uint32 tag, TIFFDataType dt)
Definition: tif_dirinfo.c:506
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define TIFFTAG_FAXSUBADDRESS
Definition: tiff.h:447
#define FIELD_REFBLACKWHITE
Definition: tif_dir.h:169
#define FIELD_PSEUDO
Definition: tif_dir.h:186
#define EXIFTAG_FOCALLENGTHIN35MMFILM
Definition: tiff.h:674
Definition: tiff.h:137
uint16 td_compression
Definition: tif_dir.h:76
#define EXIFTAG_SUBJECTDISTANCERANGE
Definition: tiff.h:681
const TIFFField * tif_foundfield
Definition: tiffiop.h:202
void _TIFFfree(void *p)
Definition: tif_unix.c:326
#define EXIFTAG_MAXAPERTUREVALUE
Definition: tiff.h:642
#define TIFFTAG_SAMPLEFORMAT
Definition: tiff.h:308
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define TIFFTAG_OSUBFILETYPE
Definition: tiff.h:150
#define TIFFTAG_T82OPTIONS
Definition: tiff.h:350
#define FIELD_SAMPLEFORMAT
Definition: tif_dir.h:161
#define TIFFTAG_CLIPPATH
Definition: tiff.h:317
#define COMPRESSION_LZW
Definition: tiff.h:164
#define EXIFTAG_PIXELXDIMENSION
Definition: tiff.h:656
#define TIFFTAG_CODINGMETHODS
Definition: tiff.h:339
#define TIFFTAG_CLEANFAXDATA
Definition: tiff.h:291
#define TIFFTAG_JPEGRESTARTINTERVAL
Definition: tiff.h:360
#define TIFFTAG_BLACKLEVEL
Definition: tiff.h:469
static const TIFFFieldArray exifFieldArray
Definition: tif_dirinfo.c:49
#define TIFFTAG_MAXSAMPLEVALUE
Definition: tiff.h:236
#define TIFFTAG_PHOTOSHOP
Definition: tiff.h:436
#define TIFFTAG_CALIBRATIONILLUMINANT1
Definition: tiff.h:520
static int tagCompare(const void *a, const void *b)
Definition: tif_dirinfo.c:342
TIFFDataType
Definition: tiff.h:123
#define COMPRESSION_NEXT
Definition: tiff.h:169
#define FIELD_SUBFILETYPE
Definition: tif_dir.h:143
Definition: path.c:42
#define EXIFTAG_METERINGMODE
Definition: tiff.h:644
#define TIFFTAG_FAXRECVPARAMS
Definition: tiff.h:446
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define EXIFTAG_SENSINGMETHOD
Definition: tiff.h:666
#define TIFFTAG_PROFILETYPE
Definition: tiff.h:329
short field_readcount
Definition: tif_dir.h:280
#define bsearch
char * tag
Definition: main.c:59