221{
222 static const char module[] =
"_TIFFVSetField";
223
227 double dblval;
232 return 0;
233
234
235
236
237
238
240 {
241 standard_tag = 0;
242 }
243
244 switch (standard_tag)
245 {
248 break;
251 break;
254 break;
257
258
259
260
261
262
263
265 {
278 }
279 break;
282
283
284
285
286
288 {
290 break;
293 }
294
295
296
299 else
301 break;
304 break;
307 break;
311 goto badvalue;
313 break;
317 goto badvalue;
318 else
320 break;
324 goto badvalue;
326 {
327
329 {
331 "SamplesPerPixel tag value is changing, "
332 "but SMinSampleValue tag was read with a "
333 "different value. Canceling it");
337 }
339 {
341 "SamplesPerPixel tag value is changing, "
342 "but SMaxSampleValue tag was read with a "
343 "different value. Canceling it");
347 }
348
349
350
354 {
356 "SamplesPerPixel tag value is changing, "
357 "but TransferFunction was read with a "
358 "different value. Canceling it");
362 }
363 }
365 break;
368 if (v32 == 0)
369 goto badvalue32;
372 {
375 }
376 break;
379 break;
382 break;
388 else
392 break;
398 else
402 break;
405 if (dblval != dblval || dblval < 0)
406 goto badvaluedouble;
408 break;
411 if (dblval != dblval || dblval < 0)
412 goto badvaluedouble;
414 break;
418 goto badvalue;
420 break;
423 break;
426 break;
430 goto badvalue;
432 break;
436 break;
440 break;
449 break;
452 goto badvalue;
453 break;
457 {
460 }
461 break;
464 if (v32 % 16)
465 {
467 goto badvalue32;
470 "Nonstandard tile width %" PRIu32 ", convert file", v32);
471 }
474 break;
477 if (v32 % 16)
478 {
480 goto badvalue32;
483 "Nonstandard tile length %" PRIu32 ", convert file", v32);
484 }
487 break;
490 if (v32 == 0)
491 goto badvalue32;
493 break;
497 {
500 break;
503 break;
506 break;
509 break;
510 default:
511 goto badvalue;
512 }
514 break;
518 goto badvalue;
520
521
531 break;
534 break;
537 {
542 }
543 else
544 {
548 }
549 break;
552 break;
556 break;
558 {
561 for (
i = 0;
i <
v;
i++)
565 break;
566 }
568
571 break;
573 {
578 status = ninksinstring > 0;
579 if (ninksinstring > 0)
580 {
583
585 {
587 {
590 "Warning %s; Tag %s:\n Value %" PRIu16
591 " of NumberOfInks is different from the number of "
593 ".\n -> NumberOfInks value adapted to %" PRIu16 "",
595 ninksinstring, ninksinstring);
597 }
598 }
599 else
600 {
603 }
605 {
607 {
609 "Warning %s; Tag %s:\n Value %" PRIu16
610 " of NumberOfInks is different from the "
611 "SamplesPerPixel value %" PRIu16 "",
615 }
616 }
617 }
618 }
619 break;
622
623
625 {
627 {
630 "Error %s; Tag %s:\n It is not possible to set the "
632 " for NumberOfInks\n which is different from the "
633 "number of inks in the InkNames tag (%" PRIu16 ")",
635
636
638 }
639 }
640 else
641 {
644 {
646 {
648 "Warning %s; Tag %s:\n Value %" PRIu32
649 " of NumberOfInks is different from the "
650 "SamplesPerPixel value %" PRIu16 "",
653 }
654 }
655 }
656 break;
661 else
663 break;
664 default:
665 {
667 int tv_size, iCustom;
668
669
670
671
672
673
674
675
676
677
678
679
681 {
684 "%s: Ignored %stag \"%s\" (not supported by libtiff)",
688 break;
689 }
691 {
694 "%s: Invalid %stag \"%s\" (not supported by codec)",
698 break;
699 }
700
701
702
703
706 {
708 {
711 {
714 }
715 break;
716 }
717 }
718
719
720
721
723 {
725
729 if (!new_customValues)
730 {
732 "%s: Failed to allocate space for list of "
733 "custom values",
737 }
738
741
746 }
747
748
749
750
751
752
754 if (tv_size == 0)
755 {
760 }
761
763 {
765 const char *mb;
767 {
770 mb = (
const char *)
va_arg(
ap,
const char *);
771 }
772 else
773 {
774 mb = (
const char *)
va_arg(
ap,
const char *);
776 if (
len >= 0x80000000U)
777 {
780 "%s: Too long string value for \"%s\". "
781 "Maximum supported is 2147483647 bytes",
784 }
786 }
789 }
790 else
791 {
793 {
796 else
798 }
804 else
806
808 {
810 "%s: Null count for \"%s\" (type "
811 "%d, writecount %d, passcount %d)",
815 break;
816 }
817
819 "custom tag binary object");
821 {
824 }
825
828 {
829
830
831
832
837 }
838
843 {
844
845
847 tv->
count * tv_size);
848
849
851 {
853 {
856 {
857 if (pui64[
i] > 0xffffffffu)
858 {
861 "%s: Bad LONG8 value %" PRIu64
862 " at %d. array position for \"%s\" tag "
863 "%d in ClassicTIFF. Tag won't be "
864 "written to file",
867 goto badvalueifd8long8;
868 }
869 }
870 }
872 {
875 {
876 if (pi64[
i] > 2147483647 ||
877 pi64[
i] < (-2147483647 - 1))
878 {
881 "%s: Bad SLONG8 value %" PRIi64
882 " at %d. array position for \"%s\" tag "
883 "%d in ClassicTIFF. Tag won't be "
884 "written to file",
887 goto badvalueifd8long8;
888 }
889 }
890 }
891 }
892 }
893 else
894 {
897
899 {
902 {
905 }
906 break;
908 {
911 }
912 break;
914 {
917 }
918 break;
920 {
923 }
924 break;
927 {
930 }
931 break;
933 {
936 }
937 break;
940 {
943
944
947 {
950 "%s: Bad LONG8 or IFD8 value %" PRIu64
951 " for \"%s\" tag %d in ClassicTIFF. Tag "
952 "won't be written to file",
954 goto badvalueifd8long8;
955 }
956 }
957 break;
959 {
962
963
965 ((
v2 > 2147483647) || (
v2 < (-2147483647 - 1))))
966 {
969 "%s: Bad SLONG8 value %" PRIi64
970 " for \"%s\" tag %d in ClassicTIFF. Tag "
971 "won't be written to file",
973 goto badvalueifd8long8;
974 }
975 }
976 break;
979
980
981
982
983 {
984 if (tv_size == 8)
985 {
988 }
989 else
990 {
991
994
995
996
997 if (tv_size != 4)
998 {
1000 "Rational2Double: "
1001 ".set_get_field_type "
1002 "in not 4 but %d",
1003 tv_size);
1004 }
1005 }
1006 }
1007 break;
1009 {
1013 }
1014 break;
1016 {
1019 }
1020 break;
1021 default:
1024 break;
1025 }
1026 }
1027 }
1028 }
1029 }
1031 {
1033 if (fip2)
1036 }
1037
1041badvalue:
1042{
1047}
1048 return (0);
1049badvalue32:
1050{
1055}
1056 return (0);
1057badvaluedouble:
1058{
1061 dblval, fip2 ? fip2->
field_name :
"Unknown");
1063}
1064 return (0);
1065badvalueifd8long8:
1066{
1067
1069 int iCustom2, iC2;
1070
1072 {
1074 {
1076 break;
1077 }
1078 }
1080 {
1081
1083 {
1086 }
1087
1088
1091 {
1093 }
1094 }
1095 else
1096 {
1098 }
1100}
1101 return (0);
1102}
_ACRTIMP size_t __cdecl strlen(const char *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
for(i=0;i< ARRAY_SIZE(offsets);i++)
GLfloat GLfloat GLfloat GLfloat v3
GLfloat GLfloat GLfloat v2
static float(__cdecl *square_half_float)(float x
TIFFPostMethod tif_postdecode
TIFFVoidMethod tif_cleanup
void * _TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
float _TIFFClampDoubleToFloat(double val)
int TIFFSetCompressionScheme(TIFF *tif, int scheme)
void _TIFFsetFloatArrayExt(TIFF *tif, float **fpp, const float *fp, uint32_t n)
static void _TIFFsetNString(TIFF *tif, char **cpp, const char *cp, uint32_t n)
static void _TIFFsetLong8Array(TIFF *tif, uint64_t **lpp, const uint64_t *lp, uint32_t n)
static void setDoubleArrayOneValue(TIFF *tif, double **vpp, double value, size_t nmemb)
void _TIFFsetDoubleArrayExt(TIFF *tif, double **dpp, const double *dp, uint32_t n)
static uint16_t countInkNamesString(TIFF *tif, uint32_t slen, const char *s)
static int setExtraSamples(TIFF *tif, va_list ap, uint32_t *v)
void _TIFFsetShortArrayExt(TIFF *tif, uint16_t **wpp, const uint16_t *wp, uint32_t n)
#define FIELD_TRANSFERFUNCTION
#define FIELD_SMAXSAMPLEVALUE
#define FIELD_SMINSAMPLEVALUE
#define TIFFFieldSet(tif, field)
#define FIELD_NUMBEROFINKS
#define FIELD_TILEDIMENSIONS
#define FIELD_COMPRESSION
#define TIFFClrFieldBit(tif, field)
#define TIFFSetFieldBit(tif, field)
#define FIELD_SAMPLESPERPIXEL
const TIFFField * TIFFFieldWithTag(TIFF *tif, uint32_t tag)
void _TIFFfreeExt(TIFF *tif, void *p)
void * _TIFFreallocExt(TIFF *tif, void *p, tmsize_t s)
void _TIFFNoPostDecode(TIFF *tif, uint8_t *buf, tmsize_t cc)
void _TIFFSwab24BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
void _TIFFSwab16BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
void _TIFFSwab32BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
void _TIFFSwab64BitData(TIFF *tif, uint8_t *buf, tmsize_t cc)
void _TIFFmemset(void *p, int v, tmsize_t c)
void _TIFFmemcpy(void *d, const void *s, tmsize_t c)
void TIFFWarningExtR(TIFF *tif, const char *module, const char *fmt,...)
#define PLANARCONFIG_SEPARATE
#define RESUNIT_CENTIMETER
#define ORIENTATION_TOPLEFT
#define FILLORDER_LSB2MSB
#define SAMPLEFORMAT_COMPLEXINT
#define FILLORDER_MSB2LSB
#define ORIENTATION_LEFTBOT
#define TIFFTAG_PERSAMPLE
#define SAMPLEFORMAT_COMPLEXIEEEFP
#define PLANARCONFIG_CONTIG