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 {
266 if (
td->td_bitspersample == 8)
268 else if (
td->td_bitspersample == 16)
270 else if (
td->td_bitspersample == 24)
272 else if (
td->td_bitspersample == 32)
274 else if (
td->td_bitspersample == 64)
276 else if (
td->td_bitspersample == 128)
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;
325 if (
v !=
td->td_samplesperpixel)
326 {
327
328 if (
td->td_sminsamplevalue !=
NULL)
329 {
331 "SamplesPerPixel tag value is changing, "
332 "but SMinSampleValue tag was read with a "
333 "different value. Canceling it");
336 td->td_sminsamplevalue =
NULL;
337 }
338 if (
td->td_smaxsamplevalue !=
NULL)
339 {
341 "SamplesPerPixel tag value is changing, "
342 "but SMaxSampleValue tag was read with a "
343 "different value. Canceling it");
346 td->td_smaxsamplevalue =
NULL;
347 }
348
349
350
351 if (
td->td_transferfunction[0] !=
NULL &&
352 (
v -
td->td_extrasamples > 1) &&
353 !(
td->td_samplesperpixel -
td->td_extrasamples > 1))
354 {
356 "SamplesPerPixel tag value is changing, "
357 "but TransferFunction was read with a "
358 "different value. Canceling it");
361 td->td_transferfunction[0] =
NULL;
362 }
363 }
365 break;
368 if (v32 == 0)
369 goto badvalue32;
370 td->td_rowsperstrip = v32;
372 {
373 td->td_tilelength = v32;
374 td->td_tilewidth =
td->td_imagewidth;
375 }
376 break;
379 break;
382 break;
387 td->td_samplesperpixel);
388 else
391 td->td_samplesperpixel);
392 break;
397 td->td_samplesperpixel);
398 else
401 td->td_samplesperpixel);
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;
456 if (
td->td_extrasamples)
457 {
460 }
461 break;
464 if (v32 % 16)
465 {
467 goto badvalue32;
470 "Nonstandard tile width %" PRIu32 ", convert file", v32);
471 }
472 td->td_tilewidth = v32;
474 break;
477 if (v32 % 16)
478 {
480 goto badvalue32;
483 "Nonstandard tile length %" PRIu32 ", convert file", v32);
484 }
485 td->td_tilelength = v32;
487 break;
490 if (v32 == 0)
491 goto badvalue32;
492 td->td_tiledepth = v32;
493 break;
497 {
500 break;
503 break;
506 break;
509 break;
510 default:
511 goto badvalue;
512 }
514 break;
518 goto badvalue;
520
521
523 td->td_bitspersample == 32 &&
528 td->td_bitspersample == 64 &&
531 break;
534 break;
537 {
542 }
543 else
544 {
548 }
549 break;
552 break;
556 break;
558 {
560 v = (
td->td_samplesperpixel -
td->td_extrasamples) > 1 ? 3 : 1;
561 for (
i = 0;
i <
v;
i++)
564 1U <<
td->td_bitspersample);
565 break;
566 }
568
571 break;
573 {
578 status = ninksinstring > 0;
579 if (ninksinstring > 0)
580 {
582 td->td_inknameslen =
v;
583
585 {
586 if (
td->td_numberofinks != ninksinstring)
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);
596 td->td_numberofinks = ninksinstring;
597 }
598 }
599 else
600 {
601 td->td_numberofinks = ninksinstring;
603 }
605 {
606 if (
td->td_numberofinks !=
td->td_samplesperpixel)
607 {
609 "Warning %s; Tag %s:\n Value %" PRIu16
610 " of NumberOfInks is different from the "
611 "SamplesPerPixel value %" PRIu16 "",
614 td->td_samplesperpixel);
615 }
616 }
617 }
618 }
619 break;
622
623
625 {
626 if (
v !=
td->td_numberofinks)
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 {
645 if (
td->td_numberofinks !=
td->td_samplesperpixel)
646 {
648 "Warning %s; Tag %s:\n Value %" PRIu32
649 " of NumberOfInks is different from the "
650 "SamplesPerPixel value %" PRIu16 "",
652 td->td_samplesperpixel);
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
705 for (iCustom = 0; iCustom <
td->td_customValueCount; iCustom++)
706 {
707 if (
td->td_customValues[iCustom].info->field_tag ==
tag)
708 {
709 tv =
td->td_customValues + iCustom;
711 {
714 }
715 break;
716 }
717 }
718
719
720
721
723 {
725
727 tif,
td->td_customValues,
729 if (!new_customValues)
730 {
732 "%s: Failed to allocate space for list of "
733 "custom values",
737 }
738
739 td->td_customValueCount++;
740 td->td_customValues = new_customValues;
741
742 tv =
td->td_customValues + (
td->td_customValueCount - 1);
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 }
803 tv->
count =
td->td_samplesperpixel;
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
1071 for (iCustom2 = 0; iCustom2 <
td->td_customValueCount; iCustom2++)
1072 {
1073 if (
td->td_customValues[iCustom2].info->field_tag ==
tag)
1074 {
1075 tv2 =
td->td_customValues + (iCustom2);
1076 break;
1077 }
1078 }
1080 {
1081
1083 {
1086 }
1087
1088
1089 td->td_customValueCount--;
1090 for (iC2 = iCustom2; iC2 <
td->td_customValueCount; iC2++)
1091 {
1092 td->td_customValues[iC2] =
td->td_customValues[iC2 + 1];
1093 }
1094 }
1095 else
1096 {
1098 }
1100}
1101 return (0);
1102}
static float(WINAPI *pD2D1Tan)(float angle)
_ACRTIMP size_t __cdecl strlen(const char *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLfloat GLfloat GLfloat GLfloat v3
GLfloat GLfloat GLfloat v2
for(i=0;i< sizeof(testsuite)/sizeof(testsuite[0]);++i) ok(call_test(testsuite[i].func)
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