@@ -548,6 +548,11 @@ export class TiffReader {
548
548
}
549
549
// Bilevel or Grayscale
550
550
// BlackIsZero
551
+ //
552
+ // FIXME(cjh): ESLint error: 'case' statement requires a 'break' statement.
553
+ // But I don't know whether it was supposed to be a 'break' statement here.
554
+ // For now, I'll just leave it as it is and disable the ESLint error.
555
+ // eslint-disable-next-line no-fallthrough
551
556
case 1 :
552
557
{
553
558
red = green = blue = this . clampColorSample ( pixelSamples [ 0 ] , sampleProperties [ 0 ] . bitsPerSample ) ;
@@ -594,131 +599,131 @@ export class TiffReader {
594
599
595
600
const fieldTagNames = {
596
601
// TIFF Baseline
597
- 0x013B : 'Artist' as const ,
598
- 0x0102 : 'BitsPerSample' as const ,
599
- 0x0109 : 'CellLength' as const ,
600
- 0x0108 : 'CellWidth' as const ,
601
- 0x0140 : 'ColorMap' as const ,
602
- 0x0103 : 'Compression' as const ,
603
- 0x8298 : 'Copyright' as const ,
604
- 0x0132 : 'DateTime' as const ,
605
- 0x0152 : 'ExtraSamples' as const ,
606
- 0x010A : 'FillOrder' as const ,
607
- 0x0121 : 'FreeByteCounts' as const ,
608
- 0x0120 : 'FreeOffsets' as const ,
609
- 0x0123 : 'GrayResponseCurve' as const ,
610
- 0x0122 : 'GrayResponseUnit' as const ,
611
- 0x013C : 'HostComputer' as const ,
612
- 0x010E : 'ImageDescription' as const ,
613
- 0x0101 : 'ImageLength' as const ,
614
- 0x0100 : 'ImageWidth' as const ,
615
- 0x010F : 'Make' as const ,
616
- 0x0119 : 'MaxSampleValue' as const ,
617
- 0x0118 : 'MinSampleValue' as const ,
618
- 0x0110 : 'Model' as const ,
619
- 0x00FE : 'NewSubfileType' as const ,
620
- 0x0112 : 'Orientation' as const ,
621
- 0x0106 : 'PhotometricInterpretation' as const ,
622
- 0x011C : 'PlanarConfiguration' as const ,
623
- 0x0128 : 'ResolutionUnit' as const ,
624
- 0x0116 : 'RowsPerStrip' as const ,
625
- 0x0115 : 'SamplesPerPixel' as const ,
626
- 0x0131 : 'Software' as const ,
627
- 0x0117 : 'StripByteCounts' as const ,
628
- 0x0111 : 'StripOffsets' as const ,
629
- 0x00FF : 'SubfileType' as const ,
630
- 0x0107 : 'Threshholding' as const ,
631
- 0x011A : 'XResolution' as const ,
632
- 0x011B : 'YResolution' as const ,
602
+ 0x013B : 'Artist' ,
603
+ 0x0102 : 'BitsPerSample' ,
604
+ 0x0109 : 'CellLength' ,
605
+ 0x0108 : 'CellWidth' ,
606
+ 0x0140 : 'ColorMap' ,
607
+ 0x0103 : 'Compression' ,
608
+ 0x8298 : 'Copyright' ,
609
+ 0x0132 : 'DateTime' ,
610
+ 0x0152 : 'ExtraSamples' ,
611
+ 0x010A : 'FillOrder' ,
612
+ 0x0121 : 'FreeByteCounts' ,
613
+ 0x0120 : 'FreeOffsets' ,
614
+ 0x0123 : 'GrayResponseCurve' ,
615
+ 0x0122 : 'GrayResponseUnit' ,
616
+ 0x013C : 'HostComputer' ,
617
+ 0x010E : 'ImageDescription' ,
618
+ 0x0101 : 'ImageLength' ,
619
+ 0x0100 : 'ImageWidth' ,
620
+ 0x010F : 'Make' ,
621
+ 0x0119 : 'MaxSampleValue' ,
622
+ 0x0118 : 'MinSampleValue' ,
623
+ 0x0110 : 'Model' ,
624
+ 0x00FE : 'NewSubfileType' ,
625
+ 0x0112 : 'Orientation' ,
626
+ 0x0106 : 'PhotometricInterpretation' ,
627
+ 0x011C : 'PlanarConfiguration' ,
628
+ 0x0128 : 'ResolutionUnit' ,
629
+ 0x0116 : 'RowsPerStrip' ,
630
+ 0x0115 : 'SamplesPerPixel' ,
631
+ 0x0131 : 'Software' ,
632
+ 0x0117 : 'StripByteCounts' ,
633
+ 0x0111 : 'StripOffsets' ,
634
+ 0x00FF : 'SubfileType' ,
635
+ 0x0107 : 'Threshholding' ,
636
+ 0x011A : 'XResolution' ,
637
+ 0x011B : 'YResolution' ,
633
638
634
639
// TIFF Extended
635
- 0x0146 : 'BadFaxLines' as const ,
636
- 0x0147 : 'CleanFaxData' as const ,
637
- 0x0157 : 'ClipPath' as const ,
638
- 0x0148 : 'ConsecutiveBadFaxLines' as const ,
639
- 0x01B1 : 'Decode' as const ,
640
- 0x01B2 : 'DefaultImageColor' as const ,
641
- 0x010D : 'DocumentName' as const ,
642
- 0x0150 : 'DotRange' as const ,
643
- 0x0141 : 'HalftoneHints' as const ,
644
- 0x015A : 'Indexed' as const ,
645
- 0x015B : 'JPEGTables' as const ,
646
- 0x011D : 'PageName' as const ,
647
- 0x0129 : 'PageNumber' as const ,
648
- 0x013D : 'Predictor' as const ,
649
- 0x013F : 'PrimaryChromaticities' as const ,
650
- 0x0214 : 'ReferenceBlackWhite' as const ,
651
- 0x0153 : 'SampleFormat' as const ,
652
- 0x022F : 'StripRowCounts' as const ,
653
- 0x014A : 'SubIFDs' as const ,
654
- 0x0124 : 'T4Options' as const ,
655
- 0x0125 : 'T6Options' as const ,
656
- 0x0145 : 'TileByteCounts' as const ,
657
- 0x0143 : 'TileLength' as const ,
658
- 0x0144 : 'TileOffsets' as const ,
659
- 0x0142 : 'TileWidth' as const ,
660
- 0x012D : 'TransferFunction' as const ,
661
- 0x013E : 'WhitePoint' as const ,
662
- 0x0158 : 'XClipPathUnits' as const ,
663
- 0x011E : 'XPosition' as const ,
664
- 0x0211 : 'YCbCrCoefficients' as const ,
665
- 0x0213 : 'YCbCrPositioning' as const ,
666
- 0x0212 : 'YCbCrSubSampling' as const ,
667
- 0x0159 : 'YClipPathUnits' as const ,
668
- 0x011F : 'YPosition' as const ,
640
+ 0x0146 : 'BadFaxLines' ,
641
+ 0x0147 : 'CleanFaxData' ,
642
+ 0x0157 : 'ClipPath' ,
643
+ 0x0148 : 'ConsecutiveBadFaxLines' ,
644
+ 0x01B1 : 'Decode' ,
645
+ 0x01B2 : 'DefaultImageColor' ,
646
+ 0x010D : 'DocumentName' ,
647
+ 0x0150 : 'DotRange' ,
648
+ 0x0141 : 'HalftoneHints' ,
649
+ 0x015A : 'Indexed' ,
650
+ 0x015B : 'JPEGTables' ,
651
+ 0x011D : 'PageName' ,
652
+ 0x0129 : 'PageNumber' ,
653
+ 0x013D : 'Predictor' ,
654
+ 0x013F : 'PrimaryChromaticities' ,
655
+ 0x0214 : 'ReferenceBlackWhite' ,
656
+ 0x0153 : 'SampleFormat' ,
657
+ 0x022F : 'StripRowCounts' ,
658
+ 0x014A : 'SubIFDs' ,
659
+ 0x0124 : 'T4Options' ,
660
+ 0x0125 : 'T6Options' ,
661
+ 0x0145 : 'TileByteCounts' ,
662
+ 0x0143 : 'TileLength' ,
663
+ 0x0144 : 'TileOffsets' ,
664
+ 0x0142 : 'TileWidth' ,
665
+ 0x012D : 'TransferFunction' ,
666
+ 0x013E : 'WhitePoint' ,
667
+ 0x0158 : 'XClipPathUnits' ,
668
+ 0x011E : 'XPosition' ,
669
+ 0x0211 : 'YCbCrCoefficients' ,
670
+ 0x0213 : 'YCbCrPositioning' ,
671
+ 0x0212 : 'YCbCrSubSampling' ,
672
+ 0x0159 : 'YClipPathUnits' ,
673
+ 0x011F : 'YPosition' ,
669
674
670
675
// EXIF
671
- 0x9202 : 'ApertureValue' as const ,
672
- 0xA001 : 'ColorSpace' as const ,
673
- 0x9004 : 'DateTimeDigitized' as const ,
674
- 0x9003 : 'DateTimeOriginal' as const ,
675
- 0x8769 : 'Exif IFD' as const ,
676
- 0x9000 : 'ExifVersion' as const ,
677
- 0x829A : 'ExposureTime' as const ,
678
- 0xA300 : 'FileSource' as const ,
679
- 0x9209 : 'Flash' as const ,
680
- 0xA000 : 'FlashpixVersion' as const ,
681
- 0x829D : 'FNumber' as const ,
682
- 0xA420 : 'ImageUniqueID' as const ,
683
- 0x9208 : 'LightSource' as const ,
684
- 0x927C : 'MakerNote' as const ,
685
- 0x9201 : 'ShutterSpeedValue' as const ,
686
- 0x9286 : 'UserComment' as const ,
676
+ 0x9202 : 'ApertureValue' ,
677
+ 0xA001 : 'ColorSpace' ,
678
+ 0x9004 : 'DateTimeDigitized' ,
679
+ 0x9003 : 'DateTimeOriginal' ,
680
+ 0x8769 : 'Exif IFD' ,
681
+ 0x9000 : 'ExifVersion' ,
682
+ 0x829A : 'ExposureTime' ,
683
+ 0xA300 : 'FileSource' ,
684
+ 0x9209 : 'Flash' ,
685
+ 0xA000 : 'FlashpixVersion' ,
686
+ 0x829D : 'FNumber' ,
687
+ 0xA420 : 'ImageUniqueID' ,
688
+ 0x9208 : 'LightSource' ,
689
+ 0x927C : 'MakerNote' ,
690
+ 0x9201 : 'ShutterSpeedValue' ,
691
+ 0x9286 : 'UserComment' ,
687
692
688
693
// IPTC
689
- 0x83BB : 'IPTC' as const ,
694
+ 0x83BB : 'IPTC' ,
690
695
691
696
// ICC
692
- 0x8773 : 'ICC Profile' as const ,
697
+ 0x8773 : 'ICC Profile' ,
693
698
694
699
// XMP
695
- 0x02BC : 'XMP' as const ,
700
+ 0x02BC : 'XMP' ,
696
701
697
702
// GDAL
698
- 0xA480 : 'GDAL_METADATA' as const ,
699
- 0xA481 : 'GDAL_NODATA' as const ,
703
+ 0xA480 : 'GDAL_METADATA' ,
704
+ 0xA481 : 'GDAL_NODATA' ,
700
705
701
706
// Photoshop
702
- 0x8649 : 'Photoshop' as const ,
703
- } ;
707
+ 0x8649 : 'Photoshop' ,
708
+ } as const ;
704
709
705
710
type FieldTagNamesKey = keyof typeof fieldTagNames ;
706
711
type FieldTagNamesValue = typeof fieldTagNames [ FieldTagNamesKey ] ;
707
712
708
713
const fieldTypeNames = {
709
- 0x0001 : 'BYTE' as const ,
710
- 0x0002 : 'ASCII' as const ,
711
- 0x0003 : 'SHORT' as const ,
712
- 0x0004 : 'LONG' as const ,
713
- 0x0005 : 'RATIONAL' as const ,
714
- 0x0006 : 'SBYTE' as const ,
715
- 0x0007 : 'UNDEFINED' as const ,
716
- 0x0008 : 'SSHORT' as const ,
717
- 0x0009 : 'SLONG' as const ,
718
- 0x000A : 'SRATIONAL' as const ,
719
- 0x000B : 'FLOAT' as const ,
720
- 0x000C : 'DOUBLE' as const ,
721
- } ;
714
+ 0x0001 : 'BYTE' ,
715
+ 0x0002 : 'ASCII' ,
716
+ 0x0003 : 'SHORT' ,
717
+ 0x0004 : 'LONG' ,
718
+ 0x0005 : 'RATIONAL' ,
719
+ 0x0006 : 'SBYTE' ,
720
+ 0x0007 : 'UNDEFINED' ,
721
+ 0x0008 : 'SSHORT' ,
722
+ 0x0009 : 'SLONG' ,
723
+ 0x000A : 'SRATIONAL' ,
724
+ 0x000B : 'FLOAT' ,
725
+ 0x000C : 'DOUBLE' ,
726
+ } as const ;
722
727
723
728
type FieldTypeNamesKey = keyof typeof fieldTypeNames ;
724
729
type FieldTypeNamesValue = typeof fieldTypeNames [ FieldTypeNamesKey ] ;
0 commit comments