TIFFReader.st
author Stefan Vogel <sv@exept.de>
Wed, 29 Apr 2020 22:34:37 +0200
changeset 4460 e067415ddf46
parent 4426 b99d80e74d2a
permissions -rw-r--r--
#FEATURE by stefan class: ApplicationModel added: #isDialog changed: #doAccept
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4347
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
     1
"{ Encoding: utf8 }"
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
     2
0
3f9277473954 Initial revision
claus
parents:
diff changeset
     3
"
6
4ac87e6bf82f *** empty log message ***
claus
parents: 5
diff changeset
     4
 COPYRIGHT (c) 1991 by Claus Gittinger
28
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
     5
	      All Rights Reserved
0
3f9277473954 Initial revision
claus
parents:
diff changeset
     6
3f9277473954 Initial revision
claus
parents:
diff changeset
     7
 This software is furnished under a license and may be used
3f9277473954 Initial revision
claus
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
3f9277473954 Initial revision
claus
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
3f9277473954 Initial revision
claus
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
3f9277473954 Initial revision
claus
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
3f9277473954 Initial revision
claus
parents:
diff changeset
    12
 hereby transferred.
3f9277473954 Initial revision
claus
parents:
diff changeset
    13
"
1571
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
    14
"{ Package: 'stx:libview2' }"
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
    15
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
    16
"{ NameSpace: Smalltalk }"
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
    17
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    18
ImageReader subclass:#TIFFReader
192
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
    19
	instanceVariableNames:'planarConfiguration subFileType stripOffsets rowsPerStrip
159
327da5085900 fixed saving of 24bit RGB images (forgot samplesPerPixel-TAG)
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    20
		fillOrder compression group3options predictor stripByteCounts
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    21
		currentOffset stripOffsetsPos stripByteCountsPos stripRowCounts
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    22
		bitsPerSamplePos colorMapPos orientation isBigTiff tileOffsets
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    23
		tileByteCounts tileWidth tileLength sampleFormat minSampleValue
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    24
		maxSampleValue subIfds decodeMetaTags loadFullResolutionImage
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    25
		isDNGImage'
4347
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    26
	classVariableNames:'COMPRESSION_ADOBE_DEFLATE COMPRESSION_CCITTFAX3
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    27
		COMPRESSION_CCITTFAX4 COMPRESSION_CCITTRLE COMPRESSION_CCITTRLEW
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    28
		COMPRESSION_DCS COMPRESSION_DEFLATE COMPRESSION_IT8BL
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    29
		COMPRESSION_IT8CTPAD COMPRESSION_IT8LW COMPRESSION_IT8MP
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    30
		COMPRESSION_JBIG COMPRESSION_JBIG2 COMPRESSION_JBIG_T43
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    31
		COMPRESSION_JBIG_T85 COMPRESSION_JPEG COMPRESSION_JPEG2000
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    32
		COMPRESSION_LZW COMPRESSION_NEXT COMPRESSION_NEXT_JPEG
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    33
		COMPRESSION_NIKON_NEF COMPRESSION_NONE COMPRESSION_OJPEG
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    34
		COMPRESSION_PACKBITS COMPRESSION_PIXARFILM COMPRESSION_PIXARLOG
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    35
		COMPRESSION_SGILOG COMPRESSION_SGILOG24 COMPRESSION_THUNDERSCAN
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    36
		FILETYPE_MASK_MASK FILETYPE_MASK_PAGE FILETYPE_MASK_REDUCEDIMAGE
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    37
		FILLORDER_LSB2MSB FILLORDER_MSB2LSB PLANARCONFIG_CONTIG
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    38
		PLANARCONFIG_SEPARATE SAMPLEFORMAT_COMPLEXIEEEFP
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    39
		SAMPLEFORMAT_COMPLEXINT SAMPLEFORMAT_IEEEFP SAMPLEFORMAT_INT
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
    40
		SAMPLEFORMAT_UINT SAMPLEFORMAT_VOID Verbose'
192
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
    41
	poolDictionaries:''
1745
4fa0fad2a463 code cleanup (colorMap handling)
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
    42
	category:'Graphics-Images-Readers'
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    43
!
3f9277473954 Initial revision
claus
parents:
diff changeset
    44
3693
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    45
Dictionary subclass:#TIFFMetaData
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    46
	instanceVariableNames:''
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    47
	classVariableNames:''
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    48
	poolDictionaries:''
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    49
	privateIn:TIFFReader
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    50
!
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    51
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
    52
!TIFFReader class methodsFor:'documentation'!
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    53
21
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    54
copyright
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    55
"
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    56
 COPYRIGHT (c) 1991 by Claus Gittinger
28
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
    57
	      All Rights Reserved
21
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    58
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    59
 This software is furnished under a license and may be used
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    60
 only in accordance with the terms of that license and with the
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    61
 inclusion of the above copyright notice.   This software may not
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    62
 be provided or otherwise made available to, or used by, any
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    63
 other person.  No title to or ownership of the software is
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    64
 hereby transferred.
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    65
"
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    66
!
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    67
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    68
documentation
3f9277473954 Initial revision
claus
parents:
diff changeset
    69
"
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    70
    This class knows how to read TIFF files and how to write uncompressed TIFF files.
14
20638e830834 *** empty log message ***
claus
parents: 11
diff changeset
    71
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    72
    Implemented & Missing Features:
14
20638e830834 *** empty log message ***
claus
parents: 11
diff changeset
    73
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    74
      - Only single image files are supported.
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    75
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    76
      - Not all formats are implemented, and of those that are, not all are tested.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
    77
        It should read with most rgb, palette, mono and greyscale images, 
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
    78
        although the alpha channel is currently not supported and ignored.
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    79
        It supports reading of uncompressed, LZW, packbits and CCITT-G3 compressed images
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    80
        JPEG and many other formats are currently not implemented.
30
9638bc775850 *** empty log message ***
claus
parents: 28
diff changeset
    81
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    82
      - Only writing of uncompressed images is currently implemented.
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    83
        It should write (at least) mono, 8-bit palette and 24 bit rgb formats.
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    84
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    85
      - bigTiff is supported
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    86
      
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
    87
      - some dng tags are supported
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    88
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    89
    More formats will come... (will they ever be needed?)
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    90
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    91
    TODO (?): 
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    92
        since I don't want to spend all of my life adding more formats here and
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    93
        reinventing the wheel, this code should be changed to use the tiff library.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    94
        That would give us most formats and also writing capabilities for free.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    95
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    96
        Late note: 
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    97
            I hate C and interfacing to C libraries: it almost always leads to trouble
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    98
            w.r.t. memory leaks, non-reentrancy, non-interruptability etc.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    99
            (we recently fixed a malloc-non-reentrant bug for some architecture...)
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   100
            So its probably better to do it all in a real programming language ;-)
195
7975a2c4a890 commentary
Claus Gittinger <cg@exept.de>
parents: 192
diff changeset
   101
220
4106d9ce7e02 documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
   102
    [author:]
4106d9ce7e02 documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
   103
        Claus Gittinger
4106d9ce7e02 documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
   104
195
7975a2c4a890 commentary
Claus Gittinger <cg@exept.de>
parents: 192
diff changeset
   105
    [See also:]
234
b6352d13e792 xrefs in documentation
Claus Gittinger <cg@exept.de>
parents: 220
diff changeset
   106
        Image Form Icon
4103
2d8da32cf18b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4015
diff changeset
   107
        BlitImageReader FaceReader GIFReader JPEGReader MacOSXIconReader
2d8da32cf18b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4015
diff changeset
   108
        PBMReader PCXReader PNGReader 
210
5405de794686 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   109
        ST80FormReader SunRasterReader TargaReader WindowsIconReader 
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   110
        XBMReader XPMReader XWDReader
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
   111
        https://exiftool.org/TagNames/EXIF.html
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
   112
        http://www.loc.gov/preservation/digital/formats/content/tiff_tags.shtml
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   113
"
3f9277473954 Initial revision
claus
parents:
diff changeset
   114
! !
3f9277473954 Initial revision
claus
parents:
diff changeset
   115
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   116
!TIFFReader class methodsFor:'initialization'!
28
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
   117
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
   118
initialize
198
6d76856aaa80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   119
    "install myself in the Image classes fileFormat table
398
aef700d15416 new suffix-table
Claus Gittinger <cg@exept.de>
parents: 393
diff changeset
   120
     for the `.tiff' and `.tif' extensions."
198
6d76856aaa80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   121
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   122
    MIMETypes defineImageType:'image/tiff' suffix:'tif'  reader:self info:'tiff image'.
647
6f26c76aa0c9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 623
diff changeset
   123
    MIMETypes defineImageType:nil          suffix:'tiff' reader:self.
198
6d76856aaa80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   124
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   125
    MIMETypes defineImageType:'image/x-adobe-dng' suffix:'dng' reader:self info:'digital negative image'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   126
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   127
    COMPRESSION_NONE            := 1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   128
    COMPRESSION_CCITTRLE        := 2.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   129
    COMPRESSION_CCITTFAX3       := 3.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   130
    COMPRESSION_CCITTFAX4       := 4.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   131
    COMPRESSION_LZW             := 5.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   132
    COMPRESSION_OJPEG           := 6. "/ (old style jpeg)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   133
    COMPRESSION_JPEG            := 7. "/ (new style jpeg)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   134
    COMPRESSION_ADOBE_DEFLATE   := 8.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   135
    COMPRESSION_JBIG_T85        := 9.  "/ (ITU-T T85)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   136
    COMPRESSION_JBIG_T43        := 10. "/ (ITU-T T43)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   137
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   138
    COMPRESSION_NEXT            := 32766. "/ (NeXT 2-bit encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   139
    COMPRESSION_CCITTRLEW       := 32771.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   140
    COMPRESSION_PACKBITS        := 32773.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   141
    COMPRESSION_THUNDERSCAN     := 32809. "/ (ThunderScan 4-bit encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   142
    COMPRESSION_NEXT_JPEG       := 32865. "/ (NeXT jpeg encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   143
    COMPRESSION_IT8CTPAD        := 32895.  
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   144
    COMPRESSION_IT8LW           := 32896.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   145
    COMPRESSION_IT8MP           := 32897. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   146
    COMPRESSION_IT8BL           := 32898. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   147
    COMPRESSION_PIXARFILM       := 32908.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   148
    COMPRESSION_PIXARLOG        := 32909. "/ (Pixar companded 11-bit ZIP encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   149
    COMPRESSION_DEFLATE         := 32946. "/ (PKZIP-style Deflate encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   150
    COMPRESSION_DCS             := 32947. "/ (kodac)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   151
    COMPRESSION_JBIG            := 34661.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   152
    COMPRESSION_SGILOG          := 34676. "/ (SGI 32-bit Log Luminance encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   153
    COMPRESSION_SGILOG24        := 34677. "/ (SGI 24-bit Log Luminance encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   154
    COMPRESSION_JPEG2000        := 34712. "/ JPEG2000
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   155
    COMPRESSION_NIKON_NEF       := 34713.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   156
    COMPRESSION_JBIG2           := 34715.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   157
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   158
    SAMPLEFORMAT_UINT           := 1.       "/ !!unsigned integer data 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   159
    SAMPLEFORMAT_INT            := 2.       "/ !!signed integer data 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   160
    SAMPLEFORMAT_IEEEFP         := 3.       "/ !!IEEE floating point data 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   161
    SAMPLEFORMAT_VOID           := 4.       "/ !!untyped data 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   162
    SAMPLEFORMAT_COMPLEXINT     := 5.       "/ !!complex signed int 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   163
    SAMPLEFORMAT_COMPLEXIEEEFP  := 6.       "/ !!complex ieee floating 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   164
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   165
    PLANARCONFIG_CONTIG         := 1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   166
    PLANARCONFIG_SEPARATE       := 2.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   167
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   168
    FILETYPE_MASK_REDUCEDIMAGE  := 1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   169
    FILETYPE_MASK_PAGE          := 2.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   170
    FILETYPE_MASK_MASK          := 4. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   171
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
   172
    FILLORDER_MSB2LSB := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
   173
    FILLORDER_LSB2MSB := 2.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
   174
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   175
"/    TYPE_NOTYPE := 0.           "/ placeholder 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   176
"/    TYPE_BYTE   := 1.           "/ 8-bit unsigned integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   177
"/    TYPE_ASCII  := 2.           "/ 8-bit bytes w/ last byte null 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   178
"/    TYPE_SHORT  := 3.           "/ 16-bit unsigned integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   179
"/    TYPE_LONG   := 4.           "/ 32-bit unsigned integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   180
"/    TYPE_RATIONAL := 5.         "/ 64-bit unsigned fraction 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   181
"/    TYPE_SBYTE  := 6.           "/ !!8-bit signed integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   182
"/    TYPE_UNDEFINED  := 7.       "/ !!8-bit untyped data 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   183
"/    TYPE_SSHORT     := 8.       "/ !!16-bit signed integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   184
"/    TYPE_SLONG      := 9.       "/ !!32-bit signed integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   185
"/    TYPE_SRATIONAL  := 10.      "/ !!64-bit signed fraction 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   186
"/    TYPE_FLOAT      := 11.      "/ !!32-bit IEEE floating point 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   187
"/    TYPE_DOUBLE     := 12.      "/ !!64-bit IEEE floating point 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   188
"/    TYPE_IFD        := 13.      "/ %32-bit unsigned integer (offset) 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   189
"/    TYPE_LONG8      := 16.      "/ BigTIFF 64-bit unsigned integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   190
"/    TYPE_SLONG8     := 17.      "/ BigTIFF 64-bit signed integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   191
"/    TYPE_IFD8       := 18.      "/ BigTIFF 64-bit unsigned integer (offset) 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   192
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   193
    "/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   194
    "/ TIFF tags
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   195
    "/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   196
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   197
"/    #define TIFFTAG_SUBFILETYPE             254     /* subfile data descriptor */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   198
"/    #define     FILETYPE_REDUCEDIMAGE       0x1     /* reduced resolution version */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   199
"/    #define     FILETYPE_PAGE               0x2     /* one page of many */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   200
"/    #define     FILETYPE_MASK               0x4     /* transparency mask */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   201
"/    #define TIFFTAG_OSUBFILETYPE            255     /* +kind of data in subfile */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   202
"/    #define     OFILETYPE_IMAGE             1       /* full resolution image data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   203
"/    #define     OFILETYPE_REDUCEDIMAGE      2       /* reduced size image data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   204
"/    #define     OFILETYPE_PAGE              3       /* one page of many */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   205
"/    #define TIFFTAG_IMAGEWIDTH              256     /* image width in pixels */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   206
"/    #define TIFFTAG_IMAGELENGTH             257     /* image height in pixels */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   207
"/    #define TIFFTAG_BITSPERSAMPLE           258     /* bits per channel (sample) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   208
"/    #define TIFFTAG_COMPRESSION             259     /* data compression technique */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   209
"/    #define     COMPRESSION_NONE            1       /* dump mode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   210
"/    #define     COMPRESSION_CCITTRLE        2       /* CCITT modified Huffman RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   211
"/    #define     COMPRESSION_CCITTFAX3       3       /* CCITT Group 3 fax encoding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   212
"/    #define     COMPRESSION_CCITT_T4        3       /* CCITT T.4 (TIFF 6 name) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   213
"/    #define     COMPRESSION_CCITTFAX4       4       /* CCITT Group 4 fax encoding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   214
"/    #define     COMPRESSION_CCITT_T6        4       /* CCITT T.6 (TIFF 6 name) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   215
"/    #define     COMPRESSION_LZW             5       /* Lempel-Ziv  & Welch */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   216
"/    #define     COMPRESSION_OJPEG           6       /* !!6.0 JPEG */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   217
"/    #define     COMPRESSION_JPEG            7       /* %JPEG DCT compression */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   218
"/    #define     COMPRESSION_T85                     9       /* !!TIFF/FX T.85 JBIG compression */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   219
"/    #define     COMPRESSION_T43                     10      /* !!TIFF/FX T.43 colour by layered JBIG compression */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   220
"/    #define     COMPRESSION_NEXT            32766   /* NeXT 2-bit RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   221
"/    #define     COMPRESSION_CCITTRLEW       32771   /* #1 w/ word alignment */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   222
"/    #define     COMPRESSION_PACKBITS        32773   /* Macintosh RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   223
"/    #define     COMPRESSION_THUNDERSCAN     32809   /* ThunderScan RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   224
"/    /* codes 32895-32898 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   225
"/    #define     COMPRESSION_IT8CTPAD        32895   /* IT8 CT w/padding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   226
"/    #define     COMPRESSION_IT8LW           32896   /* IT8 Linework RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   227
"/    #define     COMPRESSION_IT8MP           32897   /* IT8 Monochrome picture */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   228
"/    #define     COMPRESSION_IT8BL           32898   /* IT8 Binary line art */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   229
"/    /* compression codes 32908-32911 are reserved for Pixar */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   230
"/    #define     COMPRESSION_PIXARFILM       32908   /* Pixar companded 10bit LZW */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   231
"/    #define     COMPRESSION_PIXARLOG        32909   /* Pixar companded 11bit ZIP */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   232
"/    #define     COMPRESSION_DEFLATE         32946   /* Deflate compression */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   233
"/    #define     COMPRESSION_ADOBE_DEFLATE   8       /* Deflate compression,
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   234
"/                                                       as recognized by Adobe */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   235
"/    /* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   236
"/    #define     COMPRESSION_DCS             32947   /* Kodak DCS encoding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   237
"/    #define     COMPRESSION_JBIG            34661   /* ISO JBIG */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   238
"/    #define     COMPRESSION_SGILOG          34676   /* SGI Log Luminance RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   239
"/    #define     COMPRESSION_SGILOG24        34677   /* SGI Log 24-bit packed */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   240
"/    #define     COMPRESSION_JP2000          34712   /* Leadtools JPEG2000 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   241
"/    #define     COMPRESSION_LZMA            34925   /* LZMA2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   242
"/    #define TIFFTAG_PHOTOMETRIC             262     /* photometric interpretation */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   243
"/    #define     PHOTOMETRIC_MINISWHITE      0       /* min value is white */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   244
"/    #define     PHOTOMETRIC_MINISBLACK      1       /* min value is black */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   245
"/    #define     PHOTOMETRIC_RGB             2       /* RGB color model */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   246
"/    #define     PHOTOMETRIC_PALETTE         3       /* color map indexed */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   247
"/    #define     PHOTOMETRIC_MASK            4       /* $holdout mask */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   248
"/    #define     PHOTOMETRIC_SEPARATED       5       /* !!color separations */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   249
"/    #define     PHOTOMETRIC_YCBCR           6       /* !!CCIR 601 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   250
"/    #define     PHOTOMETRIC_CIELAB          8       /* !!1976 CIE L*a*b* */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   251
"/    #define     PHOTOMETRIC_ICCLAB          9       /* ICC L*a*b* [Adobe TIFF Technote 4] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   252
"/    #define     PHOTOMETRIC_ITULAB          10      /* ITU L*a*b* */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   253
"/    #define     PHOTOMETRIC_CFA             32803   /* color filter array */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   254
"/    #define     PHOTOMETRIC_LOGL            32844   /* CIE Log2(L) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   255
"/    #define     PHOTOMETRIC_LOGLUV          32845   /* CIE Log2(L) (u',v') */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   256
"/    #define TIFFTAG_THRESHHOLDING           263     /* +thresholding used on data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   257
"/    #define     THRESHHOLD_BILEVEL          1       /* b&w art scan */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   258
"/    #define     THRESHHOLD_HALFTONE         2       /* or dithered scan */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   259
"/    #define     THRESHHOLD_ERRORDIFFUSE     3       /* usually floyd-steinberg */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   260
"/    #define TIFFTAG_CELLWIDTH               264     /* +dithering matrix width */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   261
"/    #define TIFFTAG_CELLLENGTH              265     /* +dithering matrix height */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   262
"/    #define TIFFTAG_FILLORDER               266     /* data order within a byte */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   263
"/    #define     FILLORDER_MSB2LSB           1       /* most significant -> least */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   264
"/    #define     FILLORDER_LSB2MSB           2       /* least significant -> most */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   265
"/    #define TIFFTAG_DOCUMENTNAME            269     /* name of doc. image is from */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   266
"/    #define TIFFTAG_IMAGEDESCRIPTION        270     /* info about image */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   267
"/    #define TIFFTAG_MAKE                    271     /* scanner manufacturer name */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   268
"/    #define TIFFTAG_MODEL                   272     /* scanner model name/number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   269
"/    #define TIFFTAG_STRIPOFFSETS            273     /* offsets to data strips */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   270
"/    #define TIFFTAG_ORIENTATION             274     /* +image orientation */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   271
"/    #define     ORIENTATION_TOPLEFT         1       /* row 0 top, col 0 lhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   272
"/    #define     ORIENTATION_TOPRIGHT        2       /* row 0 top, col 0 rhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   273
"/    #define     ORIENTATION_BOTRIGHT        3       /* row 0 bottom, col 0 rhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   274
"/    #define     ORIENTATION_BOTLEFT         4       /* row 0 bottom, col 0 lhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   275
"/    #define     ORIENTATION_LEFTTOP         5       /* row 0 lhs, col 0 top */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   276
"/    #define     ORIENTATION_RIGHTTOP        6       /* row 0 rhs, col 0 top */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   277
"/    #define     ORIENTATION_RIGHTBOT        7       /* row 0 rhs, col 0 bottom */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   278
"/    #define     ORIENTATION_LEFTBOT         8       /* row 0 lhs, col 0 bottom */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   279
"/    #define TIFFTAG_SAMPLESPERPIXEL         277     /* samples per pixel */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   280
"/    #define TIFFTAG_ROWSPERSTRIP            278     /* rows per strip of data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   281
"/    #define TIFFTAG_STRIPBYTECOUNTS         279     /* bytes counts for strips */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   282
"/    #define TIFFTAG_MINSAMPLEVALUE          280     /* +minimum sample value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   283
"/    #define TIFFTAG_MAXSAMPLEVALUE          281     /* +maximum sample value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   284
"/    #define TIFFTAG_XRESOLUTION             282     /* pixels/resolution in x */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   285
"/    #define TIFFTAG_YRESOLUTION             283     /* pixels/resolution in y */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   286
"/    #define TIFFTAG_PLANARCONFIG            284     /* storage organization */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   287
"/    #define     PLANARCONFIG_CONTIG         1       /* single image plane */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   288
"/    #define     PLANARCONFIG_SEPARATE       2       /* separate planes of data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   289
"/    #define TIFFTAG_PAGENAME                285     /* page name image is from */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   290
"/    #define TIFFTAG_XPOSITION               286     /* x page offset of image lhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   291
"/    #define TIFFTAG_YPOSITION               287     /* y page offset of image lhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   292
"/    #define TIFFTAG_FREEOFFSETS             288     /* +byte offset to free block */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   293
"/    #define TIFFTAG_FREEBYTECOUNTS          289     /* +sizes of free blocks */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   294
"/    #define TIFFTAG_GRAYRESPONSEUNIT        290     /* $gray scale curve accuracy */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   295
"/    #define     GRAYRESPONSEUNIT_10S        1       /* tenths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   296
"/    #define     GRAYRESPONSEUNIT_100S       2       /* hundredths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   297
"/    #define     GRAYRESPONSEUNIT_1000S      3       /* thousandths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   298
"/    #define     GRAYRESPONSEUNIT_10000S     4       /* ten-thousandths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   299
"/    #define     GRAYRESPONSEUNIT_100000S    5       /* hundred-thousandths */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   300
"/    #define TIFFTAG_GRAYRESPONSECURVE       291     /* $gray scale response curve */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   301
"/    #define TIFFTAG_GROUP3OPTIONS           292     /* 32 flag bits */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   302
"/    #define TIFFTAG_T4OPTIONS               292     /* TIFF 6.0 proper name alias */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   303
"/    #define     GROUP3OPT_2DENCODING        0x1     /* 2-dimensional coding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   304
"/    #define     GROUP3OPT_UNCOMPRESSED      0x2     /* data not compressed */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   305
"/    #define     GROUP3OPT_FILLBITS          0x4     /* fill to byte boundary */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   306
"/    #define TIFFTAG_GROUP4OPTIONS           293     /* 32 flag bits */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   307
"/    #define TIFFTAG_T6OPTIONS               293     /* TIFF 6.0 proper name */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   308
"/    #define     GROUP4OPT_UNCOMPRESSED      0x2     /* data not compressed */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   309
"/    #define TIFFTAG_RESOLUTIONUNIT          296     /* units of resolutions */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   310
"/    #define     RESUNIT_NONE                1       /* no meaningful units */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   311
"/    #define     RESUNIT_INCH                2       /* english */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   312
"/    #define     RESUNIT_CENTIMETER          3       /* metric */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   313
"/    #define TIFFTAG_PAGENUMBER              297     /* page numbers of multi-page */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   314
"/    #define TIFFTAG_COLORRESPONSEUNIT       300     /* $color curve accuracy */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   315
"/    #define     COLORRESPONSEUNIT_10S       1       /* tenths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   316
"/    #define     COLORRESPONSEUNIT_100S      2       /* hundredths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   317
"/    #define     COLORRESPONSEUNIT_1000S     3       /* thousandths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   318
"/    #define     COLORRESPONSEUNIT_10000S    4       /* ten-thousandths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   319
"/    #define     COLORRESPONSEUNIT_100000S   5       /* hundred-thousandths */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   320
"/    #define TIFFTAG_TRANSFERFUNCTION        301     /* !!colorimetry info */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   321
"/    #define TIFFTAG_SOFTWARE                305     /* name & release */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   322
"/    #define TIFFTAG_DATETIME                306     /* creation date and time */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   323
"/    #define TIFFTAG_ARTIST                  315     /* creator of image */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   324
"/    #define TIFFTAG_HOSTCOMPUTER            316     /* machine where created */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   325
"/    #define TIFFTAG_PREDICTOR               317     /* prediction scheme w/ LZW */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   326
"/    #define     PREDICTOR_NONE              1       /* no prediction scheme used */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   327
"/    #define     PREDICTOR_HORIZONTAL        2       /* horizontal differencing */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   328
"/    #define     PREDICTOR_FLOATINGPOINT     3       /* floating point predictor */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   329
"/    #define TIFFTAG_WHITEPOINT              318     /* image white point */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   330
"/    #define TIFFTAG_PRIMARYCHROMATICITIES   319     /* !!primary chromaticities */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   331
"/    #define TIFFTAG_COLORMAP                320     /* RGB map for palette image */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   332
"/    #define TIFFTAG_HALFTONEHINTS           321     /* !!highlight+shadow info */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   333
"/    #define TIFFTAG_TILEWIDTH               322     /* !!tile width in pixels */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   334
"/    #define TIFFTAG_TILELENGTH              323     /* !!tile height in pixels */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   335
"/    #define TIFFTAG_TILEOFFSETS             324     /* !!offsets to data tiles */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   336
"/    #define TIFFTAG_TILEBYTECOUNTS          325     /* !!byte counts for tiles */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   337
"/    #define TIFFTAG_BADFAXLINES             326     /* lines w/ wrong pixel count */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   338
"/    #define TIFFTAG_CLEANFAXDATA            327     /* regenerated line info */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   339
"/    #define     CLEANFAXDATA_CLEAN          0       /* no errors detected */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   340
"/    #define     CLEANFAXDATA_REGENERATED    1       /* receiver regenerated lines */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   341
"/    #define     CLEANFAXDATA_UNCLEAN        2       /* uncorrected errors exist */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   342
"/    #define TIFFTAG_CONSECUTIVEBADFAXLINES  328     /* max consecutive bad lines */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   343
"/    #define TIFFTAG_SUBIFD                  330     /* subimage descriptors */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   344
"/    #define TIFFTAG_INKSET                  332     /* !!inks in separated image */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   345
"/    #define     INKSET_CMYK                 1       /* !!cyan-magenta-yellow-black color */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   346
"/    #define     INKSET_MULTIINK             2       /* !!multi-ink or hi-fi color */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   347
"/    #define TIFFTAG_INKNAMES                333     /* !!ascii names of inks */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   348
"/    #define TIFFTAG_NUMBEROFINKS            334     /* !!number of inks */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   349
"/    #define TIFFTAG_DOTRANGE                336     /* !!0% and 100% dot codes */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   350
"/    #define TIFFTAG_TARGETPRINTER           337     /* !!separation target */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   351
"/    #define TIFFTAG_EXTRASAMPLES            338     /* !!info about extra samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   352
"/    #define     EXTRASAMPLE_UNSPECIFIED     0       /* !!unspecified data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   353
"/    #define     EXTRASAMPLE_ASSOCALPHA      1       /* !!associated alpha data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   354
"/    #define     EXTRASAMPLE_UNASSALPHA      2       /* !!unassociated alpha data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   355
"/    #define TIFFTAG_SAMPLEFORMAT            339     /* !!data sample format */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   356
"/    #define     SAMPLEFORMAT_UINT           1       /* !!unsigned integer data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   357
"/    #define     SAMPLEFORMAT_INT            2       /* !!signed integer data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   358
"/    #define     SAMPLEFORMAT_IEEEFP         3       /* !!IEEE floating point data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   359
"/    #define     SAMPLEFORMAT_VOID           4       /* !!untyped data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   360
"/    #define     SAMPLEFORMAT_COMPLEXINT     5       /* !!complex signed int */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   361
"/    #define     SAMPLEFORMAT_COMPLEXIEEEFP  6       /* !!complex ieee floating */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   362
"/    #define TIFFTAG_SMINSAMPLEVALUE         340     /* !!variable MinSampleValue */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   363
"/    #define TIFFTAG_SMAXSAMPLEVALUE         341     /* !!variable MaxSampleValue */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   364
"/    #define TIFFTAG_CLIPPATH                343     /* %ClipPath
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   365
"/                                                       [Adobe TIFF technote 2] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   366
"/    #define TIFFTAG_XCLIPPATHUNITS          344     /* %XClipPathUnits
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   367
"/                                                       [Adobe TIFF technote 2] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   368
"/    #define TIFFTAG_YCLIPPATHUNITS          345     /* %YClipPathUnits
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   369
"/                                                       [Adobe TIFF technote 2] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   370
"/    #define TIFFTAG_INDEXED                 346     /* %Indexed
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   371
"/                                                       [Adobe TIFF Technote 3] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   372
"/    #define TIFFTAG_JPEGTABLES              347     /* %JPEG table stream */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   373
"/    #define TIFFTAG_OPIPROXY                351     /* %OPI Proxy [Adobe TIFF technote] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   374
"/    /* Tags 400-435 are from the TIFF/FX spec */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   375
"/    #define TIFFTAG_GLOBALPARAMETERSIFD     400     /* !! */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   376
"/    #define TIFFTAG_PROFILETYPE                     401     /* !! */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   377
"/    #define     PROFILETYPE_UNSPECIFIED     0       /* !! */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   378
"/    #define     PROFILETYPE_G3_FAX          1       /* !! */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   379
"/    #define TIFFTAG_FAXPROFILE                      402     /* !! */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   380
"/    #define     FAXPROFILE_S                        1       /* !!TIFF/FX FAX profile S */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   381
"/    #define     FAXPROFILE_F                        2       /* !!TIFF/FX FAX profile F */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   382
"/    #define     FAXPROFILE_J                        3       /* !!TIFF/FX FAX profile J */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   383
"/    #define     FAXPROFILE_C                        4       /* !!TIFF/FX FAX profile C */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   384
"/    #define     FAXPROFILE_L                        5       /* !!TIFF/FX FAX profile L */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   385
"/    #define     FAXPROFILE_M                        6       /* !!TIFF/FX FAX profile LM */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   386
"/    #define TIFFTAG_CODINGMETHODS           403     /* !!TIFF/FX coding methods */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   387
"/    #define     CODINGMETHODS_T4_1D         (1 << 1)        /* !!T.4 1D */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   388
"/    #define     CODINGMETHODS_T4_2D         (1 << 2)        /* !!T.4 2D */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   389
"/    #define     CODINGMETHODS_T6            (1 << 3)        /* !!T.6 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   390
"/    #define     CODINGMETHODS_T85           (1 << 4)        /* !!T.85 JBIG */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   391
"/    #define     CODINGMETHODS_T42           (1 << 5)        /* !!T.42 JPEG */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   392
"/    #define     CODINGMETHODS_T43           (1 << 6)        /* !!T.43 colour by layered JBIG */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   393
"/    #define TIFFTAG_VERSIONYEAR                     404     /* !!TIFF/FX version year */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   394
"/    #define TIFFTAG_MODENUMBER                      405     /* !!TIFF/FX mode number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   395
"/    #define TIFFTAG_DECODE                          433     /* !!TIFF/FX decode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   396
"/    #define TIFFTAG_IMAGEBASECOLOR          434     /* !!TIFF/FX image base colour */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   397
"/    #define TIFFTAG_T82OPTIONS                      435     /* !!TIFF/FX T.82 options */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   398
"/    /*
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   399
"/     * Tags 512-521 are obsoleted by Technical Note #2 which specifies a
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   400
"/     * revised JPEG-in-TIFF scheme.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   401
"/     */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   402
"/    #define TIFFTAG_JPEGPROC                512     /* !!JPEG processing algorithm */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   403
"/    #define     JPEGPROC_BASELINE           1       /* !!baseline sequential */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   404
"/    #define     JPEGPROC_LOSSLESS           14      /* !!Huffman coded lossless */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   405
"/    #define TIFFTAG_JPEGIFOFFSET            513     /* !!pointer to SOI marker */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   406
"/    #define TIFFTAG_JPEGIFBYTECOUNT         514     /* !!JFIF stream length */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   407
"/    #define TIFFTAG_JPEGRESTARTINTERVAL     515     /* !!restart interval length */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   408
"/    #define TIFFTAG_JPEGLOSSLESSPREDICTORS  517     /* !!lossless proc predictor */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   409
"/    #define TIFFTAG_JPEGPOINTTRANSFORM      518     /* !!lossless point transform */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   410
"/    #define TIFFTAG_JPEGQTABLES             519     /* !!Q matrix offsets */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   411
"/    #define TIFFTAG_JPEGDCTABLES            520     /* !!DCT table offsets */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   412
"/    #define TIFFTAG_JPEGACTABLES            521     /* !!AC coefficient offsets */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   413
"/    #define TIFFTAG_YCBCRCOEFFICIENTS       529     /* !!RGB -> YCbCr transform */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   414
"/    #define TIFFTAG_YCBCRSUBSAMPLING        530     /* !!YCbCr subsampling factors */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   415
"/    #define TIFFTAG_YCBCRPOSITIONING        531     /* !!subsample positioning */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   416
"/    #define     YCBCRPOSITION_CENTERED      1       /* !!as in PostScript Level 2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   417
"/    #define     YCBCRPOSITION_COSITED       2       /* !!as in CCIR 601-1 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   418
"/    #define TIFFTAG_REFERENCEBLACKWHITE     532     /* !!colorimetry info */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   419
"/    #define TIFFTAG_STRIPROWCOUNTS          559 /* !!TIFF/FX strip row counts */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   420
"/    #define TIFFTAG_XMLPACKET               700     /* %XML packet
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   421
"/                                                       [Adobe XMP Specification,
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   422
"/                                                       January 2004 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   423
"/    #define TIFFTAG_OPIIMAGEID              32781   /* %OPI ImageID
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   424
"/                                                       [Adobe TIFF technote] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   425
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   426
"/    /* tags 32952-32956 are private tags registered to Island Graphics */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   427
"/    #define TIFFTAG_REFPTS                  32953   /* image reference points */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   428
"/    #define TIFFTAG_REGIONTACKPOINT         32954   /* region-xform tack point */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   429
"/    #define TIFFTAG_REGIONWARPCORNERS       32955   /* warp quadrilateral */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   430
"/    #define TIFFTAG_REGIONAFFINE            32956   /* affine transformation mat */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   431
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   432
"/    /* tags 32995-32999 are private tags registered to SGI */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   433
"/    #define TIFFTAG_MATTEING                32995   /* $use ExtraSamples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   434
"/    #define TIFFTAG_DATATYPE                32996   /* $use SampleFormat */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   435
"/    #define TIFFTAG_IMAGEDEPTH              32997   /* z depth of image */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   436
"/    #define TIFFTAG_TILEDEPTH               32998   /* z depth/data tile */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   437
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   438
"/    /* tags 33300-33309 are private tags registered to Pixar */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   439
"/    /*
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   440
"/     * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   441
"/     * are set when an image has been cropped out of a larger image.  
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   442
"/     * They reflect the size of the original uncropped image.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   443
"/     * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   444
"/     * to determine the position of the smaller image in the larger one.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   445
"/     */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   446
"/    #define TIFFTAG_PIXAR_IMAGEFULLWIDTH    33300   /* full image size in x */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   447
"/    #define TIFFTAG_PIXAR_IMAGEFULLLENGTH   33301   /* full image size in y */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   448
"/     /* Tags 33302-33306 are used to identify special image modes and data
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   449
"/      * used by Pixar's texture formats.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   450
"/      */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   451
"/    #define TIFFTAG_PIXAR_TEXTUREFORMAT     33302   /* texture map format */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   452
"/    #define TIFFTAG_PIXAR_WRAPMODES         33303   /* s & t wrap modes */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   453
"/    #define TIFFTAG_PIXAR_FOVCOT            33304   /* cotan(fov) for env. maps */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   454
"/    #define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   455
"/    #define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   456
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   457
"/    /* tag 33405 is a private tag registered to Eastman Kodak */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   458
"/    #define TIFFTAG_WRITERSERIALNUMBER      33405   /* device serial number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   459
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   460
"/    #define TIFFTAG_CFAREPEATPATTERNDIM     33421   /* dimensions of CFA pattern */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   461
"/    #define TIFFTAG_CFAPATTERN              33422   /* color filter array pattern */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   462
"/    /* tag 33432 is listed in the 6.0 spec w/ unknown ownership */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   463
"/    #define TIFFTAG_COPYRIGHT               33432   /* copyright string */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   464
"/    /* IPTC TAG from RichTIFF specifications */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   465
"/    #define TIFFTAG_RICHTIFFIPTC            33723
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   466
"/    /* 34016-34029 are reserved for ANSI IT8 TIFF/IT <dkelly@apago.com) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   467
"/    #define TIFFTAG_IT8SITE                 34016   /* site name */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   468
"/    #define TIFFTAG_IT8COLORSEQUENCE        34017   /* color seq. [RGB,CMYK,etc] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   469
"/    #define TIFFTAG_IT8HEADER               34018   /* DDES Header */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   470
"/    #define TIFFTAG_IT8RASTERPADDING        34019   /* raster scanline padding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   471
"/    #define TIFFTAG_IT8BITSPERRUNLENGTH     34020   /* # of bits in short run */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   472
"/    #define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   473
"/    #define TIFFTAG_IT8COLORTABLE           34022   /* LW colortable */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   474
"/    #define TIFFTAG_IT8IMAGECOLORINDICATOR  34023   /* BP/BL image color switch */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   475
"/    #define TIFFTAG_IT8BKGCOLORINDICATOR    34024   /* BP/BL bg color switch */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   476
"/    #define TIFFTAG_IT8IMAGECOLORVALUE      34025   /* BP/BL image color value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   477
"/    #define TIFFTAG_IT8BKGCOLORVALUE        34026   /* BP/BL bg color value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   478
"/    #define TIFFTAG_IT8PIXELINTENSITYRANGE  34027   /* MP pixel intensity value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   479
"/    #define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028  /* HC transparency switch */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   480
"/    #define TIFFTAG_IT8COLORCHARACTERIZATION 34029  /* color character. table */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   481
"/    #define TIFFTAG_IT8HCUSAGE              34030   /* HC usage indicator */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   482
"/    #define TIFFTAG_IT8TRAPINDICATOR        34031   /* Trapping indicator
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   483
"/                                                       (untrapped=0, trapped=1) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   484
"/    #define TIFFTAG_IT8CMYKEQUIVALENT       34032   /* CMYK color equivalents */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   485
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   486
"/    /* tags 34232-34236 are private tags registered to Texas Instruments */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   487
"/    #define TIFFTAG_FRAMECOUNT              34232   /* Sequence Frame Count */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   488
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   489
"/    /* tag 34377 is private tag registered to Adobe for PhotoShop */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   490
"/    #define TIFFTAG_PHOTOSHOP               34377 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   491
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   492
"/    /* tags 34665, 34853 and 40965 are documented in EXIF specification */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   493
"/    #define TIFFTAG_EXIFIFD                 34665   /* Pointer to EXIF private directory */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   494
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   495
"/    /* tag 34750 is a private tag registered to Adobe? */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   496
"/    #define TIFFTAG_ICCPROFILE              34675   /* ICC profile data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   497
"/    #define TIFFTAG_IMAGELAYER              34732   /* !!TIFF/FX image layer information */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   498
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   499
"/    /* tag 34750 is a private tag registered to Pixel Magic */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   500
"/    #define TIFFTAG_JBIGOPTIONS             34750   /* JBIG options */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   501
"/    #define TIFFTAG_GPSIFD                  34853   /* Pointer to GPS private directory */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   502
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   503
"/    /* tags 34908-34914 are private tags registered to SGI */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   504
"/    #define TIFFTAG_FAXRECVPARAMS           34908   /* encoded Class 2 ses. parms */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   505
"/    #define TIFFTAG_FAXSUBADDRESS           34909   /* received SubAddr string */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   506
"/    #define TIFFTAG_FAXRECVTIME             34910   /* receive time (secs) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   507
"/    #define TIFFTAG_FAXDCS                  34911   /* encoded fax ses. params, Table 2/T.30 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   508
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   509
"/    /* tags 37439-37443 are registered to SGI <gregl@sgi.com> */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   510
"/    #define TIFFTAG_STONITS                 37439   /* Sample value to Nits */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   511
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   512
"/    /* tag 34929 is a private tag registered to FedEx */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   513
"/    #define TIFFTAG_FEDEX_EDR               34929   /* unknown use */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   514
"/    #define TIFFTAG_INTEROPERABILITYIFD     40965   /* Pointer to Interoperability private directory */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   515
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   516
    "/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   517
    "/ Adobe Digital Negative (DNG) format tags
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   518
    "/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   519
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   520
"/    #define TIFFTAG_DNGVERSION              50706   /* &DNG version number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   521
"/    #define TIFFTAG_DNGBACKWARDVERSION      50707   /* &DNG compatibility version */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   522
"/    #define TIFFTAG_UNIQUECAMERAMODEL       50708   /* &name for the camera model */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   523
"/    #define TIFFTAG_LOCALIZEDCAMERAMODEL    50709   /* &localized camera model name */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   524
"/    #define TIFFTAG_CFAPLANECOLOR           50710   /* &CFAPattern->LinearRaw space mapping */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   525
"/    #define TIFFTAG_CFALAYOUT               50711   /* &spatial layout of the CFA */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   526
"/    #define TIFFTAG_LINEARIZATIONTABLE      50712   /* &lookup table description */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   527
"/    #define TIFFTAG_BLACKLEVELREPEATDIM     50713   /* &repeat pattern size for the BlackLevel tag */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   528
"/    #define TIFFTAG_BLACKLEVEL              50714   /* &zero light encoding level */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   529
"/    #define TIFFTAG_BLACKLEVELDELTAH        50715   /* &zero light encoding level differences (columns) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   530
"/    #define TIFFTAG_BLACKLEVELDELTAV        50716   /* &zero light encoding level differences (rows) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   531
"/    #define TIFFTAG_WHITELEVEL              50717   /* &fully saturated encoding level */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   532
"/    #define TIFFTAG_DEFAULTSCALE            50718   /* &default scale factors */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   533
"/    #define TIFFTAG_DEFAULTCROPORIGIN       50719   /* &origin of the final image area */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   534
"/    #define TIFFTAG_DEFAULTCROPSIZE         50720   /* &size of the final image area */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   535
"/    #define TIFFTAG_COLORMATRIX1            50721   /* &XYZ->reference color space transformation matrix 1 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   536
"/    #define TIFFTAG_COLORMATRIX2            50722   /* &XYZ->reference color space transformation matrix 2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   537
"/    #define TIFFTAG_CAMERACALIBRATION1      50723   /* &calibration matrix 1 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   538
"/    #define TIFFTAG_CAMERACALIBRATION2      50724   /* &calibration matrix 2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   539
"/    #define TIFFTAG_REDUCTIONMATRIX1        50725   /* &dimensionality reduction matrix 1 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   540
"/    #define TIFFTAG_REDUCTIONMATRIX2        50726   /* &dimensionality reduction matrix 2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   541
"/    #define TIFFTAG_ANALOGBALANCE           50727   /* &gain applied the stored raw values*/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   542
"/    #define TIFFTAG_ASSHOTNEUTRAL           50728   /* &selected white balance in linear reference space */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   543
"/    #define TIFFTAG_ASSHOTWHITEXY           50729   /* &selected white balance in x-y chromaticity coordinates */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   544
"/    #define TIFFTAG_BASELINEEXPOSURE        50730   /* &how much to move the zero point */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   545
"/    #define TIFFTAG_BASELINENOISE           50731   /* &relative noise level */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   546
"/    #define TIFFTAG_BASELINESHARPNESS       50732   /* &relative amount of sharpening */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   547
"/    #define TIFFTAG_BAYERGREENSPLIT         50733   /* &how closely the values of the green pixels in the blue/green rows track the values of the green pixels in the red/green rows */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   548
"/    #define TIFFTAG_LINEARRESPONSELIMIT     50734   /* &non-linear encoding range */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   549
"/    #define TIFFTAG_CAMERASERIALNUMBER      50735   /* &camera's serial number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   550
"/    #define TIFFTAG_LENSINFO                50736   /* info about the lens */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   551
"/    #define TIFFTAG_CHROMABLURRADIUS        50737   /* &chroma blur radius */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   552
"/    #define TIFFTAG_ANTIALIASSTRENGTH       50738   /* &relative strength of the camera's anti-alias filter */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   553
"/    #define TIFFTAG_SHADOWSCALE             50739   /* &used by Adobe Camera Raw */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   554
"/    #define TIFFTAG_DNGPRIVATEDATA          50740   /* &manufacturer's private data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   555
"/    #define TIFFTAG_MAKERNOTESAFETY         50741   /* &whether the EXIF MakerNote tag is safe to preserve along with the rest of the EXIF data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   556
"/    #define TIFFTAG_CALIBRATIONILLUMINANT1  50778   /* &illuminant 1 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   557
"/    #define TIFFTAG_CALIBRATIONILLUMINANT2  50779   /* &illuminant 2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   558
"/    #define TIFFTAG_BESTQUALITYSCALE        50780   /* &best quality multiplier */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   559
"/    #define TIFFTAG_RAWDATAUNIQUEID         50781   /* &unique identifier for the raw image data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   560
"/    #define TIFFTAG_ORIGINALRAWFILENAME     50827   /* &file name of the original raw file */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   561
"/    #define TIFFTAG_ORIGINALRAWFILEDATA     50828   /* &contents of the original raw file */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   562
"/    #define TIFFTAG_ACTIVEAREA              50829   /* &active (non-masked) pixels of the sensor */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   563
"/    #define TIFFTAG_MASKEDAREAS             50830   /* &list of coordinates of fully masked pixels */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   564
"/    #define TIFFTAG_ASSHOTICCPROFILE        50831   /* &these two tags used to */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   565
"/    #define TIFFTAG_ASSHOTPREPROFILEMATRIX  50832   /* map cameras's color space into ICC profile space */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   566
"/    #define TIFFTAG_CURRENTICCPROFILE       50833   /* & */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   567
"/    #define TIFFTAG_CURRENTPREPROFILEMATRIX 50834   /* & */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   568
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   569
"/    /* tag 65535 is an undefined tag used by Eastman Kodak */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   570
"/    #define TIFFTAG_DCSHUESHIFTVALUES       65535   /* hue shift correction data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   571
"/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   572
"/    /*
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   573
"/     * The following are ``pseudo tags'' that can be used to control
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   574
"/     * codec-specific functionality.  These tags are not written to file.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   575
"/     * Note that these values start at 0xffff+1 so that they'll never
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   576
"/     * collide with Aldus-assigned tags.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   577
"/     *
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   578
"/     * If you want your private pseudo tags ``registered'' (i.e. added to
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   579
"/     * this file), please post a bug report via the tracking system at
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   580
"/     * http://www.remotesensing.org/libtiff/bugs.html with the appropriate
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   581
"/     * C definitions to add.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   582
"/     */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   583
"/    #define TIFFTAG_FAXMODE                 65536   /* Group 3/4 format control */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   584
"/    #define     FAXMODE_CLASSIC     0x0000          /* default, include RTC */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   585
"/    #define     FAXMODE_NORTC       0x0001          /* no RTC at end of data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   586
"/    #define     FAXMODE_NOEOL       0x0002          /* no EOL code at end of row */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   587
"/    #define     FAXMODE_BYTEALIGN   0x0004          /* byte align row */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   588
"/    #define     FAXMODE_WORDALIGN   0x0008          /* word align row */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   589
"/    #define     FAXMODE_CLASSF      FAXMODE_NORTC   /* TIFF Class F */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   590
"/    #define TIFFTAG_JPEGQUALITY             65537   /* Compression quality level */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   591
"/    /* Note: quality level is on the IJG 0-100 scale.  Default value is 75 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   592
"/    #define TIFFTAG_JPEGCOLORMODE           65538   /* Auto RGB<=>YCbCr convert? */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   593
"/    #define     JPEGCOLORMODE_RAW   0x0000          /* no conversion (default) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   594
"/    #define     JPEGCOLORMODE_RGB   0x0001          /* do auto conversion */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   595
"/    #define TIFFTAG_JPEGTABLESMODE          65539   /* What to put in JPEGTables */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   596
"/    #define     JPEGTABLESMODE_QUANT 0x0001         /* include quantization tbls */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   597
"/    #define     JPEGTABLESMODE_HUFF 0x0002          /* include Huffman tbls */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   598
"/    /* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   599
"/    #define TIFFTAG_FAXFILLFUNC             65540   /* G3/G4 fill function */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   600
"/    #define TIFFTAG_PIXARLOGDATAFMT         65549   /* PixarLogCodec I/O data sz */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   601
"/    #define     PIXARLOGDATAFMT_8BIT        0       /* regular u_char samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   602
"/    #define     PIXARLOGDATAFMT_8BITABGR    1       /* ABGR-order u_chars */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   603
"/    #define     PIXARLOGDATAFMT_11BITLOG    2       /* 11-bit log-encoded (raw) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   604
"/    #define     PIXARLOGDATAFMT_12BITPICIO  3       /* as per PICIO (1.0==2048) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   605
"/    #define     PIXARLOGDATAFMT_16BIT       4       /* signed short samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   606
"/    #define     PIXARLOGDATAFMT_FLOAT       5       /* IEEE float samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   607
"/    /* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   608
"/    #define TIFFTAG_DCSIMAGERTYPE           65550   /* imager model & filter */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   609
"/    #define     DCSIMAGERMODEL_M3           0       /* M3 chip (1280 x 1024) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   610
"/    #define     DCSIMAGERMODEL_M5           1       /* M5 chip (1536 x 1024) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   611
"/    #define     DCSIMAGERMODEL_M6           2       /* M6 chip (3072 x 2048) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   612
"/    #define     DCSIMAGERFILTER_IR          0       /* infrared filter */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   613
"/    #define     DCSIMAGERFILTER_MONO        1       /* monochrome filter */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   614
"/    #define     DCSIMAGERFILTER_CFA         2       /* color filter array */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   615
"/    #define     DCSIMAGERFILTER_OTHER       3       /* other filter */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   616
"/    #define TIFFTAG_DCSINTERPMODE           65551   /* interpolation mode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   617
"/    #define     DCSINTERPMODE_NORMAL        0x0     /* whole image, default */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   618
"/    #define     DCSINTERPMODE_PREVIEW       0x1     /* preview of image (384x256) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   619
"/    #define TIFFTAG_DCSBALANCEARRAY         65552   /* color balance values */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   620
"/    #define TIFFTAG_DCSCORRECTMATRIX        65553   /* color correction values */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   621
"/    #define TIFFTAG_DCSGAMMA                65554   /* gamma value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   622
"/    #define TIFFTAG_DCSTOESHOULDERPTS       65555   /* toe & shoulder points */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   623
"/    #define TIFFTAG_DCSCALIBRATIONFD        65556   /* calibration file desc */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   624
"/    /* Note: quality level is on the ZLIB 1-9 scale. Default value is -1 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   625
"/    #define TIFFTAG_ZIPQUALITY              65557   /* compression quality level */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   626
"/    #define TIFFTAG_PIXARLOGQUALITY         65558   /* PixarLog uses same scale */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   627
"/    /* 65559 is allocated to Oceana Matrix <dev@oceana.com> */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   628
"/    #define TIFFTAG_DCSCLIPRECTANGLE        65559   /* area of image to acquire */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   629
"/    #define TIFFTAG_SGILOGDATAFMT           65560   /* SGILog user data format */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   630
"/    #define     SGILOGDATAFMT_FLOAT         0       /* IEEE float samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   631
"/    #define     SGILOGDATAFMT_16BIT         1       /* 16-bit samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   632
"/    #define     SGILOGDATAFMT_RAW           2       /* uninterpreted data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   633
"/    #define     SGILOGDATAFMT_8BIT          3       /* 8-bit RGB monitor values */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   634
"/    #define TIFFTAG_SGILOGENCODE            65561 /* SGILog data encoding control*/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   635
"/    #define     SGILOGENCODE_NODITHER       0     /* do not dither encoded values*/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   636
"/    #define     SGILOGENCODE_RANDITHER      1     /* randomly dither encd values */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   637
"/    #define TIFFTAG_LZMAPRESET              65562   /* LZMA2 preset (compression level) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   638
"/    #define TIFFTAG_PERSAMPLE       65563   /* interface for per sample tags */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   639
"/    #define     PERSAMPLE_MERGED        0   /* present as a single value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   640
"/    #define     PERSAMPLE_MULTI         1   /* present as multiple values */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   641
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   642
    "/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   643
    "/ EXIF tags
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   644
    "/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   645
"/    #define EXIFTAG_EXPOSURETIME            33434   /* Exposure time */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   646
"/    #define EXIFTAG_FNUMBER                 33437   /* F number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   647
"/    #define EXIFTAG_EXPOSUREPROGRAM         34850   /* Exposure program */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   648
"/    #define EXIFTAG_SPECTRALSENSITIVITY     34852   /* Spectral sensitivity */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   649
"/    #define EXIFTAG_ISOSPEEDRATINGS         34855   /* ISO speed rating */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   650
"/    #define EXIFTAG_OECF                    34856   /* Optoelectric conversion factor */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   651
"/    #define EXIFTAG_EXIFVERSION             36864   /* Exif version */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   652
"/    #define EXIFTAG_DATETIMEORIGINAL        36867   /* Date and time of original data generation */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   653
"/    #define EXIFTAG_DATETIMEDIGITIZED       36868   /* Date and time of digital data generation */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   654
"/    #define EXIFTAG_COMPONENTSCONFIGURATION 37121   /* Meaning of each component */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   655
"/    #define EXIFTAG_COMPRESSEDBITSPERPIXEL  37122   /* Image compression mode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   656
"/    #define EXIFTAG_SHUTTERSPEEDVALUE       37377   /* Shutter speed */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   657
"/    #define EXIFTAG_APERTUREVALUE           37378   /* Aperture */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   658
"/    #define EXIFTAG_BRIGHTNESSVALUE         37379   /* Brightness */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   659
"/    #define EXIFTAG_EXPOSUREBIASVALUE       37380   /* Exposure bias */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   660
"/    #define EXIFTAG_MAXAPERTUREVALUE        37381   /* Maximum lens aperture */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   661
"/    #define EXIFTAG_SUBJECTDISTANCE         37382   /* Subject distance */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   662
"/    #define EXIFTAG_METERINGMODE            37383   /* Metering mode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   663
"/    #define EXIFTAG_LIGHTSOURCE             37384   /* Light source */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   664
"/    #define EXIFTAG_FLASH                   37385   /* Flash */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   665
"/    #define EXIFTAG_FOCALLENGTH             37386   /* Lens focal length */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   666
"/    #define EXIFTAG_SUBJECTAREA             37396   /* Subject area */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   667
"/    #define EXIFTAG_MAKERNOTE               37500   /* Manufacturer notes */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   668
"/    #define EXIFTAG_USERCOMMENT             37510   /* User comments */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   669
"/    #define EXIFTAG_SUBSECTIME              37520   /* DateTime subseconds */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   670
"/    #define EXIFTAG_SUBSECTIMEORIGINAL      37521   /* DateTimeOriginal subseconds */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   671
"/    #define EXIFTAG_SUBSECTIMEDIGITIZED     37522   /* DateTimeDigitized subseconds */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   672
"/    #define EXIFTAG_FLASHPIXVERSION         40960   /* Supported Flashpix version */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   673
"/    #define EXIFTAG_COLORSPACE              40961   /* Color space information */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   674
"/    #define EXIFTAG_PIXELXDIMENSION         40962   /* Valid image width */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   675
"/    #define EXIFTAG_PIXELYDIMENSION         40963   /* Valid image height */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   676
"/    #define EXIFTAG_RELATEDSOUNDFILE        40964   /* Related audio file */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   677
"/    #define EXIFTAG_FLASHENERGY             41483   /* Flash energy */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   678
"/    #define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484  /* Spatial frequency response */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   679
"/    #define EXIFTAG_FOCALPLANEXRESOLUTION   41486   /* Focal plane X resolution */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   680
"/    #define EXIFTAG_FOCALPLANEYRESOLUTION   41487   /* Focal plane Y resolution */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   681
"/    #define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488  /* Focal plane resolution unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   682
"/    #define EXIFTAG_SUBJECTLOCATION         41492   /* Subject location */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   683
"/    #define EXIFTAG_EXPOSUREINDEX           41493   /* Exposure index */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   684
"/    #define EXIFTAG_SENSINGMETHOD           41495   /* Sensing method */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   685
"/    #define EXIFTAG_FILESOURCE              41728   /* File source */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   686
"/    #define EXIFTAG_SCENETYPE               41729   /* Scene type */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   687
"/    #define EXIFTAG_CFAPATTERN              41730   /* CFA pattern */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   688
"/    #define EXIFTAG_CUSTOMRENDERED          41985   /* Custom image processing */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   689
"/    #define EXIFTAG_EXPOSUREMODE            41986   /* Exposure mode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   690
"/    #define EXIFTAG_WHITEBALANCE            41987   /* White balance */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   691
"/    #define EXIFTAG_DIGITALZOOMRATIO        41988   /* Digital zoom ratio */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   692
"/    #define EXIFTAG_FOCALLENGTHIN35MMFILM   41989   /* Focal length in 35 mm film */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   693
"/    #define EXIFTAG_SCENECAPTURETYPE        41990   /* Scene capture type */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   694
"/    #define EXIFTAG_GAINCONTROL             41991   /* Gain control */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   695
"/    #define EXIFTAG_CONTRAST                41992   /* Contrast */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   696
"/    #define EXIFTAG_SATURATION              41993   /* Saturation */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   697
"/    #define EXIFTAG_SHARPNESS               41994   /* Sharpness */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   698
"/    #define EXIFTAG_DEVICESETTINGDESCRIPTION 41995  /* Device settings description */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   699
"/    #define EXIFTAG_SUBJECTDISTANCERANGE    41996   /* Subject distance range */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   700
"/    #define EXIFTAG_GAINCONTROL             41991   /* Gain control */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   701
"/    #define EXIFTAG_GAINCONTROL             41991   /* Gain control */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   702
"/    #define EXIFTAG_IMAGEUNIQUEID           42016   /* Unique image ID */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   703
392
7729a280960c handle bottom-to-top images (orientation==4)
Claus Gittinger <cg@exept.de>
parents: 359
diff changeset
   704
    "
7729a280960c handle bottom-to-top images (orientation==4)
Claus Gittinger <cg@exept.de>
parents: 359
diff changeset
   705
     self initialize
7729a280960c handle bottom-to-top images (orientation==4)
Claus Gittinger <cg@exept.de>
parents: 359
diff changeset
   706
    "
7729a280960c handle bottom-to-top images (orientation==4)
Claus Gittinger <cg@exept.de>
parents: 359
diff changeset
   707
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
   708
    "Modified: / 28-08-2017 / 00:46:15 / cg"
28
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
   709
! !
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
   710
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   711
!TIFFReader class methodsFor:'testing'!
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
   712
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   713
canRepresent:anImage
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   714
    "return true, if anImage can be represented in my file format.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   715
     Any image is supported."
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   716
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   717
    ^ true
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   718
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   719
4347
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   720
hasValidImageHeader:someHeaderBytes
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   721
    "return true, if someHeaderBytes 
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   722
     (which does not need to be the whole data, but large enough
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   723
      to detect the header) contains a valid TIFF image header"
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   724
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   725
    |bytes1_2 byte3 byte4 versionLow versionHi|
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   726
4375
dd1b4512e4c5 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
   727
    someHeaderBytes size < 4 ifTrue:[^ false].
4347
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   728
    bytes1_2 := (someHeaderBytes copyFrom:1 to:2) asString.
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   729
    byte3 := someHeaderBytes at:3.
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   730
    byte4 := someHeaderBytes at:4.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   731
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   732
    ((bytes1_2 = 'II' "tiff") or:[bytes1_2 = 'PE' "mdi"]) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   733
        "/ intel byte order (lsb)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   734
        versionLow := byte3. versionHi := byte4.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   735
    ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   736
        ((bytes1_2 = 'MM' "tiff") or:[bytes1_2 = 'EP' "mdi"])  ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   737
            "/ motorola byte order (msb)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   738
            versionLow := byte4. versionHi := byte3.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   739
        ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   740
            ^ false
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   741
        ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   742
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   743
    versionHi == 0 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   744
        (versionLow == 42) ifTrue:[^ true].       "/ tiff
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   745
        (versionLow == 43) ifTrue:[^ true].       "/ bigtiff
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
   746
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   747
    ^ false.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   748
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   749
    "Modified: / 26-08-2017 / 15:31:08 / cg"
4347
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   750
!
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   751
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   752
isValidImageFile:aFileName
4375
dd1b4512e4c5 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
   753
    "return true, if aFileName contains a TIFF image.
dd1b4512e4c5 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
   754
     Does not really validate - just looks at the header bytes"
4347
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   755
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   756
    |inStream bytes1To4|
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   757
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   758
    inStream := self streamReadingFile:aFileName.
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   759
    inStream isNil ifTrue:[^ false].
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   760
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   761
    bytes1To4 := inStream nextBytes:4.
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   762
    inStream close.
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   763
4375
dd1b4512e4c5 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
   764
    ^ (bytes1To4 size == 4) and:[self hasValidImageHeader:bytes1To4]    
dd1b4512e4c5 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
   765
dd1b4512e4c5 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
   766
    "
dd1b4512e4c5 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
   767
     TIFFReader isValidImageFile:'../../doc/html/testDocs/granite.tiff'  
dd1b4512e4c5 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
   768
     TIFFReader isValidImageFile:'fooBar'    
dd1b4512e4c5 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
   769
     TIFFReader isValidImageFile:'../../goodies/bitmaps/xpmBitmaps/device_images/ljet.xpm'      
dd1b4512e4c5 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
   770
     TIFFReader isValidImageFile:'../../goodies/bitmaps/bitmaps/gifImages/garfield.gif' 
dd1b4512e4c5 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4347
diff changeset
   771
    "
4347
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   772
84221b29f234 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4336
diff changeset
   773
    "Modified: / 26-08-2017 / 15:31:08 / cg"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   774
! !
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   775
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   776
!TIFFReader methodsFor:'accessing'!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   777
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   778
decodeMetaTags:aBoolean
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   779
    "by default, extra meta tags (photoshop) are not decoded;
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   780
     set to true to get them in metatags"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   781
     
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   782
    decodeMetaTags := aBoolean.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   783
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   784
    "Modified (comment): / 27-08-2017 / 18:37:04 / cg"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   785
!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   786
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   787
loadFullResolutionImage:aBoolean
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   788
    "by default, the full-resolution dng image is not decoded;
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   789
     set to true to get it in the imageSequence"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   790
     
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   791
    loadFullResolutionImage := aBoolean.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   792
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   793
    "Created: / 27-08-2017 / 18:41:48 / cg"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   794
! !
3f9277473954 Initial revision
claus
parents:
diff changeset
   795
1762
55cf76514c8c method category rename
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   796
!TIFFReader methodsFor:'private-data reading'!
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   797
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   798
readAdobeDeflateTiffImageData
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   799
    ^ self readDeflateTiffImageData
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   800
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   801
    "Created: / 26-08-2017 / 14:44:35 / cg"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   802
    "Modified: / 27-08-2017 / 18:55:11 / cg"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   803
!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   804
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   805
readCCITT3RLETiffImageData
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   806
    ^ self fileFormatError:'ccitt G3 mod Huffman (rle) compression not implemented'
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   807
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   808
    "Modified: / 3.2.1998 / 18:03:14 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   809
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   810
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   811
readCCITT3RLEWTiffImageData
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   812
    ^ self fileFormatError:'ccitt G3 mod Huffman (rlew) compression not implemented'.
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   813
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   814
    "Modified: / 3.2.1998 / 18:03:30 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   815
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   816
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   817
readCCITTGroup3TiffImageData
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   818
    "not really tested - all I got is a single fax from NeXT step"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   819
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   820
    |bytesPerRow bitsPerRow compressedStrip nPlanes 
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   821
     stripNr       "{ Class: SmallInteger }"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   822
     offset        "{ Class: SmallInteger }"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   823
     row           "{ Class: SmallInteger }"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   824
     bytesPerStrip "{ Class: SmallInteger }" 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   825
     count dstIndex|
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   826
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   827
    nPlanes := samplesPerPixel.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   828
    (nPlanes ~~ 1) ifTrue:[
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   829
        (nPlanes == 2) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   830
            (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   831
                ^ self fileFormatError:'only separate planes are supported'.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   832
            ].
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   833
            'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   834
            nPlanes := 1
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   835
        ] ifFalse:[
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   836
            ^ self fileFormatError:'only monochrome/greyscale ccitt3supported'.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   837
        ].   
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   838
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   839
    stripRowCounts notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   840
        ^ self fileFormatError:'stripRowCounts not supported'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   841
    ].
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   842
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   843
"/    (rowsPerStrip ~~ 1) ifTrue:[
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   844
"/        ^ self fileFormatError:'currently require rowsPerStrip to be 1'.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   845
"/    ].
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   846
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   847
    "/ 'TIFFReader: decompressing CCITT-3 ...' infoPrintNL.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   848
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   849
    bitsPerRow := width * (bitsPerSample at:1).
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   850
    bytesPerRow := bitsPerRow // 8.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   851
    ((bitsPerRow \\ 8) ~~ 0) ifTrue:[
335
a32831edacc5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   852
        bytesPerRow := bytesPerRow + 1
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   853
    ].
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   854
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   855
    data := ByteArray new:(bytesPerRow * height).
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   856
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   857
    "/ if the number of rows per strip is unknown (-1),
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   858
    "/ make it one big strip and decompress that
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   859
    rowsPerStrip = 16rFFFFFFFF ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   860
        self assert:(stripByteCounts size == 1).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   861
        count := stripByteCounts sum.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   862
        compressedStrip := ByteArray uninitializedNew:count.
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   863
        self positionToStrip:1.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   864
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   865
        (inStream nextBytes:count into:compressedStrip) == count ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   866
            self error:'short read'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   867
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   868
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   869
        compressedStrip := compressedStrip copyFrom:16r227.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   870
        
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   871
        dstIndex := self class 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   872
                    _decompressCCITT3From:compressedStrip
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   873
                    count:count
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   874
                    into:data
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   875
                    startingAt:1.
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   876
        ^ self 
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   877
    ].
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   878
    
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   879
    compressedStrip := ByteArray uninitializedNew:bytesPerRow.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   880
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   881
    offset := 1.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   882
    stripNr := 1.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   883
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   884
    row := 1.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   885
    bytesPerStrip := bytesPerRow * rowsPerStrip.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   886
    [row <= height] whileTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   887
        self positionToStrip:stripNr.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   888
        count := stripByteCounts at:stripNr.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   889
        (inStream nextBytes:count into:compressedStrip) == count ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   890
            self error:'short read'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   891
        ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   892
        dstIndex := self class 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   893
                    _decompressCCITT3From:compressedStrip
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   894
                    count:count
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   895
                    into:data
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   896
                    startingAt:offset
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   897
                    count:width. "/ is this correct? - I think, that should be width*rowsPerStrip 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   898
        offset := offset + bytesPerStrip.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   899
        row := row + rowsPerStrip.
335
a32831edacc5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   900
        stripNr := stripNr + 1.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   901
    ]
335
a32831edacc5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   902
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   903
    "
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   904
     TIFFReader fromFile:'/Users/cg/DownloadsUnsaved/image_software/libtiffpic/g3test.tif'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   905
    "
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   906
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   907
    "Modified: / 27-08-2017 / 15:37:51 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   908
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   909
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   910
readCCITTGroup4TiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   911
    ^ self fileFormatError:'ccitt group4 fax compression not implemented'.
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   912
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   913
    "Modified: / 3.2.1998 / 18:04:34 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   914
!
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   915
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   916
readCCITTRLEWTiffImageData
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   917
    ^ self fileFormatError:'ccitt mod Huffman (rlew) compression not implemented'
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   918
!
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   919
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   920
readDCSTiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   921
    ^ self fileFormatError:'dcs compression not implemented'.
329
5fb99e0734e4 handle empty character-strings
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   922
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   923
    "Modified: / 3.2.1998 / 18:04:44 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   924
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   925
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   926
readDeflateTiffImageData
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
   927
    self readImageDataUsingDecompressor:
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   928
        [:inBytes :inCount :outBytes :outOffset :outCount |
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   929
            |zlibReader|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   930
            
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   931
            zlibReader := ZipStream readOpenAsZipStreamOn:(inBytes readStream) suppressHeaderAndChecksum:false.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   932
            zlibReader binary.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   933
            zlibReader next:outCount into:outBytes startingAt:outOffset.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   934
            outCount.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   935
        ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   936
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   937
"/    |bytesPerRowIn bytesPerRow nPlanes overAllBytes
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   938
"/     bytesPerStrip "{ Class: SmallInteger }"
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   939
"/     nBytes        "{ Class: SmallInteger }"
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   940
"/     stripNr       "{ Class: SmallInteger }"
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   941
"/     offset        "{ Class: SmallInteger }"
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   942
"/     row           "{ Class: SmallInteger }" 
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   943
"/     zlibReader nread msb
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   944
"/     convertFloats convertDoubles conversionBuffer|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   945
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   946
"/    nPlanes := samplesPerPixel.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   947
"/    convertFloats := convertDoubles := false.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   948
"/    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   949
"/    (nPlanes >= 3) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   950
"/        bytesPerRowIn := width * ((bitsPerSample sum + 7) // 8).
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   951
"/        (bitsPerSample conform:[:each | each == 8]) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   952
"/            sampleFormat == SAMPLEFORMAT_UINT ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   953
"/                ^ self fileFormatError:'unsupported sample format'.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   954
"/            ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   955
"/        ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   956
"/            sampleFormat == SAMPLEFORMAT_IEEEFP ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   957
"/                nPlanes == 3 ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   958
"/                    (bitsPerSample conform:[:each | each == 64]) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   959
"/                        convertDoubles := true.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   960
"/                        bytesPerRow := width * nPlanes.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   961
"/                        bitsPerSample := #(8 8 8).
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   962
"/                    ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   963
"/                        (bitsPerSample conform:[:each | each == 32]) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   964
"/                            convertFloats := true.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   965
"/                            bytesPerRow := width * nPlanes.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   966
"/                            bitsPerSample := #(8 8 8).
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   967
"/                        ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   968
"/                            ^ self fileFormatError:'only 64/64/64 bits/sample are supported with IEEE_FP samples'.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   969
"/                        ].    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   970
"/                    ].    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   971
"/                ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   972
"/                    ^ self fileFormatError:'only support 3 planes with IEEE_FP sample format'.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   973
"/                ]    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   974
"/            ] ifFalse:[    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   975
"/                ^ self fileFormatError:'unsupported sample format'.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   976
"/            ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   977
"/        ]
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   978
"/    ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   979
"/        (nPlanes == 2) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   980
"/            (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   981
"/                ^ self fileFormatError:'only separate planes are supported'.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   982
"/            ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   983
"/            'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   984
"/            nPlanes := 1
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   985
"/        ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   986
"/        (nPlanes == 1) ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   987
"/            ^ self fileFormatError:'unsupported nPlanes: ' , nPlanes printString, '; only 3-sample rgb / monochrome supported'.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   988
"/        ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   989
"/        bytesPerRowIn := (width * (bitsPerSample at:1) + 7) // 8.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   990
"/    ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   991
"/    stripRowCounts notNil ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   992
"/        ^ self fileFormatError:'stripRowCounts not supported'.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   993
"/    ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   994
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   995
"/    "/ 'TIFFReader: decompressing Deflate ...' infoPrintNL.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   996
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   997
"/    bytesPerRow isNil ifTrue:[ bytesPerRow := bytesPerRowIn ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   998
"/    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   999
"/    overAllBytes := bytesPerRow * height.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1000
"/    data := ByteArray new:overAllBytes.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1001
"/    (convertFloats or:[convertDoubles]) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1002
"/        conversionBuffer := ByteArray new:(bytesPerRowIn * rowsPerStrip).
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1003
"/    ].    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1004
"/    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1005
"/    offset := 1.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1006
"/    stripNr := 0.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1007
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1008
"/    row := 1.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1009
"/    bytesPerStrip := bytesPerRow * rowsPerStrip.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1010
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1011
"/    [row <= height] whileTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1012
"/        stripNr := stripNr + 1.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1013
"/        self positionToStrip:stripNr.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1014
"/        nBytes := stripByteCounts at:stripNr.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1015
"/        
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1016
"/        zlibReader := ZipStream readOpenAsZipStreamOn:inStream suppressHeaderAndChecksum:false.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1017
"/        zlibReader binary.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1018
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1019
"/        conversionBuffer notNil ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1020
"/            nread := zlibReader next:nBytes into:conversionBuffer startingAt:1.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1021
"/            msb := (byteOrder == #msb).
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1022
"/            convertFloats ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1023
"/                |i|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1024
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1025
"/                self assert:(nread \\ 4) == 0.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1026
"/                i := 0.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1027
"/                1 to:nread-1 by:4 do:[:iF |
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1028
"/                    |dVal byteVal|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1029
"/                    dVal := conversionBuffer floatAt:iF MSB:msb.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1030
"/                    "/ rescale from 0..1 to 0..255
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1031
"/                    byteVal := (dVal * 255) asInteger clampBetween:0 and:255.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1032
"/                    data at:offset+i put:byteVal.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1033
"/                    i := i + 1.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1034
"/                ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1035
"/            ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1036
"/                convertDoubles ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1037
"/                    |i|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1038
"/                    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1039
"/                    self assert:(nread \\ 8) == 0.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1040
"/                    i := 0.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1041
"/                    1 to:nread-1 by:8 do:[:iF |
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1042
"/                        |dVal byteVal|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1043
"/                        dVal := conversionBuffer doubleAt:iF MSB:msb.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1044
"/                        "/ rescale from 0..1 to 0..255
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1045
"/                        byteVal := (dVal * 255) asInteger clampBetween:0 and:255.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1046
"/                        data at:offset+i put:byteVal.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1047
"/                        i := i + 1.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1048
"/                    ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1049
"/                ]
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1050
"/            ].    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1051
"/        ] ifFalse:[    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1052
"/            nread := zlibReader next:nBytes into:data startingAt:offset.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1053
"/        ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1054
"/        
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1055
"/        offset := offset + bytesPerStrip.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1056
"/        row := row + rowsPerStrip
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1057
"/    ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1058
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1059
"/    (predictor ~~ 1) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1060
"/        (predictor == 2) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1061
"/            self class decodeDelta:nPlanes in:data width:width height:height
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1062
"/        ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1063
"/            ^ self fileFormatError:'unsupported predictor'
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1064
"/        ].    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1065
"/    ]
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1066
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1067
    "Modified: / 29-08-2017 / 23:14:55 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1068
!
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1069
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1070
readImageDataUsingDecompressor:decompressorBlock
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1071
    |bytesPerRowIn bytesPerRow nPlanes overAllBytes
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1072
     nBytes        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1073
     stripNr       "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1074
     offset        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1075
     row           "{ Class: SmallInteger }" 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1076
     msb
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1077
     convert convertFloats convertDoubles convertHalfFloats 
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1078
     swapInt16s convertFillOrder
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1079
     inBuffer conversionBuffer floats nDecompressed 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1080
     rowsInThisStrip bytesInThisStrip|
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1081
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1082
    nPlanes := samplesPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1083
    convert := convertFloats := convertDoubles := convertHalfFloats := false.
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1084
    swapInt16s := convertFillOrder := false.
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1085
    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1086
    (nPlanes >= 3) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1087
        (planarConfiguration ~~ PLANARCONFIG_CONTIG) ifTrue:[
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1088
            ^ self fileFormatError:('only non separate planes are supported with %1 planes' bindWith:nPlanes).
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1089
        ].
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1090
        (nPlanes > 4) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1091
            photometric == #cmyk ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1092
                "/ ignore alpha
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1093
                'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1094
                nPlanes := samplesPerPixel := 4.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1095
                bitsPerSample := bitsPerSample copyTo:4.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1096
            ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1097
        ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1098
        
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1099
        bytesPerRowIn := width * ((bitsPerSample sum + 7) // 8).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1100
        sampleFormat == SAMPLEFORMAT_UINT ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1101
            (bitsPerSample conform:[:each | each == 8]) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1102
                "/ ok
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1103
            ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1104
                (bitsPerSample conform:[:each | each == 16]) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1105
                    "/ ok
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1106
                ] ifFalse:[
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1107
                    ^ self fileFormatError:('%1 bits/sample; only 8 or 16 are supported with %2 planes' bindWith:bitsPerSample with:nPlanes).
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1108
                ]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1109
            ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1110
        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1111
            sampleFormat == SAMPLEFORMAT_IEEEFP ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1112
                nPlanes == 3 ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1113
                    (bitsPerSample conform:[:each | each == 64]) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1114
                        convertDoubles := convert := true.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1115
                        bytesPerRow := width * nPlanes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1116
                        bitsPerSample := #(8 8 8).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1117
                    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1118
                        (bitsPerSample conform:[:each | each == 32]) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1119
                            convertFloats := convert := true.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1120
                            bytesPerRow := width * nPlanes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1121
                            bitsPerSample := #(8 8 8).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1122
                        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1123
                            (bitsPerSample conform:[:each | each == 16]) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1124
                                convertHalfFloats := convert := true.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1125
                                bytesPerRow := width * nPlanes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1126
                                bitsPerSample := #(8 8 8).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1127
                            ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1128
                                ^ self fileFormatError:'only 16, 32 or 64 bits/sample are supported with IEEE_FP samples'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1129
                            ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1130
                        ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1131
                    ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1132
                ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1133
                    ^ self fileFormatError:'only support 3 planes with IEEE_FP sample format'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1134
                ]    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1135
            ] ifFalse:[    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1136
                ^ self fileFormatError:'unsupported sample format'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1137
            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1138
        ]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1139
    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1140
        (nPlanes == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1141
            (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1142
                ^ self fileFormatError:'only separate planes are supported with 2 planes'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1143
            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1144
            'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1145
            nPlanes := 1
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1146
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1147
        (nPlanes == 1) ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1148
            ^ self fileFormatError:'unsupported nPlanes: ' , nPlanes printString, '; only 3-sample rgb / monochrome supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1149
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1150
        bytesPerRowIn := (width * (bitsPerSample at:1) + 7) // 8.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1151
        (bitsPerSample at:1) == 16 ifTrue:[
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1152
            byteOrder ~~ #msb ifTrue:[
3989
a1fa18648a9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3987
diff changeset
  1153
                "/ swapInt16s := true.
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1154
            ].    
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1155
        ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1156
    ].
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1157
4336
7f2596e303be #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4103
diff changeset
  1158
    bitsPerSample sum isPowerOf2 ifFalse:[
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1159
        (#(24 48) includes:bitsPerSample sum) ifFalse:[
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1160
            ^ self fileFormatError:'unsupported bitsPerSample: ' , bitsPerSample printString
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1161
        ].
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1162
    ].
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1163
    
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1164
    fillOrder ~~ #msb ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1165
        (bitsPerSample conform:[:n | n == 8]) ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1166
            ^ self fileFormatError:'unsupported bitsPerSample with lsb fillOrder'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1167
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1168
        convertFillOrder := true.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1169
    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1170
    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1171
    bytesPerRow isNil ifTrue:[ bytesPerRow := bytesPerRowIn ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1172
    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1173
    overAllBytes := bytesPerRow * height.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1174
    data := ByteArray new:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1175
    convert ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1176
        conversionBuffer := ByteArray new:(bytesPerRowIn * rowsPerStrip).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1177
    ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1178
    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1179
    offset := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1180
    stripNr := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1181
    row := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1182
    msb := (byteOrder == #msb).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1183
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1184
    [row <= height] whileTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1185
        self positionToStrip:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1186
        nBytes := stripByteCounts at:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1187
        rowsInThisStrip := stripRowCounts notNil 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1188
                                ifTrue:[stripRowCounts at:stripNr]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1189
                                ifFalse:[rowsPerStrip].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1190
        bytesInThisStrip := bytesPerRowIn * rowsInThisStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1191
        
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1192
        "/ don't assert; the last strip is actually shorter in many images                       
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1193
        "/ compression == 1 ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1194
        "/    self assert:( nBytes == (bytesPerRowIn * rowsInThisStrip) ).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1195
        "/ ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1196
        
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1197
        conversionBuffer notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1198
            decompressorBlock notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1199
                inBuffer := ByteArray new:nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1200
                (inStream nextBytes:nBytes into:inBuffer startingAt:1) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1201
                    self fileFormatError:'short read'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1202
                ]. 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1203
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1204
                nDecompressed := decompressorBlock 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1205
                                    value:inBuffer value:nBytes 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1206
                                    value:conversionBuffer value:1
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1207
                                    value:bytesInThisStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1208
            ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1209
                (nDecompressed := inStream nextBytes:nBytes into:conversionBuffer startingAt:1) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1210
                    self fileFormatError:'short read'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1211
                ]. 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1212
            ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1213
            convertFloats ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1214
                self assert:(nDecompressed \\ 4) == 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1215
                floats := FloatArray new:(nDecompressed // 4).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1216
            ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1217
                convertDoubles ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1218
                    self assert:(nDecompressed \\ 8) == 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1219
                    floats := DoubleArray new:(nDecompressed // 8).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1220
                ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1221
                    convertHalfFloats ifTrue:[  
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1222
                        self assert:(nDecompressed \\ 2) == 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1223
                        floats := HalfFloatArray new:(nDecompressed // 2).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1224
                    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1225
                ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1226
            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1227
            floats replaceBytesWith:conversionBuffer.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1228
            1 to:floats size do:[:i |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1229
                |dVal byteVal|
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1230
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1231
                dVal := floats at:i.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1232
                "/ rescale from 0..1 to 0..255
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1233
                byteVal := (dVal * 255) asInteger clampBetween:0 and:255.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1234
                data at:offset+i-1 put:byteVal.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1235
            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1236
        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1237
            decompressorBlock notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1238
                inBuffer := ByteArray new:nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1239
                (inStream nextBytes:nBytes into:inBuffer startingAt:1) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1240
                    self fileFormatError:'short read'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1241
                ]. 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1242
                nDecompressed := decompressorBlock 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1243
                                    value:inBuffer value:nBytes 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1244
                                    value:data value:offset 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1245
                                    value:bytesInThisStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1246
            ] ifFalse:[    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1247
                (inStream nextBytes:nBytes into:data startingAt:offset) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1248
                    self fileFormatError:'short read'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1249
                ]. 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1250
            ]. 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1251
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1252
        
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1253
        offset := offset + bytesInThisStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1254
        row := row + rowsInThisStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1255
        stripNr := stripNr + 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1256
    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1257
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1258
    swapInt16s ifTrue:[
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1259
        data swapBytes
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1260
    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1261
    convertFillOrder ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1262
        1 to:data size do:[:i |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1263
            data at:i put:(data at:i) bitReversed8.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1264
        ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1265
    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1266
    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1267
    (predictor ~~ 1) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1268
        (predictor == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1269
            self class decodeDelta:nPlanes in:data width:width height:height
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1270
        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1271
            ^ self fileFormatError:'unsupported predictor'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1272
        ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1273
    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1274
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1275
    "Created: / 29-08-2017 / 23:15:10 / cg"
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1276
!
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1277
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1278
readJBIGTiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1279
    ^ self fileFormatError:'jbig compression not implemented'.
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1280
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1281
    "Modified: / 3.2.1998 / 18:05:04 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1282
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1283
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1284
readJPEGTiffImageData
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1285
    |nBytes compressedData|
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1286
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1287
    stripByteCounts size == 1 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1288
        "/ single strip
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1289
        self positionToStrip:1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1290
        nBytes := stripByteCounts at:1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1291
        compressedData := ByteArray uninitializedNew:nBytes.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1292
        (inStream nextBytes:nBytes into:compressedData) == nBytes ifFalse:[ self error:'short read' ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1293
        "/ pngOrJPGImage := JPEGReader fromStream:compressedData readStream.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1294
        "/ self halt.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1295
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1296
    stripRowCounts notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1297
        ^ self fileFormatError:'stripRowCounts not supported'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1298
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1299
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1300
    ^ self fileFormatError:'jpeg (old) compression not implemented'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1301
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1302
    "Modified: / 27-08-2017 / 15:38:23 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1303
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1304
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1305
readLZWTiffImageData
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1306
    self readImageDataUsingDecompressor:
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1307
        [:inBytes :inCount :outBytes :outOffset :outCount |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1308
            self class 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1309
                decompressLZWFrom:inBytes count:inCount
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1310
                into:outBytes startingAt:outOffset.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1311
            outCount.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1312
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1313
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1314
"/    "read LZW compressed tiff data; 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1315
"/     this method only handles 8+8+8 and 8+8+8+8 rgb 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1316
"/     and 2bit or 2+2bit greyscale images.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1317
"/     For 2+2bit greyscale images, the alpha plane is ignored.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1318
"/     (maybe other formats work also - but simply not tested)"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1319
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1320
"/    |bytesPerRow compressedStrip nPlanes overAllBytes
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1321
"/     bytesPerStrip "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1322
"/     nBytes        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1323
"/     prevSize      "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1324
"/     stripNr       "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1325
"/     offset        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1326
"/     row           "{ Class: SmallInteger }" |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1327
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1328
"/    nPlanes := samplesPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1329
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1330
"/    (nPlanes >= 3) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1331
"/        (bitsPerSample conform:[:each | each == 8]) ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1332
"/            ^ self fileFormatError:'only 8/8/8(/8) bits/sample are supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1333
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1334
"/        bytesPerRow := width * samplesPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1335
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1336
"/        (nPlanes == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1337
"/            (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1338
"/                ^ self fileFormatError:'only separate planes are supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1339
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1340
"/            'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1341
"/            nPlanes := 1
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1342
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1343
"/        (nPlanes == 1) ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1344
"/            ^ self fileFormatError:'unsupported nPlanes: ' , nPlanes printString, '; only 3-sample rgb / monochrome supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1345
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1346
"/        bytesPerRow := (width * (bitsPerSample at:1) + 7) // 8.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1347
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1348
"/    stripRowCounts notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1349
"/        ^ self fileFormatError:'stripRowCounts not supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1350
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1351
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1352
"/    "/ 'TIFFReader: decompressing LZW ...' infoPrintNL.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1353
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1354
"/    overAllBytes := bytesPerRow * height.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1355
"/    bytesPerRow == width ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1356
"/        data := ByteArray uninitializedNew:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1357
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1358
"/        data := ByteArray new:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1359
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1360
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1361
"/    offset := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1362
"/    stripNr := 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1363
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1364
"/    row := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1365
"/    bytesPerStrip := bytesPerRow * rowsPerStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1366
"/    prevSize := 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1367
"/    [row <= height] whileTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1368
"/        stripNr := stripNr + 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1369
"/        self positionToStrip:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1370
"/        nBytes := stripByteCounts at:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1371
"/        (nBytes > prevSize) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1372
"/            compressedStrip := ByteArray uninitializedNew:nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1373
"/            prevSize := nBytes
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1374
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1375
"/        (inStream nextBytes:nBytes into:compressedStrip) == nBytes ifFalse:[ self fileFormatError:'short file' ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1376
"/        self class 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1377
"/            decompressLZWFrom:compressedStrip count:nBytes
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1378
"/            into:data startingAt:offset.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1379
"/        offset := offset + bytesPerStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1380
"/        row := row + rowsPerStrip
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1381
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1382
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1383
"/    predictor ~~ 1 ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1384
"/        (predictor == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1385
"/            self class decodeDelta:nPlanes in:data width:width height:height
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1386
"/        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1387
"/            self fileFormatError:'unsupported predictor'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1388
"/        ]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1389
"/    ]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1390
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1391
    "Modified: / 29-08-2017 / 23:14:59 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1392
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1393
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1394
readNeXTJPEGTiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1395
    ^ self fileFormatError:'next jpeg compression not implemented'.
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  1396
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1397
    "Modified: / 3.2.1998 / 18:10:45 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1398
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1399
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1400
readNeXTRLE2TiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1401
    ^ self fileFormatError:'next 2bit rle compression not implemented'.
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  1402
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1403
    "Modified: / 3.2.1998 / 18:10:54 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1404
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1405
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
  1406
readNewJPEGTiffImageData
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
  1407
    ^ self fileFormatError:'new jpeg compression not implemented'.
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
  1408
!
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
  1409
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1410
readPackbitsTiffImageData
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1411
    self readImageDataUsingDecompressor:
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1412
        [:inBytes :inCount :outBytes :outOffset :outCount |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1413
            self class decompressTiffPackBitsFrom:inBytes to:outBytes at:outOffset count:outCount.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1414
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1415
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1416
"/    "this has only been tested with monochrome images"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1417
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1418
"/    |bytesPerRow bitsPerRow nPlanes 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1419
"/     stripNr       "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1420
"/     offset        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1421
"/     row           "{ Class: SmallInteger }" 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1422
"/     nBytes        "{ Class: SmallInteger }" bitsPerPixel overAllBytes buffer|
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1423
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1424
"/    nPlanes := samplesPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1425
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1426
"/    "only support 1-sample/pixel,
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1427
"/     with alpha - if separate planes,
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1428
"/     or rgb - if non separate planes and no alpha"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1429
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1430
"/    (nPlanes == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1431
"/        (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1432
"/            ^ self fileFormatError:'with alpha, only separate planes supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1433
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1434
"/        'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1435
"/        nPlanes := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1436
"/        bitsPerPixel := bitsPerSample at:1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1437
"/        bitsPerSample := Array with:bitsPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1438
"/        samplesPerPixel := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1439
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1440
"/        (nPlanes == 3) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1441
"/            (planarConfiguration ~~ PLANARCONFIG_CONTIG) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1442
"/                ^ self fileFormatError:'only non separate planes supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1443
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1444
"/            bitsPerSample ~= #(8 8 8) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1445
"/                ^ self fileFormatError:'only 8/8/8 rgb images supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1446
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1447
"/            bitsPerPixel := 24
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1448
"/        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1449
"/            (nPlanes ~~ 1) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1450
"/                ^ self fileFormatError:('format (nplanes == %1) not supported' bindWith:nPlanes).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1451
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1452
"/            bitsPerPixel := bitsPerSample at:1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1453
"/        ]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1454
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1455
"/    stripRowCounts notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1456
"/        ^ self fileFormatError:'stripRowCounts not supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1457
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1458
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1459
"/    bitsPerRow := width * bitsPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1460
"/    bytesPerRow := bitsPerRow // 8.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1461
"/    ((bitsPerRow \\ 8) ~~ 0) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1462
"/        bytesPerRow := bytesPerRow + 1
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1463
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1464
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1465
"/    overAllBytes := bytesPerRow * height.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1466
"/    bytesPerRow == width ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1467
"/        data := ByteArray uninitializedNew:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1468
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1469
"/        data := ByteArray new:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1470
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1471
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1472
"/    offset := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1473
"/    stripNr := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1474
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1475
"/    buffer := nil.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1476
"/    row := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1477
"/    [row <= height] whileTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1478
"/        nBytes := stripByteCounts at:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1479
"/        self positionToStrip:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1480
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1481
"/        nBytes > buffer size ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1482
"/            "/ realloc
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1483
"/            buffer := ByteArray uninitializedNew:nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1484
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1485
"/        (inStream nextBytes:nBytes into:buffer) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1486
"/            self fileFormatError:'short file read'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1487
"/        ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1488
"/        self class decompressTiffPackBitsFrom:buffer to:data at:offset count:(bytesPerRow * rowsPerStrip).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1489
"/        "/ nDecompressedBytes := self class decompressPackBits:nBytes from:buffer to:data startingAt:offset.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1490
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1491
"/        offset := offset + (bytesPerRow * rowsPerStrip).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1492
"/        row := row + rowsPerStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1493
"/        stripNr := stripNr + 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1494
"/    ]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1495
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1496
    "Modified: / 29-08-2017 / 23:15:03 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1497
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1498
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1499
readPixarFilmTiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1500
    ^ self fileFormatError:'pixar film compression not implemented'.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1501
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1502
    "Modified: / 3.2.1998 / 18:11:45 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1503
!
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1504
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1505
readPixarLogTiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1506
    ^ self fileFormatError:'pixar log compression not implemented'.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  1507
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1508
    "Modified: / 3.2.1998 / 18:11:53 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1509
!
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1510
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1511
readSGI24TiffImageData
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1512
    ^ self fileFormatError:'SGI 24-bit Log Luminance encoding not implemented' .
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1513
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1514
    "Created: / 25-08-2017 / 11:17:25 / cg"
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1515
!
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1516
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1517
readSGI32TiffImageData
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1518
    ^ self fileFormatError:'SGI 32-bit Log Luminance encoding not implemented' .
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1519
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1520
    "Created: / 25-08-2017 / 11:17:21 / cg"
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1521
!
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1522
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1523
readThunderScanTiffImageData
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1524
    |bytesPerRow compressedStrip nPlanes overAllBytes
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1525
     bytesPerStrip "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1526
     nBytes        "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1527
     prevSize      "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1528
     stripNr       "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1529
     offset        "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1530
     row           "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1531
     pixelIndex
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1532
     i even gen highNibble lastPixel d1 d2 d3|
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1533
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1534
    nPlanes := samplesPerPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1535
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1536
    (nPlanes == 2) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1537
        (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1538
            ^ self fileFormatError:'only separate planes are supported'.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1539
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1540
        'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1541
        nPlanes := 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1542
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1543
    (nPlanes == 1) ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1544
        ^ self fileFormatError:'unsupported nPlanes: ' , nPlanes printString.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1545
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1546
    (bitsPerSample at:1) == 4 ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1547
        ^ self fileFormatError:('unsupported bitsPerSample: %1 (only 4 supported)' bindWith:(bitsPerSample at:1)).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1548
    ].    
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1549
    stripRowCounts notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1550
        ^ self fileFormatError:'stripRowCounts not supported'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1551
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1552
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1553
    bytesPerRow := (width * (bitsPerSample at:1) + 7) // 8.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1554
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1555
    "/ 'TIFFReader: decompressing ThunderScan ...' infoPrintNL.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1556
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1557
    overAllBytes := bytesPerRow * height.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1558
    bytesPerRow == width ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1559
        data := ByteArray uninitializedNew:overAllBytes.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1560
    ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1561
        data := ByteArray new:overAllBytes.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1562
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1563
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1564
    offset := 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1565
    stripNr := 0.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1566
    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1567
    gen := [:pixel | 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1568
                even ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1569
                    highNibble := pixel. 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1570
                    even := false.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1571
                ] ifFalse:[    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1572
                    data at:pixelIndex put:((highNibble bitShift:4) bitOr:pixel).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1573
                    pixelIndex := pixelIndex + 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1574
                    even := true.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1575
                ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1576
            ].    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1577
    even := true.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1578
    lastPixel := 0.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1579
    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1580
    row := 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1581
    bytesPerStrip := bytesPerRow * rowsPerStrip.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1582
    prevSize := 0.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1583
    [row <= height] whileTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1584
        stripNr := stripNr + 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1585
        self positionToStrip:stripNr.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1586
        nBytes := stripByteCounts at:stripNr.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1587
        (nBytes > prevSize) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1588
            compressedStrip := ByteArray uninitializedNew:nBytes.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1589
            prevSize := nBytes
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1590
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1591
        (inStream nextBytes:nBytes into:compressedStrip) == nBytes ifFalse:[ self error:'short read' ].
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1592
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1593
        "/ RLE decode... (see http://fileformats.archiveteam.org/wiki/ThunderScan_compression)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1594
        i := 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1595
        pixelIndex := offset.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1596
        
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1597
        [i <= nBytes] whileTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1598
            |code|
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1599
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1600
            code := compressedStrip at:i.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1601
            i := i + 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1602
            code >= 2r11000000 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1603
                "/ a single pixel
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1604
                lastPixel := code bitAnd:2r00111111.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1605
                self assert:(lastPixel <= 2r1111).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1606
                
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1607
                gen value:lastPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1608
            ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1609
                code >= 2r10000000 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1610
                    "/ three bit deltas (2 pixels)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1611
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1612
                    d1 := (code rightShift:3) bitAnd:2r111.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1613
                    d2 := code bitAnd:2r111.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1614
                    d1 ~~ 4 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1615
                        lastPixel := lastPixel + (#(0 1 2 3 0 -3 -2 -1) at:d1+1).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1616
                        gen value:lastPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1617
                    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1618
                    d2 ~~ 4 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1619
                        lastPixel := lastPixel + (#(0 1 2 3 0 -3 -2 -1) at:d2+1).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1620
                        gen value:lastPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1621
                    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1622
                ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1623
                    code >= 2r01000000 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1624
                        "/ two bit deltas (3 pixels)    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1625
                        d1 := (code rightShift:4) bitAnd:2r11.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1626
                        d2 := (code rightShift:2) bitAnd:2r11.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1627
                        d3 := code bitAnd:2r11.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1628
                        d1 ~~ 2 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1629
                            lastPixel := lastPixel + (#(0 1 0 -1) at:d1+1).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1630
                            gen value:lastPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1631
                        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1632
                        d2 ~~ 2 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1633
                            lastPixel := lastPixel + (#(0 1 0 -1) at:d2+1).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1634
                            gen value:lastPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1635
                        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1636
                        d3 ~~ 2 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1637
                            lastPixel := lastPixel + (#(0 1 0 -1) at:d3+1).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1638
                            gen value:lastPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1639
                        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1640
                    ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1641
                        code timesRepeat:[ gen value:lastPixel ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1642
                    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1643
                ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1644
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1645
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1646
        "/ self assert:(pixelIndex == (offset + bytesPerStrip)).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1647
        
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1648
        offset := offset + bytesPerStrip.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1649
        row := row + rowsPerStrip
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1650
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1651
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1652
    (predictor ~~ 1) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1653
        ^ self fileFormatError:('unsupported predictor: %1' bindWith:predictor).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1654
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1655
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1656
    "Modified: / 27-08-2017 / 15:38:47 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1657
!
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1658
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1659
readTiffImageData
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1660
    (compression == COMPRESSION_NONE " 1 " ) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1661
        self readUncompressedTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1662
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1663
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1664
    (compression == COMPRESSION_CCITTRLE " 2 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1665
        self readCCITT3RLETiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1666
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1667
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1668
    (compression == COMPRESSION_CCITTFAX3 " 3 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1669
        self readCCITTGroup3TiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1670
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1671
    ]. 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1672
    (compression == COMPRESSION_CCITTFAX4 " 4 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1673
        self readCCITTGroup4TiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1674
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1675
    ]. 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1676
    (compression == COMPRESSION_LZW " 5 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1677
        self readLZWTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1678
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1679
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1680
    (compression == COMPRESSION_OJPEG " 6 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1681
        self readJPEGTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1682
        ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1683
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1684
    (compression == COMPRESSION_JPEG " 7 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1685
        self readNewJPEGTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1686
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1687
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1688
    (compression == COMPRESSION_ADOBE_DEFLATE " 8 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1689
        self readAdobeDeflateTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1690
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1691
    ].
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1692
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1693
    (compression == COMPRESSION_NEXT " 32766 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1694
        self readNeXTRLE2TiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1695
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1696
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1697
    (compression == COMPRESSION_CCITTRLEW " 32771 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1698
        self readCCITTRLEWTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1699
        ^ self
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1700
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1701
    (compression == COMPRESSION_PACKBITS " 32773 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1702
        self readPackbitsTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1703
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1704
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1705
    (compression == COMPRESSION_THUNDERSCAN " 32809 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1706
        self readThunderScanTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1707
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1708
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1709
    (compression == COMPRESSION_PIXARFILM " 32908 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1710
        self readPixarFilmTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1711
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1712
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1713
    (compression == COMPRESSION_PIXARLOG " 32909 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1714
        self readPixarLogTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1715
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1716
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1717
    (compression == COMPRESSION_DEFLATE " 32946 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1718
        self readDeflateTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1719
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1720
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1721
    (compression == COMPRESSION_DCS " 32947 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1722
        self readDCSTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1723
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1724
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1725
    (compression == COMPRESSION_NEXT_JPEG " 32865 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1726
        self readNeXTJPEGTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1727
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1728
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1729
    (compression == COMPRESSION_JBIG " 34661 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1730
        self readJBIGTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1731
        ^ self
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1732
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1733
    (compression == COMPRESSION_SGILOG " 34676 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1734
        self readSGI32TiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1735
        ^ self
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1736
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1737
    (compression == COMPRESSION_SGILOG24 " 34677 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1738
        self readSGI24TiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1739
        ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1740
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1741
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1742
    self fileFormatError:('compression type ' , compression printString , ' not known').
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1743
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1744
    "Created: / 11-04-1997 / 00:19:44 / cg"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1745
    "Modified: / 26-08-2017 / 21:46:56 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1746
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1747
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1748
readTiledJPEGTiffImageData
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1749
    ^ self fileFormatError:'tiled jpeg (old) compression not implemented'.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1750
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1751
    "Created: / 25-08-2017 / 16:27:28 / cg"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1752
    "Modified: / 26-08-2017 / 13:39:04 / cg"
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1753
!
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1754
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1755
readTiledLZWTiffImageData
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1756
    ^ self fileFormatError:'tiled LZW data not implemented' .
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1757
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1758
    "Created: / 25-08-2017 / 01:05:13 / cg"
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1759
!
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1760
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1761
readTiledNewJPEGTiffImageData
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1762
    ^ self fileFormatError:'tiled new jpeg compression not implemented'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1763
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1764
    "Created: / 26-08-2017 / 13:37:51 / cg"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1765
!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1766
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1767
readTiledTiffImageData
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1768
    (compression == COMPRESSION_NONE " 1 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1769
        self readTiledUncompressedTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1770
        ^ self
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1771
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1772
    (compression == COMPRESSION_LZW " 5 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1773
        self readTiledLZWTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1774
        ^ self
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1775
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1776
    (compression == COMPRESSION_OJPEG " 6 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1777
        self readTiledJPEGTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1778
        ^ self
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1779
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1780
    (compression == COMPRESSION_JPEG " 7 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1781
        self readTiledNewJPEGTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1782
        ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1783
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1784
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1785
    self fileFormatError:('tiled compression type ' , compression printString , ' not supported').
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1786
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1787
    "Created: / 25-08-2017 / 00:19:14 / cg"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1788
    "Modified: / 26-08-2017 / 13:39:15 / cg"
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1789
!
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1790
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1791
readTiledUncompressedTiffImageData
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1792
    |bytesPerRow     "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1793
     bitsPerRow      "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1794
     bytesPerTileRow "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1795
     bitsPerTileRow  "{ Class: SmallInteger }" 
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1796
     nPlanes 
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1797
     tileNr          "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1798
     "/ offset          "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1799
     "/ row             "{ Class: SmallInteger }" 
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1800
     nBytes          "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1801
     bitsPerPixel    "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1802
     overAllBytes    "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1803
     where           "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1804
     x               "{ Class: SmallInteger }"       
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1805
     y               "{ Class: SmallInteger }" 
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1806
     imageRowOffset  "{ Class: SmallInteger }" 
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1807
     imageOffset     "{ Class: SmallInteger }" 
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1808
     tileOffset      "{ Class: SmallInteger }"   
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1809
     dataOffset      "{ Class: SmallInteger }"   
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1810
     tilePos tile tH tW tb|
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1811
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1812
    nPlanes := samplesPerPixel.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1813
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1814
    "/ not all formats are supported here,
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1815
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1816
    (nPlanes == 2) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1817
        (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1818
            ^ self fileFormatError:'with alpha, only separate planes supported'.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1819
        ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1820
        'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1821
        nPlanes := 1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1822
        bitsPerPixel := bitsPerSample at:1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1823
        bitsPerSample := Array with:bitsPerPixel.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1824
        samplesPerPixel := 1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1825
    ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1826
        (nPlanes == 4) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1827
            (planarConfiguration ~~ PLANARCONFIG_CONTIG) ifTrue:[
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1828
                ^ self fileFormatError:'only non separate planes supported'.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1829
            ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1830
            bitsPerSample ~= #(8 8 8 8) ifTrue:[
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1831
                ^ self fileFormatError:'only 8/8/8/8 images supported (is: ' , bitsPerSample printString , ')'.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1832
            ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1833
            bitsPerPixel := 32.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1834
        ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1835
            (nPlanes == 3) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1836
                (planarConfiguration ~~ PLANARCONFIG_CONTIG) ifTrue:[
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1837
                    ^ self fileFormatError:'only non separate planes supported'.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1838
                ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1839
                bitsPerSample ~= #(8 8 8) ifTrue:[
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1840
                    ^ self fileFormatError:'only 8/8/8 images supported (is: ' , bitsPerSample printString , ')'.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1841
                ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1842
                bitsPerPixel := 24
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1843
            ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1844
                (nPlanes ~~ 1) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1845
                    ^ self fileFormatError:('unsupported format: nplanes=' , nPlanes printString).
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1846
                ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1847
                bitsPerPixel := bitsPerSample at:1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1848
            ]
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1849
        ]
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1850
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1851
    stripRowCounts notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1852
        ^ self fileFormatError:'stripRowCounts not supported'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1853
    ].
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1854
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1855
    bitsPerRow := width * bitsPerPixel.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1856
    bytesPerRow := (bitsPerRow + 7) // 8.
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1857
    
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1858
    bitsPerTileRow := tileWidth * bitsPerPixel.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1859
    bytesPerTileRow := (bitsPerTileRow + 7) // 8.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1860
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1861
    overAllBytes := bytesPerRow * height.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1862
    data := ByteArray new:overAllBytes.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1863
    
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1864
    tileNr := 1.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1865
    where := -1.
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1866
    y := 0.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1867
    imageRowOffset := 1.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1868
    [ y < height ] whileTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1869
        tH := tileLength.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1870
        (y+tileLength) > height ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1871
            tH := height - y.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1872
        ].    
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1873
        x := 0.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1874
        imageOffset := imageRowOffset.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1875
        [ x < width ] whileTrue:[
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1876
            nBytes := tileByteCounts at:tileNr.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1877
            tilePos := tileOffsets at:tileNr.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1878
            tileNr := tileNr + 1.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1879
            
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1880
            where ~~ tilePos ifTrue:[
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1881
                inStream position:tilePos.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1882
                where := tilePos.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1883
            ].
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1884
            tile := ByteArray new:nBytes.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1885
            inStream nextBytes:nBytes into:tile startingAt:1 blockSize:4096.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1886
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1887
            "/ copy the tile.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1888
            tileOffset := 1.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1889
            dataOffset := imageOffset. 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1890
            tW := tileWidth.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1891
            tb := bytesPerTileRow.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1892
            (x+tileWidth) > width ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1893
                tW := width-x.
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1894
                tb := ((bitsPerPixel * tW) + 7) // 8.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1895
            ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1896
            1 to:tH do:[:yT |
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1897
                data replaceFrom:dataOffset to:dataOffset+tb-1 with:tile startingAt:tileOffset.
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1898
                dataOffset := dataOffset + bytesPerRow.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1899
                tileOffset := tileOffset + bytesPerTileRow.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1900
            ].
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1901
            
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1902
            "/ offset := offset + nBytes.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1903
            "/ row := row + rowsPerStrip.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1904
            where := where + nBytes.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1905
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1906
            x := x + tW.
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1907
            imageOffset := imageOffset + bytesPerTileRow.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1908
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1909
        y := y + tH.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1910
        imageRowOffset := imageRowOffset + (bytesPerRow*tH).
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1911
    ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1912
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1913
    "Created: / 25-08-2017 / 00:22:31 / cg"
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1914
    "Modified: / 28-08-2017 / 01:14:00 / cg"
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1915
!
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1916
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1917
readUncompressedTiffImageData
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1918
    self readImageDataUsingDecompressor:nil
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1919
    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1920
"/    |bytesPerRow   "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1921
"/     bitsPerRow    "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1922
"/     nPlanes 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1923
"/     stripNr       "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1924
"/     offset        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1925
"/     row           "{ Class: SmallInteger }" 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1926
"/     nBytes        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1927
"/     bitsPerPixel 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1928
"/     overAllBytes  "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1929
"/     where         "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1930
"/     stripPos 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1931
"/     convertFloats convertDoubles convertHalfFloats|
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1932
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1933
"/    nPlanes := samplesPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1934
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1935
"/    "/ not all formats are supported here,
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1936
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1937
"/    (nPlanes == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1938
"/        (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1939
"/            ^ self fileFormatError:'with alpha, only separate planes supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1940
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1941
"/        'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1942
"/        nPlanes := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1943
"/        bitsPerPixel := bitsPerSample at:1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1944
"/        bitsPerSample := Array with:bitsPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1945
"/        samplesPerPixel := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1946
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1947
"/        (nPlanes == 4) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1948
"/            (planarConfiguration ~~ PLANARCONFIG_CONTIG) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1949
"/                ^ self fileFormatError:'only non separate planes supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1950
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1951
"/            bitsPerSample ~= #(8 8 8 8) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1952
"/                bitsPerSample ~= #(16 16 16 16) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1953
"/                    ^ self fileFormatError:'only 8/8/8/8 and 16/16/16/16 images supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1954
"/                ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1955
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1956
"/            bitsPerPixel := bitsPerSample sum.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1957
"/        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1958
"/            (nPlanes == 3) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1959
"/                (planarConfiguration ~~ 1) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1960
"/                    ^ self fileFormatError:'only non separate planes supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1961
"/                ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1962
"/                bitsPerSample ~= #(8 8 8) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1963
"/                    bitsPerSample ~= #(16 16 16) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1964
"/                        ^ self fileFormatError:'only 8/8/8 and 16/16/16 images supported; is: ' , bitsPerSample printString.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1965
"/                    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1966
"/                ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1967
"/                bitsPerPixel := bitsPerSample sum.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1968
"/            ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1969
"/                (nPlanes ~~ 1) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1970
"/                    ^ self fileFormatError:('unsupported format: nplanes=' , nPlanes printString).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1971
"/                ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1972
"/                bitsPerPixel := bitsPerSample at:1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1973
"/            ]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1974
"/        ]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1975
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1976
"/    stripRowCounts notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1977
"/        ^ self fileFormatError:'stripRowCounts not supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1978
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1979
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1980
"/    bitsPerRow := width * bitsPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1981
"/    bytesPerRow := bitsPerRow // 8.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1982
"/    ((bitsPerRow \\ 8) ~~ 0) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1983
"/        bytesPerRow := bytesPerRow + 1
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1984
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1985
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1986
"/    overAllBytes := bytesPerRow * height.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1987
"/    bytesPerRow == width ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1988
"/        data := ByteArray uninitializedNew:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1989
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1990
"/        data := ByteArray new:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1991
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1992
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1993
"/    offset := 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1994
"/    stripNr := 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1995
"/    where := -1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1996
"/    row := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1997
"/    [row <= height] whileTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1998
"/        stripNr := stripNr + 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1999
"/        nBytes := stripByteCounts at:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2000
"/        stripPos := stripOffsets at:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2001
"/        where ~~ stripPos ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2002
"/            inStream position:stripPos.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2003
"/            where := stripPos.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2004
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2005
"/        
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2006
"/        offset + nBytes > overAllBytes ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2007
"/            nBytes := overAllBytes - offset.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2008
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2009
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2010
"/        (inStream nextBytes:nBytes into:data startingAt:offset+1) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2011
"/            ^ self fileFormatError:'short read'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2012
"/        ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2013
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2014
"/        offset := offset + nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2015
"/        row := row + rowsPerStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2016
"/        where := where + nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2017
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2018
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  2019
    "Modified: / 29-08-2017 / 23:15:07 / cg"
440
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  2020
! !
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  2021
1762
55cf76514c8c method category rename
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  2022
!TIFFReader methodsFor:'private-reading'!
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2023
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2024
decodePhotoshopImageResourceBlock:bytes
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2025
    "8BIM is the signature for Photoshop Image Resource Block (IRB). 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2026
     See http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_38034.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2027
     
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2028
     This kind of information could be found in images such as TIFF, JPEG, Photoshop native image format etc. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2029
     It could also be found in non-image documents such as in PDF.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2030
     The structure of the IRB is as follows:
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2031
     Each IRB block starts with 4 bytes signature which translates to string '8BIM.' 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2032
     After that, is a 2 bytes unique identifier denoting the kind of resource for this IRB. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2033
     For example: 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2034
        0x040c for thumbnail; 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2035
        0x041a for slices; 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2036
        0x0408 for grid information; 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2037
        0x040f for ICC Profile etc.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2038
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2039
     After the identifier is a variable length string for name. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2040
     The first byte of the string tells the length of the string (excluding the first length byte). 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2041
     After the first byte comes the string itself. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2042
     There is a requirement that the length of the whole string (including the length byte) should be even. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2043
     Otherwise, pad one more byte after the string.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2044
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2045
     The next 4 bytes specifies the size of the actual data for this resource block followed by the data with the specified length. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2046
     The total length of the data also should be an even number. So if the size of the data is odd, pad another one byte. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2047
     This finishes a whole 8BIM.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2048
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2049
     There could be more than one IRBs but they all conform to the same structure as described above. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2050
     How to interpret the data depends on the unique identifier.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2051
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2052
     Now let's see how the IRBs are include in images. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2053
     For a JPEG image, metadata could be present as one of the application (APPn) segment. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2054
     Since different application could use the same APPn segment to store it's own metadata, 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2055
     there must be some kind of identifier to let the image reader know what kind of information is contained inside the APPn. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2056
     Photoshop uses APP13 as it's IRB container and the APP13 contains 'Photoshop 3.0' as it's identifier.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2057
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2058
     For TIFF image which is tag based and arranged in a directory structure. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2059
     There is a private tag 16r8649 called 'PHOTOSHOP' to insert IRB information.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2060
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2061
    0x03E8 (Obsolete--Photoshop 2.0 only ) Contains five 2-byte values: number of channels, rows, columns, depth, and mode
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2062
    0x03E9 Macintosh print manager print info record
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2063
    0x03EA Macintosh page format information. No longer read by Photoshop. (Obsolete)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2064
    0x03EB Obsolete--Photoshop 2.0 only ) Indexed color table
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2065
    0x03ED ResolutionInfo structure. See Appendix A in Photoshop API Guide.pdf.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2066
    0x03EE Names of the alpha channels as a series of Pascal strings.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2067
    0x03EF (Obsolete) See ID 1077DisplayInfo structure. See Appendix A in Photoshop API Guide.pdf.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2068
    0x03F0 The caption as a Pascal string.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2069
    0x03F1 Border information. Contains a fixed number (2 bytes real, 2 bytes fraction) for the border width, and 2 bytes for border units (1 = inches, 2 = cm, 3 = points, 4 = picas, 5 = columns).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2070
    0x03F2 Background color. See See Color structure.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2071
    0x03F3 Print flags. A series of one-byte boolean values (see Page Setup dialog): labels, crop marks, color bars, registration marks, negative, flip, interpolate, caption, print flags.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2072
    0x03F4 Grayscale and multichannel halftoning information
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2073
    0x03F5 Color halftoning information
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2074
    0x03F6 Duotone halftoning information
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2075
    0x03F7 Grayscale and multichannel transfer function
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2076
    0x03F8 Color transfer functions
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2077
    0x03F9 Duotone transfer functions
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2078
    0x03FA Duotone image information
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2079
    0x03FB Two bytes for the effective black and white values for the dot range
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2080
    0x03FC (Obsolete)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2081
    0x03FD EPS options
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2082
    0x03FE Quick Mask information. 2 bytes containing Quick Mask channel ID; 1- byte boolean indicating whether the mask was initially empty.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2083
    0x03FF (Obsolete)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2084
    0x0400 Layer state information. 2 bytes containing the index of target layer (0 = bottom layer).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2085
    0x0401 Working path (not saved). See See Path resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2086
    0x0402 Layers group information. 2 bytes per layer containing a group ID for the dragging groups. Layers in a group have the same group ID.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2087
    0x0403 (Obsolete)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2088
    0x0404 IPTC-NAA record. Contains the File Info... information. See the documentation in the IPTC folder of the Documentation folder.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2089
    0x0405 Image mode for raw format files
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2090
    0x0406 JPEG quality. Private.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2091
    0x0408 (Photoshop 4.0) Grid and guides information. See See Grid and guides resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2092
    0x0409 (Photoshop 4.0) Thumbnail resource for Photoshop 4.0 only. See See Thumbnail resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2093
    0x040A (Photoshop 4.0) Copyright flag. Boolean indicating whether image is copyrighted. Can be set via Property suite or by user in File Info...
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2094
    0x040B (Photoshop 4.0) URL. Handle of a text string with uniform resource locator. Can be set via Property suite or by user in File Info...
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2095
    0x040C (Photoshop 5.0) Thumbnail resource (supersedes resource 1033). See See Thumbnail resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2096
    0x040D (Photoshop 5.0) Global Angle. 4 bytes that contain an integer between 0 and 359, which is the global lighting angle for effects layer. If not present, assumed to be 30.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2097
    0x040E (Obsolete) See ID 1073 below. (Photoshop 5.0) Color samplers resource. See See Color samplers resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2098
    0x040F (Photoshop 5.0) ICC Profile. The raw bytes of an ICC (International Color Consortium) format profile. See ICC1v42_2006-05.pdf in the Documentation folder and icProfileHeader.h in Sample Code\Common\Includes .
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2099
    0x0410 (Photoshop 5.0) Watermark. One byte.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2100
    0x0411 (Photoshop 5.0) ICC Untagged Profile. 1 byte that disables any assumed profile handling when opening the file. 1 = intentionally untagged.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2101
    0x0412 (Photoshop 5.0) Effects visible. 1-byte global flag to show/hide all the effects layer. Only present when they are hidden.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2102
    0x0413 (Photoshop 5.0) Spot Halftone. 4 bytes for version, 4 bytes for length, and the variable length data.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2103
    0x0414 (Photoshop 5.0) Document-specific IDs seed number. 4 bytes: Base value, starting at which layer IDs will be generated (or a greater value if existing IDs already exceed it). Its purpose is to avoid the case where we add layers, flatten, save, open, and then add more layers that end up with the same IDs as the first set.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2104
    0x0415 (Photoshop 5.0) Unicode Alpha Names. Unicode string
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2105
    0x0416 (Photoshop 6.0) Indexed Color Table Count. 2 bytes for the number of colors in table that are actually defined
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2106
    0x0417 (Photoshop 6.0) Transparency Index. 2 bytes for the index of transparent color, if any.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2107
    0x0419 (Photoshop 6.0) Global Altitude. 4 byte entry for altitude
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2108
    0x041A (Photoshop 6.0) Slices. See See Slices resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2109
    0x041B (Photoshop 6.0) Workflow URL. Unicode string
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2110
    0x041C (Photoshop 6.0) Jump To XPEP. 2 bytes major version, 2 bytes minor version, 4 bytes count. Following is repeated for count: 4 bytes block size, 4 bytes key, if key = 'jtDd' , then next is a Boolean for the dirty flag; otherwise it's a 4 byte entry for the mod date.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2111
    0x041D (Photoshop 6.0) Alpha Identifiers. 4 bytes of length, followed by 4 bytes each for every alpha identifier.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2112
    0x041E (Photoshop 6.0) URL List. 4 byte count of URLs, followed by 4 byte long, 4 byte ID, and Unicode string for each count.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2113
    0x0421 (Photoshop 6.0) Version Info. 4 bytes version, 1 byte hasRealMergedData , Unicode string: writer name, Unicode string: reader name, 4 bytes file version.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2114
    0x0422 (Photoshop 7.0) EXIF data 1. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2115
    0x0423 (Photoshop 7.0) EXIF data 3. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2116
    0x0424 (Photoshop 7.0) XMP metadata. File info as XML description. See http://www.adobe.com/devnet/xmp/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2117
    0x0425 (Photoshop 7.0) Caption digest. 16 bytes: RSA Data Security, MD5 message-digest algorithm
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2118
    0x0426 (Photoshop 7.0) Print scale. 2 bytes style (0 = centered, 1 = size to fit, 2 = user defined). 4 bytes x location (floating point). 4 bytes y location (floating point). 4 bytes scale (floating point)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2119
    0x0428 (Photoshop CS) Pixel Aspect Ratio. 4 bytes (version = 1 or 2), 8 bytes double, x / y of a pixel. Version 2, attempting to correct values for NTSC and PAL, previously off by a factor of approx. 5%.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2120
    0x0429 (Photoshop CS) Layer Comps. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2121
    0x042A (Photoshop CS) Alternate Duotone Colors. 2 bytes (version = 1), 2 bytes count, following is repeated for each count: [ Color: 2 bytes for space followed by 4 * 2 byte color component ], following this is another 2 byte count, usually 256, followed by Lab colors one byte each for L, a, b. This resource is not read or used by Photoshop.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2122
    0x042B (Photoshop CS)Alternate Spot Colors. 2 bytes (version = 1), 2 bytes channel count, following is repeated for each count: 4 bytes channel ID, Color: 2 bytes for space followed by 4 * 2 byte color component. This resource is not read or used by Photoshop.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2123
    0x042D (Photoshop CS2) Layer Selection ID(s). 2 bytes count, following is repeated for each count: 4 bytes layer ID
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2124
    0x042E (Photoshop CS2) HDR Toning information
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2125
    0x042F (Photoshop CS2) Print info
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2126
    0x0430 (Photoshop CS2) Layer Group(s) Enabled ID. 1 byte for each layer in the document, repeated by length of the resource. NOTE: Layer groups have start and end markers
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2127
    0x0431 (Photoshop CS3) Color samplers resource. Also see ID 1038 for old format. See See Color samplers resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2128
    0x0432 (Photoshop CS3) Measurement Scale. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2129
    0x0433 (Photoshop CS3) Timeline Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2130
    0x0434 (Photoshop CS3) Sheet Disclosure. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2131
    0x0435 (Photoshop CS3) DisplayInfo structure to support floating point clors. Also see ID 1007. See Appendix A in Photoshop API Guide.pdf .
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2132
    0x0436 (Photoshop CS3) Onion Skins. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2133
    0x0438 (Photoshop CS4) Count Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the count in the document. See the Count Tool.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2134
    0x043A (Photoshop CS5) Print Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print settings in the document. The color management options.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2135
    0x043B (Photoshop CS5) Print Style. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print style in the document. The printing marks, labels, ornaments, etc.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2136
    0x043C (Photoshop CS5) Macintosh NSPrintInfo. Variable OS specific info for Macintosh. NSPrintInfo. It is recommened that you do not interpret or use this data.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2137
    0x043D (Photoshop CS5) Windows DEVMODE. Variable OS specific info for Windows. DEVMODE. It is recommened that you do not interpret or use this data.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2138
    0x043E (Photoshop CS6) Auto Save File Path. Unicode string. It is recommened that you do not interpret or use this data.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2139
    0x043F (Photoshop CS6) Auto Save Format. Unicode string. It is recommened that you do not interpret or use this data.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2140
    0x0440 (Photoshop CC) Path Selection State. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current path selection state.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2141
    0x07D0-0x0BB6 Path Information (saved paths). See See Path resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2142
    0x0BB7 Name of clipping path. See See Path resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2143
    0x0BB8 (Photoshop CC) Origin Path Info. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the origin path data.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2144
    0x0FA0-0x1387 Plug-In resource(s). Resources added by a plug-in. See the plug-in API found in the SDK documentation
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2145
    0x1B58 Image Ready variables. XML representation of variables definition
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2146
    0x1B59 Image Ready data sets
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2147
    0x1B5A Image Ready default selected state
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2148
    0x1B5B Image Ready 7 rollover expanded state
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2149
    0x1B5C Image Ready rollover expanded state
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2150
    0x1B5D Image Ready save layer settings
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2151
    0x1B5E Image Ready version
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2152
    0x1F40 (Photoshop CS3) Lightroom workflow, if present the document is in the middle of a Lightroom workflow.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2153
    0x2710 Print flags information. 2 bytes version ( = 1), 1 byte center crop marks, 1 byte ( = 0), 4 bytes bleed width value, 2 bytes bleed width scale.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2154
    "
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2155
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2156
    |s id name len resource record|
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2157
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2158
    record := OrderedCollection new.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2159
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2160
    s := bytes readStream.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2161
    [s atEnd] whileFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2162
        (s next:4) asString = '8BIM' ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2163
            id := s nextUnsignedInt16MSB.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2164
            name := s upTo:0.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2165
            name size odd ifFalse:[ s next ]. "/ padding
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2166
            len := s nextUnsignedInt32MSB.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2167
            resource := s next:len.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2168
            Verbose == true ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2169
                Transcript showCR:('      8BIM-%1: %2' bindWith:(id hexPrintString:4) with:resource).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2170
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2171
            record add:(Dictionary new
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2172
                            at:#id put:id;
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2173
                            at:#name put:name;
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2174
                            at:#resource put:resource;
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2175
                            yourself).                    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2176
        ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2177
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2178
    metaData at:#'PhotoshopIRB' put:record.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2179
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2180
    "Created: / 27-08-2017 / 17:12:25 / cg"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2181
    "Modified: / 27-08-2017 / 18:14:56 / cg"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2182
!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2183
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2184
decodeTiffTag:tagType numberType:numberType length:length
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2185
    "see (among others): https://exiftool.org/TagNames/EXIF.html"
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2186
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2187
    |offset value valueArray 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2188
     val scaleFactor rV gV bV
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2189
     n  "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2190
     i2 "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2191
     i3 "{ Class: SmallInteger }" |
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2192
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2193
    Verbose == true ifTrue:[ Logger info:'tiffTag: %1' with:tagType ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2194
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2195
    (numberType == 3 "TIFF_SHORT") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2196
        "16 bit ushort"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2197
        valueArray := self readShorts:length signed:false.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2198
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2199
    ] ifFalse:[(numberType == 4 "TIFF_LONG") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2200
        "32 bit uinteger"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2201
        valueArray := self readLongs:length signed:false.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2202
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2203
    ] ifFalse:[(numberType == 2 "TIFF_ASCII") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2204
        "ascii characters"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2205
        value := self readChars:length
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2206
    ] ifFalse:[(numberType == 5 "TIFF_RATIONAL") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2207
        "64 (32+32) bit ufraction"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2208
        valueArray := self readFracts:length signed:false.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2209
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2210
    ] ifFalse:[(numberType == 1 "TIFF_BYTE") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2211
        "8bit uinteger"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2212
        value := self readBytes:length signed:false
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2213
    ] ifFalse:[(numberType == 6 "TIFF_SBYTE") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2214
        "TIFF6: 8bit signed integer"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2215
        value := self readBytes:length  signed:true
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2216
    ] ifFalse:[(numberType == 8 "TIFF_SSHORT") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2217
        "TIFF6: 16bit signed integer"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2218
        valueArray := self readShorts:length signed:true.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2219
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2220
    ] ifFalse:[(numberType == 9 "TIFF_SLONG") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2221
        "TIFF6: 32bit signed integer"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2222
        valueArray := self readLongs:length signed:true.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2223
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2224
    ] ifFalse:[(numberType == 10 "TIFF_SRATIONAL") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2225
        "TIFF6: 64 (32+32) bit signed fraction"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2226
        valueArray := self readFracts:length signed:true.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2227
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2228
    ] ifFalse:[(numberType == 11 "TIFF_FLOAT") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2229
        "TIFF6: 32 bit IEEE float"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2230
        valueArray := self readFloats:length.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2231
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2232
    ] ifFalse:[(numberType == 12 "TIFF_DOUBLE") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2233
        "TIFF6: 64 bit IEEE double"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2234
        valueArray := self readDoubles:length.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2235
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2236
        
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2237
    ] ifFalse:[(numberType == 7 "TIFF_UNDEFINED") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2238
        "8bit anything"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2239
        value := self readBytes:length signed:false
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2240
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2241
    "/ the following are preps for the propsed bigTiff format    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2242
    ] ifFalse:[(numberType == 16 "TIFF_LONG8") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2243
        "BIGTIFF: 8-byte unsigned integer"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2244
        valueArray := self readLong8s:length signed:false.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2245
        value := valueArray at:1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2246
    ] ifFalse:[(numberType == 17 "TIFF_SLONG8") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2247
        "BIGTIFF: 8-byte signed integer"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2248
        valueArray := self readLong8s:length signed:true.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2249
        value := valueArray at:1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2250
    ] ifFalse:[(numberType == 18 "TIFF_IFD8") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2251
        "BIGTIFF: 8-byte unsigned IFD offset"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2252
        valueArray := self readLong8s:length signed:false.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2253
        value := valueArray at:1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2254
    ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2255
        isBigTiff ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2256
            offset := (inStream nextInt64MSB:(byteOrder ~~ #lsb))
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2257
        ] ifFalse:[    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2258
            offset := (inStream nextInt32MSB:(byteOrder ~~ #lsb))
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2259
        ]
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2260
    ]]]]]]]]]]]]]]].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2261
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2262
    (tagType between:200 and:299) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2263
        (tagType == 254 "0xFE") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2264
            "/ New SubfileType
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2265
            "/      REDUCEDIMAGE    -> 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2266
            "/      PAGE            -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2267
            "/      MASK            -> 4
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2268
            "newSubFileType := value."
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2269
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2270
            "/ 'newSubfiletype ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2271
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2272
                Logger info:'      newSubfiletype: %1' with:value
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2273
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2274
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2275
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2276
        (tagType == 255 "0xFF") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2277
            "/ Old SubfileType
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2278
            "/      IMAGE           -> 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2279
            "/      REDUCEDIMAGE    -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2280
            "/      PAGE            -> 3
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2281
            subFileType := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2282
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2283
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2284
                Logger info:'      oldSubfiletype: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2285
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2286
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2287
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2288
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2289
        (tagType == 256 "0x100") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2290
            "ImageWidth"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2291
            width := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2292
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2293
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2294
                Logger info:'      width: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2295
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2296
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2297
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2298
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2299
        (tagType == 257 "0x101") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2300
            "ImageHeight"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2301
            height := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2302
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2303
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2304
                Logger info:'      height: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2305
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2306
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2307
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2308
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2309
        (tagType == 258 "0x102") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2310
            "bitspersample"  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2311
             bitsPerSample := valueArray.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2312
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2313
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2314
                Logger info:'      bitspersample: %1' with:valueArray 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2315
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2316
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2317
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2318
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2319
        (tagType == 259 "0x103") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2320
            "/ compression
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2321
            "/      NONE            -> 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2322
            "/      CCITTRLE        -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2323
            "/      CCITTFAX3       -> 3
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2324
            "/      CCITTFAX4       -> 4
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2325
            "/      LZW             -> 5
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2326
            "/      OJPEG           -> 6 (old style jpeg)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2327
            "/      JPEG            -> 7 (new style jpeg)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2328
            "/      ADOBE_DEFLATE   -> 8
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2329
            "/      JBIG            -> 9 (ITU-T T85)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2330
            "/      JBIG            -> 10 (ITU-T T43)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2331
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2332
            "/      NEXT            -> 32766 (NeXT 2-bit encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2333
            "/      CCITTRLEW       -> 32771
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2334
            "/      PACKBITS        -> 32773
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2335
            "/      THUNDERSCAN     -> 32809 (ThunderScan 4-bit encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2336
            "/      IT8CTPAD        -> 32895  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2337
            "/      IT8LW           -> 32896  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2338
            "/      IT8MP           -> 32897  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2339
            "/      IT8BL           -> 32898  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2340
            "/      PIXARFILM       -> 32908
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2341
            "/      PIXARLOG        -> 32909 (Pixar companded 11-bit ZIP encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2342
            "/      DEFLATE         -> 32946 (PKZIP-style Deflate encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2343
            "/      DCS             -> 32947 (kodac)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2344
            "/      JBIG            -> 34661
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2345
            "/      SGI32           -> 34676 (SGI 32-bit Log Luminance encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2346
            "/      SGI24           -> 34677 (SGI 24-bit Log Luminance encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2347
            "/      JPEG2000        -> 34712 JPEG2000
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2348
            "/      NIKON_NEF       -> 34713 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2349
            "/      JBIG2           -> 34715 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2350
            compression := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2351
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2352
            Verbose == true ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2353
                |s|
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2354
                s := (Dictionary withKeyValuePairs:
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2355
                        #( (1 uncompressed)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2356
                            (2 CCITTRLE)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2357
                            (3 CCITTFAX3)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2358
                            (4 CCITTFAX4)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2359
                            (5 LZW)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2360
                            (6 OJPEG)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2361
                            (7 JPEG)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2362
                            (8 ADOBE_DEFLATE)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2363
                            (9 JBIG_T85)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2364
                            (10 JBIG_T43)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2365
                            (32766 NEXT)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2366
                            (32771 CCITTRLEW)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2367
                            (32773 PACKBITS)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2368
                            (32809 THUNDERSCAN)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2369
                            (32895 IT8CTPAD)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2370
                            (32896 IT8LW)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2371
                            (32897 IT8MP)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2372
                            (32898 IT8BL)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2373
                            (32908 PIXARFILM)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2374
                            (32909 PIXARLOG)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2375
                            (32946 DEFLATE)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2376
                            (32947 DCS)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2377
                            (34661 JBIG)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2378
                            (34676 SGI32)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2379
                            (34677 SGI24)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2380
                            (34712 JPEG2000)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2381
                            (34713 NIKON_NEF)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2382
                            (34715 JBIG2) 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2383
                        )) at:value ifAbsent:'???'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2384
                Logger info:'      compression: %1 (=%2)' with:value with:s.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2385
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2386
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2387
        ].
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2388
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2389
        (tagType == 262 "0x106") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2390
            "photometric"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2391
            |p|
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2392
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2393
            (value between:0 and:10) ifTrue:[
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2394
                p := 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2395
                    #(
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2396
                        whiteIs0            "/  0 - grayscale or monochrome; faxes
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2397
                        blackIs0            "/  1 - grayscale or monochrome; faxes
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2398
                        rgb                 "/  2
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2399
                        palette             "/  3
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2400
                        transparencyMask    "/  4
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2401
                        cmyk                "/  5 - color separations
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2402
                        YCbCr               "/  6 - CCIR 601
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2403
                        nil                 "/  7
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2404
                        CIElab              "/  8 - 1976 CIE L*a*b*
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2405
                        ICClab              "/  9 - ICC L*a*b*
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2406
                        ITUlab              "/ 10 - see ITO-T- Rec T42 (RFC 2301)
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2407
                    ) at:(value + 1)    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2408
            ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2409
                (value == 32803) ifTrue:[
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2410
                    p := #ColorFilterArray    "/ camera rw format
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2411
                ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2412
                (value == 32844) ifTrue:[
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2413
                    p := #PixarLogL   
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2414
                ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2415
                (value == 32845) ifTrue:[
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2416
                    p := #PixarLogLuv    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2417
                ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2418
                (value == 32892) ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2419
                    p := #SequentialColorFilter    
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2420
                ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2421
                (value == 34892) ifTrue:[
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2422
                    p := #LinearRaw           "/ camera rw format
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2423
                ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2424
            ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2425
            photometric := p.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2426
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2427
                Logger info:'      photometric: %1 (=%2)' with:value with:photometric
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2428
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2429
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2430
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2431
        (tagType == 263 "0x107") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2432
            "/ Thresholding
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2433
            "/      BILEVEL         -> 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2434
            "/      HALFTONE        -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2435
            "/      ERRORDIFFUSE    -> 3
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2436
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2437
            "thresholding := value."
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2438
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2439
            "/ 'thresholding ' print. value printNewline.
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2440
            metaData at:#Thresholding put:value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2441
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2442
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2443
        (tagType == 264 "0x108") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2444
            "CellWidth"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2445
            "/ 'cellWidth ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2446
            metaData at:#CellWidth put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2447
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2448
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2449
        (tagType == 265 "0x109") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2450
            "CellLength"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2451
            "/ 'cellLength ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2452
            metaData at:#CellLength put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2453
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2454
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2455
        (tagType == 266 "0x10a") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2456
            "fillOrder"
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2457
            (value == FILLORDER_MSB2LSB ) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2458
                fillOrder := #msb
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2459
            ] ifFalse:[
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2460
                (value == FILLORDER_LSB2MSB) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2461
                    fillOrder := #lsb
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2462
                ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2463
                    fillOrder := nil
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2464
                ]
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2465
            ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2466
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2467
                Logger info:'      fillorder: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2468
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2469
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2470
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2471
        (tagType == 269 "0x10d") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2472
            "documentName - info only"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2473
            metaData at:#DocumentName put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2474
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2475
                Logger info:'      documentName: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2476
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2477
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2478
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2479
        (tagType == 270 "0x10e") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2480
            "imageDescription - info only"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2481
            metaData at:#ImageDescription put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2482
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2483
                Logger info:'      imageDescription: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2484
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2485
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2486
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2487
        (tagType == 271 "0x10f") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2488
            "make - info only"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2489
            metaData at:#Make put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2490
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2491
                Logger info:'      make: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2492
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2493
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2494
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2495
        (tagType == 272 "0x110") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2496
            "model - info only"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2497
            metaData at:#Model put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2498
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2499
                Logger info:'      model: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2500
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2501
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2502
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2503
        (tagType == 273 "0x111") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2504
            "stripOffsets"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2505
            stripOffsets := valueArray.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2506
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2507
                Logger info:'      stripOffsets: %1' with:valueArray 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2508
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2509
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2510
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2511
        (tagType == 274 "0x112") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2512
            "Orientation"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2513
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2514
            orientation :=
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2515
                            #( nil          "/ 1 normal (topLeft)
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2516
                               hFlip        "/ 2 horizontal flip
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2517
                               hvFlip       "/ 3 horizontal & vertical flip
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2518
                               vFlip        "/ 4 vertical flip
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2519
                               rot90ccw     "/ 5 rot 90' counter clock-wise
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2520
                               rot90        "/ 6 rot 90' clock-wise
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2521
                               rot90flip    "/ 7 rot 90' & flip
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2522
                               rot90ccwFlip "/ 8 rot 90' ccw & flip
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2523
                             ) at:value ifAbsent:#unsupported.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2524
            metaData at:#Orientation put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2525
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2526
                Logger info:'      orientation: %1 (=%2)' with:value with:(orientation ? #normal)
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2527
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2528
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2529
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2530
        (tagType == 277) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2531
            "SamplesPerPixel"
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2532
            samplesPerPixel := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2533
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2534
                Logger info:'      samplesperpixel: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2535
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2536
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2537
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2538
        (tagType == 278) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2539
            "RowsPerStrip"
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2540
            rowsPerStrip := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2541
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2542
                Logger info:'      rowsPerStrip: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2543
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2544
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2545
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2546
        (tagType == 279) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2547
            "Stripbytecount"
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2548
            stripByteCounts := valueArray.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2549
            "/        'stripByteCounts Array(' print. 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2550
            "/        stripByteCounts size print.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2551
            "/        ')' printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2552
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2553
                Logger info:'      stripByteCounts: %1' with:valueArray 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2554
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2555
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2556
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2557
        (tagType == 280) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2558
            "/ MinSampleValue
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2559
            metaData at:#MinSampleValue put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2560
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2561
                Logger info:'      minSampleValue: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2562
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2563
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2564
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2565
        (tagType == 281) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2566
            "/ MaxSampleValue
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2567
            metaData at:#MaxSampleValue put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2568
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2569
                Logger info:'      maxSampleValue: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2570
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2571
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2572
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2573
        (tagType == 282) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2574
            "/ xResolution
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2575
            metaData at:#ResolutionX put:value.  "/ for backward compat.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2576
            metaData at:#XResolution put:value.  "/ for standard conformity
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2577
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2578
                Logger info:'      xResolution: %1 (%2)' with:value with:value asFloat 
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2579
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2580
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2581
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2582
        (tagType == 283) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2583
            "/ yResolution
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2584
            metaData at:#ResolutionY put:value.  "/ for backward compat.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2585
            metaData at:#YResolution put:value.  "/ for standard conformity
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2586
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2587
                Logger info:'      yResolution: %1 (%2)' with:value with:value asFloat 
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2588
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2589
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2590
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2591
        (tagType == 284) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2592
            (value == 1) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2593
                planarConfiguration := PLANARCONFIG_CONTIG
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2594
            ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2595
                (value == 2) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2596
                    planarConfiguration := PLANARCONFIG_SEPARATE
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2597
                ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2598
                    planarConfiguration := nil
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2599
                ]
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2600
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2601
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2602
                Logger info:'      planarConfiguration: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2603
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2604
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2605
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2606
        (tagType == 285) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2607
            "/ 'pageName ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2608
            metaData at:#PageName put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2609
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2610
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2611
        (tagType == 286) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2612
            "/ xPosition
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2613
            metaData at:#PositionX put:value.  "/ for backward compat.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2614
            metaData at:#XPosition put:value.  "/ for standard conformity
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2615
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2616
                Logger info:'      xPosition: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2617
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2618
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2619
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2620
        (tagType == 287) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2621
            "/ yPosition
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2622
            metaData at:#PositionY put:value.  "/ for backward compat. 
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2623
            metaData at:#YPosition put:value.  "/ for standard conformity
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2624
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2625
                Logger info:'      yPosition: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2626
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2627
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2628
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2629
        (tagType == 288) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2630
            "/ 'freeOffsets ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2631
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2632
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2633
        (tagType == 289) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2634
            "/ 'freeByteCounts ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2635
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2636
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2637
        (tagType == 290) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2638
            "/ 'grayResponceUnit' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2639
            metaData at:#GrayResponceUnit put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2640
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2641
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2642
        (tagType == 291) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2643
            "/ 'grayResponceCurve' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2644
            metaData at:#GrayResponceCurve put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2645
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2646
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2647
        (tagType == 292 "0x124") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2648
            "/ group3options (now called T4Options)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2649
            "/      2DENCODING      -> 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2650
            "/      UNCOMPRESSED    -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2651
            "/      FILLBITS        -> 4
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2652
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2653
            group3options := value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2654
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2655
                Logger info:'      group3options: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2656
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2657
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2658
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2659
        (tagType == 293) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2660
            "/ group4options (now called T6Options)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2661
            "/      UNCOMPRESSED    -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2662
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2663
            "/ group4options := value.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2664
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2665
                Logger info:'      group4options: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2666
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2667
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2668
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2669
        (tagType == 296) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2670
            "resolutionunit"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2671
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2672
            "/        (value == 1) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2673
            "/            'res-unit pixel' printNewline
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2674
            "/        ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2675
            "/            (value == 2) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2676
            "/                'res-unit inch' printNewline
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2677
            "/            ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2678
            "/                (value == 3) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2679
            "/                    'res-unit mm' printNewline
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2680
            "/                ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2681
            "/                    'res-unit invalid' printNewline
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2682
            "/                ]
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2683
            "/            ]
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2684
            "/        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2685
            metaData at:#ResolutionUnit put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2686
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2687
                Logger info:'      resolutionUnit: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2688
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2689
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2690
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2691
        (tagType == 297) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2692
            "/ 'pageNumber ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2693
            metaData at:#PageNumber put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2694
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2695
                Logger info:'      PageNumber: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2696
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2697
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2698
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2699
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2700
    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2701
    (tagType between:300 and:399) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2702
        (tagType == 300 "0x12C") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2703
            "/ 'colorResponceUnit' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2704
            metaData at:#ColorResponceUnit put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2705
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2706
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2707
        (tagType == 301) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2708
            "/ 'transferFunction / colorResponceCurve' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2709
            metaData at:#ColorResponceCurve put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2710
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2711
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2712
        (tagType == 305) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2713
            "software - info only"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2714
            metaData at:#Software put:value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2715
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2716
                Logger info:'      software: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2717
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2718
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2719
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2720
        (tagType == 306) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2721
            "dateTime - info only"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2722
            metaData at:#DateTime put:value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2723
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2724
                Logger info:'      dateTime: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2725
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2726
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2727
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2728
        (tagType == 315) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2729
            "artist - info only"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2730
            metaData at:#Artist put:value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2731
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2732
                Logger info:'      artist: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2733
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2734
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2735
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2736
        (tagType == 316) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2737
            "host computer - info only"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2738
            metaData at:#HostComputer put:value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2739
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2740
                Logger info:'      host: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2741
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2742
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2743
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2744
        (tagType == 317) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2745
            "/ predictor
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2746
            "/ 1 -> no predictor
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2747
            "/ 2 -> horiz. difference (see tiff spec 6.0)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2748
            "/ 3 -> flt pnt (see adobe tech notes)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2749
            "/ 34892 -> horiz difference x2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2750
            "/ 34893 -> horiz difference x4
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2751
            "/ 34894 -> flt pnt x2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2752
            "/ 34895 -> flt pnt x4
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2753
            predictor := value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2754
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2755
                Logger info:'      predictor: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2756
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2757
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2758
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2759
        (tagType == 318) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2760
            "/ whitePoint
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2761
            metaData at:#WhitePoint put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2762
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2763
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2764
        (tagType == 319) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2765
            "/ primaryChromatics
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2766
            metaData at:#PrimaryChromatics put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2767
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2768
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2769
        (tagType == 320) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2770
            "/ 'colorMap (size=' print. valueArray size print. ')' printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2771
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2772
            "
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2773
             the tiff colormap contains 16bit values;
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2774
             our colormap expects 8bit values
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2775
            "
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2776
            n := valueArray size // 3.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2777
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2778
            rV := ByteArray uninitializedNew:n.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2779
            gV := ByteArray uninitializedNew:n.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2780
            bV := ByteArray uninitializedNew:n.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2781
            scaleFactor := 255.0 / 16rFFFF.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2782
            i2 := n+1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2783
            i3 := 2*n+1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2784
            1 to:n do:[:vi |
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2785
                val := ((valueArray at:vi) * scaleFactor) rounded.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2786
                rV at:vi put:val.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2787
                val := ((valueArray at:i2) * scaleFactor) rounded.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2788
                gV at:vi put:val.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2789
                val := ((valueArray at:i3) * scaleFactor) rounded.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2790
                bV at:vi put:val.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2791
                i2 := i2 + 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2792
                i3 := i3 + 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2793
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2794
            colorMap := MappedPalette redVector:rV greenVector:gV blueVector:bV.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2795
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2796
                Logger info:'      colormap: ...'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2797
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2798
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2799
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2800
        (tagType == 321) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2801
            "/ halftonehints
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2802
            metaData at:#HalftoneHints put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2803
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2804
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2805
        (tagType == 322) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2806
            "/ tilewidth
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2807
            tileWidth := value.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2808
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2809
                Logger info:'      tileWidth: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2810
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2811
            (tileWidth \\ 16) == 0 ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2812
                Logger warning:'TIFFReader: tile width is not a multiple of 16'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2813
            ].    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2814
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2815
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2816
        (tagType == 323) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2817
            "/ tilelength (height)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2818
            tileLength := value.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2819
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2820
                Logger info:'      tileLength: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2821
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2822
            (tileLength \\ 16) == 0 ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2823
                Logger warning:'TIFFReader: tile height is not a multiple of 16'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2824
            ].    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2825
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2826
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2827
        (tagType == 324) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2828
            "/ tileoffsets
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2829
            tileOffsets := valueArray.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2830
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2831
                Logger info:'      tileOffsets: %1' with:valueArray 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2832
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2833
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2834
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2835
        (tagType == 325) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2836
            "/ tilebytecounts
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2837
            tileByteCounts := valueArray.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2838
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2839
                Logger info:'      tileByteCounts: %1' with:valueArray 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2840
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2841
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2842
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2843
        (tagType == 326) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2844
            "/ badFaxLines
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2845
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2846
                Logger info:'      badFaxLines: %1' with:valueArray 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2847
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2848
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2849
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2850
        (tagType == 327) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2851
            "CleanFaxData"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2852
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2853
                "/        'cleanfaxdata' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2854
                "/        (value == 0) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2855
                "/            'no lines with incorrect pixel counts' printNewline
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2856
                "/        ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2857
                "/            (value == 1) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2858
                "/                'incorrect lines were regenerated' printNewline
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2859
                "/            ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2860
                "/                (value == 2) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2861
                "/                    'incorrect lines were not regenerated' printNewline
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2862
                "/                ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2863
                "/                    'cleanfaxdata invalid' printNewline
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2864
                "/                ]
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2865
                "/            ]
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2866
                "/        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2867
                Logger info:'      cleanfaxdata: %1' with:value  
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2868
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2869
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2870
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2871
        (tagType == 328) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2872
            "/ consecutiveBadFaxLines
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2873
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2874
                Logger info:'      consecutiveBadFaxLines: %1' with:valueArray 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2875
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2876
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2877
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2878
        (tagType == 330) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2879
            "/ subifd
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2880
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2881
                Logger info:'      subifd: %1' with:valueArray 
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2882
            ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2883
            subIfds := valueArray. 
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2884
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2885
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2886
        (tagType == 332) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2887
            "/ InkSet (used with Photometric=5)
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2888
            "/ 'ink set' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2889
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2890
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2891
        (tagType == 333) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2892
            "/ InkNames (used with Photometric=5)
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2893
            "/ 'ink names' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2894
            metaData at:#IncNames put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2895
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2896
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2897
        (tagType == 334) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2898
            "/ NumberOfInks (used with Photometric=5)
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2899
            "/ 'numinks' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2900
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2901
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2902
        (tagType == 336) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2903
            "/ 'dot range' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2904
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2905
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2906
        (tagType == 337) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2907
            "/ 'target printer' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2908
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2909
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2910
        (tagType == 338) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2911
            "/ 'extrasamples' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2912
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2913
                Logger info:'      extrasamples: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2914
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2915
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2916
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2917
        (tagType == 339) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2918
            "/ 'sample format' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2919
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2920
                Logger info:'      sample format: %1 (=%2)' 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2921
                            with:value 
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  2922
                            with:(#( uint int float undef complexInt complexFlt) at:value ifAbsent:'???')
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2923
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2924
            sampleFormat := value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2925
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2926
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2927
        (tagType == 340) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2928
            "/ 'min sample value' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2929
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2930
                Logger info:'      min sample value: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2931
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2932
            minSampleValue := value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2933
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2934
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2935
        (tagType == 341) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2936
            "/ 'max sample value' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2937
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2938
                Logger info:'      max sample value: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2939
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2940
            maxSampleValue := value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2941
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2942
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2943
        (tagType == 342) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2944
            "/ 'transfer range' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2945
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2946
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2947
        (tagType == 343) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2948
            "/ 'clip path' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2949
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2950
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2951
        (tagType == 344) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2952
            "/ 'xclip path units' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2953
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2954
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2955
        (tagType == 345) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2956
            "/ 'yclip path units' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2957
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2958
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2959
        (tagType == 346) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2960
            "/ 'indexed' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2961
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2962
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2963
        (tagType == 347) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2964
            "/ 'jpegtables' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2965
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2966
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2967
        (tagType == 351) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2968
            "/ opiproxy
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2969
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2970
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2971
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2972
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2973
    (tagType between:400 and:499) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2974
        (tagType == 400) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2975
            "/ 'GlobalParametersIFD (TIFF-FX)' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2976
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2977
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2978
        (tagType == 401) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2979
            "/ 'ProfileType (TIFF-FX)' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2980
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2981
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2982
        (tagType == 402) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2983
            "/ 'FaxProfile (TIFF-FX)' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2984
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2985
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2986
        (tagType == 403) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2987
            "/ 'CodingMethods (TIFF-FX)' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2988
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2989
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2990
        (tagType == 404) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2991
            "/ 'VersionYear (TIFF-FX)' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2992
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2993
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2994
        (tagType == 405) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2995
            "/ 'ModeNumber (TIFF-FX)' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2996
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2997
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2998
        (tagType == 433) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  2999
            "/ 'Decode' print (TIFF-FX). value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3000
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3001
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3002
        (tagType == 434) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3003
            "/ 'DefaultImageColor' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3004
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3005
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3006
        (tagType == 435) ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3007
            "/ 'T82Options' print. value printNewline.
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3008
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3009
        ].
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3010
        (tagType == 437 "0x1b5") ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3011
            "/ 'JPEGTables' print. value printNewline.
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3012
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3013
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3014
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3015
    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3016
    (tagType between:500 and:599) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3017
        "/ obsolete JPEG tags
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3018
        (tagType == 512) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3019
            "/ 'jpeg proc' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3020
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3021
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3022
        (tagType == 513) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3023
            "/ 'thumbnailoffset' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3024
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3025
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3026
        (tagType == 514) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3027
            "/ 'thumbaillength' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3028
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3029
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3030
        (tagType == 515) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3031
            "/ 'jpeg restartInterval' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3032
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3033
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3034
        (tagType == 517) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3035
            "/ 'jpeg glossLessPredictors' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3036
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3037
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3038
        (tagType == 518) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3039
            "/ 'jpeg pointTransform' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3040
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3041
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3042
        (tagType == 519) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3043
            "/ 'jpeg qTables' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3044
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3045
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3046
        (tagType == 520) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3047
            "/ 'jpeg dcTables' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3048
             ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3049
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3050
        (tagType == 521) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3051
            "/ 'jpeg acTables' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3052
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3053
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3054
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3055
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3056
        (tagType == 529) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3057
            "/ ycbr coeff
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3058
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3059
                Logger info:'      ycbr coeff: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3060
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3061
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3062
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3063
        (tagType == 530) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3064
            "/ ycbr subsampling
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3065
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3066
                Logger info:'      ycbr subsampling: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3067
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3068
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3069
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3070
        (tagType == 531) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3071
            "/ ycbr positioning
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3072
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3073
                Logger info:'      ycbr positioning: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3074
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3075
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3076
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3077
        (tagType == 532) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3078
            "/ referenceBlackWhite
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3079
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3080
                Logger info:'      referenceBlackWhite: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3081
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3082
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3083
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3084
        (tagType == 559) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3085
            "/ stripRowCounts
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3086
            "/ Defined in the Mixed Raster Content part of RFC 2301, 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3087
            "/ used to replace RowsPerStrip for IFDs with variable-sized strips.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3088
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3089
                Logger info:'      stripRowCounts: %1' with:valueArray 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3090
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3091
            stripRowCounts := valueArray.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3092
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3093
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3094
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3095
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3096
    (tagType between:700 and:799) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3097
        (tagType == 700) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3098
            "applicationNores / XMP metadata (xml)"
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3099
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3100
            "/ In TIFF files, the XML Packet containing XMP metadata is pointed to
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3101
            "/ by an entry in the Image File Directory (IFD). That entry has a Tag
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3102
            "/ value of 700, as shown in Table 1.1, "TIFF IFD Directory Entry for
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3103
            "/ XML Packets
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3104
            
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3105
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3106
                Logger info:'      XMLPACKET: %1' with:value asString
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3107
            ].
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3108
            decodeMetaTags == true ifTrue:[
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3109
                metaData at:#xmpData put:value asString.
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3110
            ].    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3111
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3112
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3113
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3114
    
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3115
    (tagType between:18000 and:18999) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3116
        (tagType == 18246 "0x4746") ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3117
            "/ Image Rating by windows
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3118
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3119
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3120
        (tagType == 18248 "0x4748") ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3121
            "/ stitchInfo by windows
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3122
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3123
        ].
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3124
        (tagType == 18249 "0x4749") ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3125
            "/ Image Rating Percent by windows
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3126
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3127
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3128
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3129
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3130
    (tagType between:0x7000 and:0x74c8) ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3131
        "/ SONY stuff
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3132
        (tagType == 0x7000) ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3133
            "/ SonyRawFileType
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3134
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3135
        ].
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3136
        (tagType == 0x7010) ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3137
            "/ SonyToneCurve
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3138
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3139
        ].
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3140
    ].
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3141
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3142
    (tagType between:32000 "0x7D00" and:32999 "0x80E7") ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3143
        (tagType == 32781 "0x800D") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3144
            "/'imageid' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3145
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3146
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3147
        (tagType == 32932) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3148
            "/'wang annotation' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3149
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3150
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3151
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3152
        "/ Private Island graphics tags
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3153
        (tagType == 32953) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3154
            "/'ref points' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3155
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3156
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3157
        (tagType == 32954) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3158
            "/ 'regionTagPoint' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3159
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3160
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3161
        (tagType == 32955) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3162
            "/ 'regionWarpCorners' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3163
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3164
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3165
        (tagType == 32956) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3166
            "/ 'regionAffine' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3167
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3168
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3169
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3170
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3171
        "/ Private SGI tags
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3172
        (tagType == 32995) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3173
            "/ 'matteing' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3174
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3175
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3176
        
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3177
        (tagType == 32996) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3178
            "/ datatype
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3179
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3180
                Logger info:'      datatype: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3181
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3182
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3183
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3184
        (tagType == 32997) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3185
            "/ imagedepth
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3186
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3187
                Logger info:'      imagedepth: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3188
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3189
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3190
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3191
        (tagType == 32998) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3192
            "/ tiledepth
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3193
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3194
                Logger info:'      tiledepth: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3195
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3196
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3197
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3198
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3199
    
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3200
    (tagType between:33000 "16r80E8" and:33999 "16r84CF") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3201
        "/ Private Pixar tags
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3202
        (tagType == 33300) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3203
            "/ 'image full width' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3204
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3205
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3206
        (tagType == 33301) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3207
            "/ 'image full length' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3208
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3209
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3210
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3211
        "/ Private Eastman Kodak tags
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3212
        (tagType == 33405) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3213
            "/ 'write serial number' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3214
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3215
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3216
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3217
        (tagType == 33421) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3218
            "/ CFARepeatPatternDim - For camera raw files from sensors with CFA overlay
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3219
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3220
                Logger info:'      CFARepeatPatternDim: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3221
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3222
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3223
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3224
        (tagType == 33422) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3225
            "/ CFAPattern - For camera raw files from sensors with CFA overlay
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3226
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3227
                Logger info:'      CFAPattern: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3228
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3229
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3230
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3231
        (tagType == 33423) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3232
            "/ BatteryLevel - Encodes camera battery level at time of image capture
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3233
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3234
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3235
        (tagType == 33424) ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3236
            "/ KodakIFD
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3237
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3238
        ].
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3239
        (tagType == 33432 "16r8298") ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3240
            "/ 'copyright' print. value printNewline.
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3241
            metaData at:#Copyright put:value asString.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3242
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3243
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3244
        (tagType == 33434 "0x829A") ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3245
            "/ 'exposuretime' print. value printNewline.
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3246
            metaData at:#ExposureTime put:value.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3247
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3248
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3249
        (tagType == 33437 "0x829D") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3250
            "/ 'FNumber' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3251
            metaData at:#FNumber put:value.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3252
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3253
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3254
        (tagType == 33445 "0x82A5") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3255
            "/ 'molecular dynamics GEL file tag' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3256
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3257
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3258
        (tagType == 33446 "0x82A6") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3259
            "/ 'molecular dynamics GEL scalePixel' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3260
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3261
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3262
        (tagType == 33447 "0x82A7") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3263
            "/ 'molecular dynamics GEL colorTable' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3264
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3265
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3266
        (tagType == 33448 "0x82A8") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3267
            "/ 'molecular dynamics GEL labName' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3268
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3269
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3270
        (tagType == 33449 "0x82A9") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3271
            "/ 'molecular dynamics GEL sampleInfo' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3272
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3273
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3274
        (tagType == 33450 "0x82AA") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3275
            "/ 'molecular dynamics GEL prepDate' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3276
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3277
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3278
        (tagType == 33451 "0x82AB") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3279
            "/ 'molecular dynamics GEL prepTime' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3280
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3281
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3282
        (tagType == 33452 "0x82AC") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3283
            "/ 'molecular dynamics GEL fileUnits' print. value printNewline.
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3284
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3285
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3286
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3287
        (tagType == 33550) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3288
            "/ 'geotiff modelpixelscaletag' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3289
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3290
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3291
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3292
        (tagType == 33723) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3293
            "/ 'RICHTIFFIPTC' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3294
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3295
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3296
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3297
        "/ (tagType == 33918) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3298
        "/     "/ 'intergraph packet data tag' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3299
        "/     ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3300
        "/ ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3301
        "/ (tagType == 33918) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3302
        "/     "/ 'intergraph flag' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3303
        "/     ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3304
        "/ ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3305
        "/ (tagType == 33920) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3306
        "/     "/ 'geotiff IntergraphMatrixTag' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3307
        "/     ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3308
        "/ ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3309
        (tagType == 33922) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3310
            "/ 'geotiff ModelTiepointTag' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3311
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3312
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3313
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3314
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3315
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3316
    (tagType between:34000 and:34999) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3317
        (tagType == 34016) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3318
            "/ Site
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3319
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3320
                Logger info:'      site: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3321
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3322
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3323
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3324
        (tagType == 34017) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3325
            "/ colorSequence
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3326
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3327
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3328
        (tagType == 34018) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3329
            "/ it8header
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3330
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3331
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3332
        (tagType == 34019) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3333
            "/ rasterPadding
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3334
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3335
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3336
        (tagType == 34020) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3337
            "/ bitsPerRunLength
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3338
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3339
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3340
        (tagType == 34021) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3341
            "/ bitsPerExtendedRunLength
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3342
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3343
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3344
        (tagType == 34022) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3345
            "/ colorTable
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3346
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3347
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3348
        (tagType == 34023) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3349
            "/ imageColorIndicator
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3350
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3351
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3352
        (tagType == 34024) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3353
            "/ backgroundColorIndicator
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3354
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3355
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3356
        (tagType == 34025) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3357
            "/ imageColorValue
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3358
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3359
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3360
        (tagType == 34026) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3361
            "/ backgroundColorValue
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3362
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3363
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3364
        (tagType == 34027) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3365
            "/ pixelIntensityRange
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3366
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3367
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3368
        (tagType == 34028) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3369
            "/ transparencyIndicator
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3370
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3371
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3372
        (tagType == 34029) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3373
            "/ colorCharacterization
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3374
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3375
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3376
        (tagType == 34030) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3377
            "/ hcUsage
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3378
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3379
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3380
        (tagType == 34031) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3381
            "/ trapIndicator
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3382
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3383
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3384
        (tagType == 34032) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3385
            "/ cmykEquivalent
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3386
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3387
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3388
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3389
        "/ Private Pixel magic
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3390
        (tagType == 34232) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3391
            "/ 'jbig options' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3392
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3393
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3394
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3395
        (tagType == 34264) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3396
            "/ 'geotiff ModelTransformationTag' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3397
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3398
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3399
        "/ private Photoshop
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3400
        (tagType == 34377) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3401
            "/ RICHTIFFIPTC
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3402
            "/ IPTC (International Press Telecommunications Council) metadata.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3403
            "/ (see http://www.iptc.org/std/photometadata/specification/IPTC-PhotoMetadata)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3404
            decodeMetaTags == true ifTrue:[
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3405
                Verbose == true ifTrue:[ 
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3406
                    Logger info:'      RICHTIFFIPTC: %1' with:value
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3407
                ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3408
                self decodePhotoshopImageResourceBlock:value.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3409
            ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3410
                Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3411
                    Logger info:'      skipped decoding of IPTC-PhotoMetadata'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3412
                ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3413
            ].    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3414
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3415
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3416
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3417
        (tagType == 34665) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3418
            "/ EXIFIFD
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3419
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3420
                Logger info:'      EXIFIFD: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3421
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3422
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3423
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3424
        (tagType == 34675) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3425
            "/ 'ICCPROFILE' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3426
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3427
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3428
        
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3429
        (tagType == 34732) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3430
            "/ 'ImageLayer' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3431
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3432
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3433
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3434
        (tagType == 34735) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3435
            "/ 'geotiff GeoKeyDirectoryTag' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3436
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3437
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3438
        (tagType == 34736) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3439
            "/ 'geotiff GeoDoubleParamsTag' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3440
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3441
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3442
        (tagType == 34737) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3443
            "/ 'geotiff GeoAsciiParamsTag' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3444
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3445
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3446
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3447
        (tagType == 34850) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3448
            "/ 'ExposureProgram' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3449
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3450
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3451
        (tagType == 34852) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3452
            "/ 'SpectralSensitivity' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3453
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3454
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3455
        (tagType == 34853) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3456
            "/ 'GPS Info' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3457
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3458
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3459
        (tagType == 34855) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3460
            "/ 'ISOSPeedRatings (ISO12232)' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3461
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3462
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3463
        
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3464
        (tagType == 34858) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3465
            "/ 'TimeZoneOffset' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3466
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3467
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3468
        (tagType == 34859) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3469
            "/ 'SelfTimeMode' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3470
            "/ Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3471
            "/     Logger info:'      ?: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3472
            "/ ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3473
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3474
        ].
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3475
        (tagType == 34864) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3476
            "/ 'SensitivityType' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3477
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3478
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3479
        (tagType == 34867) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3480
            "/ 'ISOSpeed' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3481
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3482
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3483
        
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3484
        "/ More Private SGI
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3485
        (tagType == 34908) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3486
            "/ 'HylaFAX fax recv params' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3487
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3488
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3489
        (tagType == 34909) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3490
            "/ 'HylaFAX fax subaddress' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3491
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3492
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3493
        (tagType == 34910) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3494
            "/ 'HylaFAX fax recv time' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3495
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3496
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3497
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3498
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3499
    (tagType between:36000 and:36999) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3500
        (tagType == 36864 "0x9000") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3501
            "/ 'ExifVersion' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3502
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3503
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3504
        (tagType == 36867 "0x9003") ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3505
            "/ 'dateTimeOriginal' print. value printNewline.
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3506
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3507
        ].
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3508
        (tagType == 36868 "0x9004") ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3509
            "/ 'dateTimeDigitized / createDate' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3510
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3511
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3512
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3513
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3514
    (tagType between:37000 and:37999) ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3515
        (tagType == 37377 "0x9201") ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3516
            "/ 'ShutterSpeedValue' print. value printNewline.
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3517
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3518
        ].
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3519
        (tagType == 37378 "0x9202") ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3520
            "/ 'ApertureValue' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3521
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3522
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3523
        (tagType == 37379 "0x9203") ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3524
            "/ 'BrightnessValue' print. value printNewline.
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3525
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3526
        ].
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3527
        (tagType == 37382 "0x9206") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3528
            "/ 'SubjectDistance' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3529
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3530
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3531
        (tagType == 37383 "0x9207") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3532
            "/ 'MeteringMode' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3533
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3534
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3535
        (tagType == 37384 "0x9208") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3536
            "/ 'LightSource' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3537
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3538
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3539
        (tagType == 37385 "0x9209") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3540
            "/ 'Flash' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3541
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3542
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3543
        (tagType == 37386 "0x920a") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3544
            "/ 'FocalLength' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3545
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3546
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3547
        (tagType == 37387 "0x920b") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3548
            "/ 'FlashEnergy' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3549
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3550
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3551
        (tagType == 37390 "0x920e") ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3552
            "/ 'FocalPlaneXResolution' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3553
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3554
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3555
        (tagType == 37391 "0x920f") ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3556
            "/ 'FocalPlaneYResolution' print. value printNewline.
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3557
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3558
        ].
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3559
        (tagType == 37392 "0x9210") ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3560
            "/ 'FocalPlaneResolutionUnit' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3561
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3562
        ].
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3563
        (tagType == 37393 "0x9211") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3564
            "/ 'ImageNumber' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3565
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3566
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3567
        (tagType == 37394 "0x9212") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3568
            "/ 'SecurityClassification' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3569
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3570
        ].
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3571
        (tagType == 37398 "0x9216") ifTrue:[
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3572
            "/ 'TIFF-EPStandardID' print. value printNewline.
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3573
            ^ self
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3574
        ].
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3575
        (tagType == 37500 "0x927C") ifTrue:[
4425
61632e2b1593 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 4375
diff changeset
  3576
            "/ 'makerNote' print. value printNewline.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3577
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3578
        ].
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3579
        (tagType == 37510 "0x9286") ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3580
            "/ 'UserComment' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3581
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3582
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3583
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3584
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3585
    (tagType between:42000 and:42999) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3586
        (tagType == 42032) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3587
            "/ 'CameraOwnerName' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3588
            Verbose == true ifTrue:[ 
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3589
                Logger info:'      CameraOwnerName: %1' with:value
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3590
            ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3591
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3592
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3593
        (tagType == 42033) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3594
            "/ 'BodySerialNumber' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3595
            Verbose == true ifTrue:[ 
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3596
                Logger info:'      BodySerialNumber: %1' with:value
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3597
            ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3598
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3599
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3600
        (tagType == 42034) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3601
            "/ 'LensSpecification' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3602
            "/ Verbose == true ifTrue:[ 
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3603
            "/     Logger info:'      LensSpecification: %1' with:value
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3604
            "/ ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3605
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3606
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3607
        (tagType == 42035) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3608
            "/ 'LensMake' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3609
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3610
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3611
        (tagType == 42036) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3612
            "/ 'LensModel' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3613
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3614
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3615
        (tagType == 42037) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3616
            "/ 'LensSerialNumber' print. value printNewline.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3617
            Verbose == true ifTrue:[ 
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3618
                Logger info:'      LensSerialNumber: %1' with:value
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3619
            ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3620
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3621
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3622
        (tagType == 42112) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3623
            "/ 'GDAL_METADATA' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3624
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3625
                Logger info:'      GDAL_METADATA: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3626
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3627
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3628
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3629
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3630
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3631
    "/ dng tags (see http://wwwimages.adobe.com/content/dam/Adobe/en/products/photoshop/pdfs/dng_spec_1.4.0.0.pdf)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3632
    (tagType between:50000 and:50999) ifTrue:[
4426
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3633
        (tagType == 50215) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3634
            "/ OCE Scanjob Descr.
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3635
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3636
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3637
        (tagType == 50216) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3638
            "/ OCE Appl Selector
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3639
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3640
        ].
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3641
        (tagType == 50217) ifTrue:[
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3642
            "/ OCE Identification Number
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3643
            ^ self
b99d80e74d2a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 4425
diff changeset
  3644
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3645
        (tagType == 50706) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3646
            "/ DNGVersion
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3647
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3648
                Logger info:'      DNGVersion: %1' with:value
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3649
            ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3650
            isDNGImage := true.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3651
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3652
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3653
        (tagType == 50707) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3654
            "/ DNGBackwardVersion
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3655
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3656
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3657
        (tagType == 50708) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3658
            "/ UniqueCameraModel
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3659
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3660
                Logger info:'      UniqueCameraModel: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3661
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3662
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3663
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3664
        (tagType == 50709) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3665
            "/ LocalizedCameraModel
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3666
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3667
                Logger info:'      LocalizedCameraModel: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3668
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3669
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3670
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3671
        (tagType == 50710) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3672
            "/ 'CFAPlaneColor' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3673
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3674
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3675
        (tagType == 50711) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3676
            "/ 'CFALayout' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3677
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3678
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3679
        (tagType == 50712) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3680
            "/ 'LinearizationTable' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3681
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3682
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3683
        (tagType == 50713) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3684
            "/ 'BlackLevelRepeatDim' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3685
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3686
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3687
        (tagType == 50714) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3688
            "/ 'BlackLevel' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3689
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3690
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3691
        (tagType == 50715) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3692
            "/ 'BlackLevelDeltaH' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3693
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3694
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3695
        (tagType == 50716) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3696
            "/ 'BlackLevelDeltaV' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3697
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3698
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3699
        (tagType == 50717) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3700
            "/ 'WhiteLevel' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3701
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3702
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3703
        (tagType == 50718) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3704
            "/ 'DefaultScale' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3705
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3706
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3707
        (tagType == 50719) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3708
            "/ 'DefaultCropOrigin' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3709
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3710
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3711
        (tagType == 50720) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3712
            "/ 'DefaultCropSize' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3713
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3714
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3715
        (tagType == 50721) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3716
            "/ 'ColorMatrix1' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3717
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3718
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3719
        (tagType == 50722) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3720
            "/ 'ColorMatrix2' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3721
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3722
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3723
        (tagType == 50723) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3724
            "/ 'CameraCalibrarion1' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3725
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3726
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3727
        (tagType == 50724) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3728
            "/ 'CameraCalibrarion2' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3729
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3730
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3731
        (tagType == 50725) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3732
            "/ 'ReductionMatrix1' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3733
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3734
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3735
        (tagType == 50726) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3736
            "/ 'ReductionMatrix2' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3737
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3738
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3739
        (tagType == 50727) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3740
            "/ 'AnalogBalance' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3741
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3742
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3743
        (tagType == 50728) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3744
            "/ 'AsShotNeutral' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3745
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3746
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3747
        (tagType == 50729) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3748
            "/ 'AsShotWhiteXY' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3749
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3750
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3751
        (tagType == 50730) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3752
            "/ 'BaselineExposure' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3753
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3754
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3755
        (tagType == 50731) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3756
            "/ 'BaselineNoise' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3757
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3758
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3759
        (tagType == 50732) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3760
            "/ 'BaselineSharpness' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3761
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3762
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3763
        (tagType == 50733) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3764
            "/ 'ByerGreenSplit' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3765
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3766
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3767
        (tagType == 50734) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3768
            "/ 'LinearResponseLimit' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3769
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3770
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3771
        (tagType == 50735) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3772
            "/ 'CameraSerialNumber' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3773
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3774
                Logger info:'      CameraSerialNumber: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3775
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3776
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3777
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3778
        (tagType == 50736) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3779
            "/ 'LensInfo' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3780
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3781
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3782
        (tagType == 50737) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3783
            "/ 'ChromaBlurRadius' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3784
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3785
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3786
        (tagType == 50738) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3787
            "/ 'AntiAliasStrength' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3788
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3789
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3790
        (tagType == 50739) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3791
            "/ 'ShadowScale' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3792
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3793
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3794
        (tagType == 50740) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3795
            "/ 'DNGPrivateData' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3796
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3797
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3798
        (tagType == 50741) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3799
            "/ 'MakerNoteSafety' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3800
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3801
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3802
        
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3803
        (tagType == 50778) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3804
            "/ 'CalibrationIlluminant1' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3805
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3806
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3807
        (tagType == 50779) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3808
            "/ 'CalibrationIlluminant2' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3809
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3810
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3811
        (tagType == 50780) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3812
            "/ 'BestQualityScale' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3813
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3814
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3815
        (tagType == 50781) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3816
            "/ 'RawDataUniqueID' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3817
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3818
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3819
        
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3820
        (tagType == 50827) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3821
            "/ 'OriginalRawFileName' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3822
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3823
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3824
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3825
    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3826
"/
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3827
"/ 'TIFFReader: tag:' print. tagType print. ' typ:' print. numberType print.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3828
"/ ' len:' print. length print. ' offs:' print. offset print. 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3829
"/ ' val:' print. value print. ' valArr:' print. valueArray printNewline.  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3830
"/
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3831
    'TIFFReader [warning]: unknown tag type ' errorPrint. tagType errorPrintCR
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3832
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3833
    "Modified (format): / 23-05-2017 / 16:12:58 / mawalch"
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  3834
    "Modified: / 28-08-2017 / 00:48:37 / cg"
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3835
!
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3836
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  3837
positionToStrip:stripNr
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3838
    inStream position:(stripOffsets at:stripNr).
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  3839
!
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  3840
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3841
positionToTile:tileNr
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3842
    inStream position:((metaData at:#'TileOffsets') at:tileNr).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3843
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3844
    "Created: / 25-08-2017 / 13:43:30 / cg"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3845
!
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3846
1838
2476baed377c make it compilable with old stc's, which do not care for the signed keyword.
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  3847
readBytes:n signed:isSigned
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3848
    "read n 8bit signed or unsigned integers and return them in an array or byteArray"
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3849
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3850
    |oldPos offset bytes nInline|
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3851
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3852
    nInline := isBigTiff ifTrue:[8] ifFalse:[4].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3853
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3854
    n == 0 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3855
        "/ even in this case, one WORD is to be skipped.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3856
        inStream skip:nInline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3857
        ^ ''
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3858
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3859
1838
2476baed377c make it compilable with old stc's, which do not care for the signed keyword.
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  3860
    bytes := (isSigned ifTrue:[Array] ifFalse:[ByteArray]) new:n.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3861
    (n <= nInline) ifTrue:[
1838
2476baed377c make it compilable with old stc's, which do not care for the signed keyword.
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  3862
        isSigned ifTrue:[
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3863
            1 to:n do:[:i | bytes at:i put:(inStream nextSignedByte) ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3864
        ] ifFalse:[
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3865
            inStream nextBytes:n into:bytes.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3866
        ].
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3867
        (n < nInline) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3868
            inStream skip:(nInline - n).
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3869
        ]
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3870
    ] ifFalse:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3871
        offset := inStream nextInt32MSB:(byteOrder ~~ #lsb).
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3872
        oldPos := inStream position.
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3873
        inStream position:offset.
1838
2476baed377c make it compilable with old stc's, which do not care for the signed keyword.
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  3874
        isSigned ifTrue:[
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3875
            1 to:n do:[:i | bytes at:i put:(inStream nextSignedByte) ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3876
        ] ifFalse:[
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3877
            inStream nextBytes:n into:bytes.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3878
        ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3879
        inStream position:oldPos
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3880
    ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3881
    ^ bytes
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3882
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3883
    "Modified: / 27-08-2017 / 19:56:23 / cg"
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3884
!
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3885
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3886
readChars:n
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3887
    "read n characters and return them in a string"
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3888
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3889
    |oldPos offset string nInline|
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3890
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3891
    nInline := isBigTiff ifTrue:[8] ifFalse:[4].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3892
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3893
    n == 0 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3894
        "/ even in this case, one WORD is to be skipped.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3895
        inStream skip:nInline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3896
        ^ ''
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3897
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3898
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3899
    string := String new:(n - 1).
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3900
    (n <= nInline) ifTrue:[
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3901
        inStream nextBytes:(n - 1) into:string.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3902
        inStream next. "/ skip the 0-byte.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3903
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3904
        (n < nInline) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3905
            inStream skip:(nInline - n).
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3906
        ]
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3907
    ] ifFalse:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3908
        offset := inStream nextInt32MSB:(byteOrder == #msb).
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3909
        oldPos := inStream position.
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3910
        inStream position:offset.
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3911
        inStream nextBytes:(n - 1) into:string.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3912
        inStream position:oldPos
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3913
    ].
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3914
    ^ string
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3915
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3916
    "Modified: / 27-08-2017 / 19:55:15 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3917
!
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3918
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3919
readDoubles:nFloats
3112
d6fbee4954ca class: TIFFReader
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  3920
    "read nFloats IEEE 64bit doubles and return them in an array"
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3921
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3922
    |oldPos offset values val msb 
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3923
     n "{ Class: SmallInteger }" |
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3924
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3925
    n := nFloats.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3926
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3927
    msb := byteOrder ~~ #lsb.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3928
    values := DoubleArray basicNew:n.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3929
    (n == 1) ifTrue:[
3112
d6fbee4954ca class: TIFFReader
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  3930
        val := Float readBinaryIEEEDoubleFrom:inStream MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3931
        values at:1 put:val.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3932
    ] ifFalse:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3933
        offset := inStream nextInt32MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3934
        oldPos := inStream position.
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3935
        inStream position:offset.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3936
        1 to:n do:[:index |
3112
d6fbee4954ca class: TIFFReader
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  3937
            val := Float readBinaryIEEEDoubleFrom:inStream MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3938
            values at:index put:val
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3939
        ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3940
        inStream position:oldPos
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3941
    ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3942
    ^ values
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3943
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3944
    "Modified: / 24-08-2017 / 23:28:22 / cg"
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3945
!
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3946
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3947
readFloats:nFloats
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3948
    "read nFloats IEEE 32bit floats and return them in an array"
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3949
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3950
    |oldPos offset values val val1 val2 msb 
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3951
     n "{ Class: SmallInteger }" |
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3952
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3953
    n := nFloats.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3954
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3955
    msb := byteOrder ~~ #lsb.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3956
    values := FloatArray basicNew:n.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3957
    (isBigTiff and:[ n == 2 ]) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3958
        val1 := ShortFloat readBinaryIEEESingleFrom:inStream MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3959
        val2 := ShortFloat readBinaryIEEESingleFrom:inStream MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3960
        values at:1 put:val1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3961
        n == 2 ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3962
            values at:2 put:val2.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3963
        ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3964
    ] ifFalse:[    
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3965
        (n == 1) ifTrue:[
3112
d6fbee4954ca class: TIFFReader
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  3966
            val := ShortFloat readBinaryIEEESingleFrom:inStream MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3967
            values at:1 put:val.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3968
        ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3969
            offset := inStream nextInt32MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3970
            oldPos := inStream position.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3971
            inStream position:offset.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3972
            1 to:n do:[:index |
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3973
                val := ShortFloat readBinaryIEEESingleFrom:inStream MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3974
                values at:index put:val
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3975
            ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3976
            inStream position:oldPos
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3977
        ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3978
    ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3979
    ^ values
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3980
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3981
    "Modified: / 24-08-2017 / 23:36:39 / cg"
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3982
!
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3983
1838
2476baed377c make it compilable with old stc's, which do not care for the signed keyword.
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  3984
readFracts:nFracts signed:isSigned
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3985
    "read nFracts fractions (2 32bit words) and return them in an array"
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3986
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3987
    |oldPos offset values numerator denominator msb
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3988
     n "{ Class: SmallInteger }" |
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3989
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3990
    n := nFracts.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3991
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3992
    msb := byteOrder ~~ #lsb.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3993
    values := Array basicNew:n.
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3994
    offset := inStream nextInt32MSB:msb.
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3995
    oldPos := inStream position.
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3996
    inStream position:offset.
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3997
    1 to:n do:[:index |
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3998
        numerator := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3999
        denominator := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  4000
        values at:index put:(Fraction numerator:numerator denominator:denominator)
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4001
    ].
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4002
    inStream position:oldPos.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4003
    ^ values
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4004
!
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4005
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4006
readLong8s:nLongs signed:isSigned
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4007
    "read nLongs signed or unsigned long8 numbers (64bit) and return them in an array"
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4008
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4009
    |oldPos offset values val msb 
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4010
     n "{ Class: SmallInteger }" |
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4011
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4012
    n := nLongs.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4013
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4014
    msb := byteOrder ~~ #lsb.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4015
    values := Array basicNew:n.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4016
    (n == 1) ifTrue:[
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4017
        val := isSigned ifTrue:[inStream nextInt64MSB:msb] ifFalse:[inStream nextUnsignedInt64MSB:msb].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4018
        values at:1 put:val.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4019
    ] ifFalse:[
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4020
        offset := inStream nextInt64MSB:msb.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4021
        oldPos := inStream position.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4022
        inStream position:offset.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4023
        1 to:n do:[:index |
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4024
            val := isSigned ifTrue:[inStream nextInt64MSB:msb] ifFalse:[inStream nextUnsignedInt64MSB:msb].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4025
            values at:index put:val
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4026
        ].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4027
        inStream position:oldPos
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4028
    ].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4029
    ^ values
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4030
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4031
    "Created: / 24-08-2017 / 22:01:26 / cg"
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4032
!
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4033
1838
2476baed377c make it compilable with old stc's, which do not care for the signed keyword.
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  4034
readLongs:nLongs signed:isSigned
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  4035
    "read nLongs signed or unsigned long numbers (32bit) and return them in an array"
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  4036
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4037
    |oldPos offset values val val1 val2 msb 
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4038
     n "{ Class: SmallInteger }" |
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4039
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4040
    n := nLongs.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4041
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4042
    msb := byteOrder ~~ #lsb.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4043
    values := Array basicNew:n.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4044
    (isBigTiff and:[ n <= 2 ]) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4045
        val1 := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4046
        val2 := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4047
        values at:1 put:val1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4048
        n == 2 ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4049
            values at:2 put:val2.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4050
        ].
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4051
    ] ifFalse:[
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4052
        (n == 1) ifTrue:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  4053
            val := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4054
            values at:1 put:val.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4055
        ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4056
            offset := inStream nextInt32MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4057
            oldPos := inStream position.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4058
            inStream position:offset.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4059
            1 to:n do:[:index |
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4060
                val := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4061
                values at:index put:val
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4062
            ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4063
            inStream position:oldPos
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  4064
        ].
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4065
    ].
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4066
    ^ values
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4067
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4068
    "Modified: / 24-08-2017 / 23:35:38 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4069
!
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4070
1838
2476baed377c make it compilable with old stc's, which do not care for the signed keyword.
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  4071
readShorts:nShorts signed:isSigned
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  4072
    "read nShorts signed or unsigned short numbers (16bit) and return them in an array"
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  4073
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4074
    |oldPos offset values msb val1 val2 val3 val4
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4075
     n "{ Class: SmallInteger }" |
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4076
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4077
    n := nShorts.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4078
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4079
    msb := (byteOrder ~~ #lsb).
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4080
    values := Array basicNew:n.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4081
    (isBigTiff and:[ (n <= 4) ]) ifTrue:[ 
1838
2476baed377c make it compilable with old stc's, which do not care for the signed keyword.
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  4082
        isSigned ifTrue:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  4083
            val1 := inStream nextInt16MSB:msb.
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  4084
            val2 := inStream nextInt16MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4085
            val3 := inStream nextInt16MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4086
            val4 := inStream nextInt16MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  4087
        ] ifFalse:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  4088
            val1 := inStream nextUnsignedInt16MSB:msb.
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  4089
            val2 := inStream nextUnsignedInt16MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4090
            val3 := inStream nextUnsignedInt16MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4091
            val4 := inStream nextUnsignedInt16MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  4092
        ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  4093
        values at:1 put:val1.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4094
        (n >= 2) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4095
            values at:2 put:val2.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4096
            (n >= 3) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4097
                values at:3 put:val3.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4098
                (n == 4) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4099
                    values at:4 put:val4.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4100
                ]
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4101
            ]
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  4102
        ]
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4103
    ] ifFalse:[
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4104
        (n <= 2) ifTrue:[
1838
2476baed377c make it compilable with old stc's, which do not care for the signed keyword.
Claus Gittinger <cg@exept.de>
parents: 1830
diff changeset
  4105
            isSigned ifTrue:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  4106
                val1 := inStream nextInt16MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4107
                val2 := inStream nextInt16MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  4108
            ] ifFalse:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  4109
                val1 := inStream nextUnsignedInt16MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4110
                val2 := inStream nextUnsignedInt16MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  4111
            ].
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4112
            values at:1 put:val1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4113
            (n == 2) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4114
                values at:2 put:val2
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4115
            ]
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4116
        ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4117
            offset := inStream nextInt32MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4118
            oldPos := inStream position.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4119
            inStream position:offset.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4120
            1 to:n do:[:index |
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4121
                isSigned ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4122
                    val1 := inStream nextInt16MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4123
                ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4124
                    val1 := inStream nextUnsignedInt16MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4125
                ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4126
                values at:index put:val1
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4127
            ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4128
            inStream position:oldPos
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  4129
        ].
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4130
    ].
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4131
    ^ values
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4132
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4133
    "Modified: / 24-08-2017 / 23:33:09 / cg"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4134
!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4135
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4136
readSingleTagFrom:aStream
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4137
    |msb tagType numberType length|
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4138
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4139
    msb := (byteOrder == #msb).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4140
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4141
    tagType := aStream nextUnsignedInt16MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4142
    numberType := aStream nextUnsignedInt16MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4143
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4144
    isBigTiff ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4145
        length := aStream nextInt32MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4146
    ] ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4147
        length := aStream nextInt64MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4148
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4149
    self decodeTiffTag:tagType numberType:numberType length:length.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4150
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4151
    "Created: / 26-08-2017 / 11:04:50 / cg"
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4152
    "Modified: / 17-09-2017 / 13:06:32 / cg"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4153
!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4154
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4155
readTagsFrom:aStream
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4156
    |numberOfTags msb|
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4157
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4158
    msb := (byteOrder == #msb).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4159
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4160
    isBigTiff ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4161
        numberOfTags := aStream nextUnsignedInt16MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4162
    ] ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4163
        numberOfTags := aStream nextUnsignedInt64MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4164
    ].
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4165
    numberOfTags isNil ifTrue:[
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4166
        "/ EOF
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4167
        ^ self
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4168
    ].
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4169
    
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4170
    1 to:numberOfTags do:[:index |
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4171
        self readSingleTagFrom:aStream.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4172
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4173
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4174
    "Created: / 26-08-2017 / 11:03:45 / cg"
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4175
    "Modified: / 17-09-2017 / 11:28:03 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4176
! !
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  4177
1762
55cf76514c8c method category rename
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  4178
!TIFFReader methodsFor:'private-writing'!
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4179
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4180
writeBitsPerSample
14
20638e830834 *** empty log message ***
claus
parents: 11
diff changeset
  4181
"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4182
'bitsPerSample: ' print. bitsPerSample printNewline.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4183
'store bitspersample at: ' print. outStream position printNewline.
14
20638e830834 *** empty log message ***
claus
parents: 11
diff changeset
  4184
"
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4185
    bitsPerSamplePos := outStream position.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4186
    bitsPerSample do:[:n |
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4187
        self writeShort:n
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4188
    ]
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4189
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  4190
3f9277473954 Initial revision
claus
parents:
diff changeset
  4191
writeColorMap
28
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
  4192
    |n|
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
  4193
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4194
    colorMapPos := outStream position.
35
f13cdd0b44c7 *** empty log message ***
claus
parents: 32
diff changeset
  4195
    #(red green blue) do:[:component |
440
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4196
        n := 0.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4197
        colorMap do:[:clr |
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4198
            |entry|
35
f13cdd0b44c7 *** empty log message ***
claus
parents: 32
diff changeset
  4199
440
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4200
            clr isNil ifTrue:[
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4201
                entry := 0
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4202
            ] ifFalse:[
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4203
                entry := clr perform:component.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4204
                "
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4205
                 tiff map is 16 bit - scale from percent to 0..16rFFFF
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4206
                "
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4207
                entry := (entry * 16rFFFF / 100) rounded.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4208
            ].
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4209
            self writeShort:entry.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4210
            n := n + 1
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4211
        ].
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4212
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4213
        "
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4214
         fill to 256 entries
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4215
        "
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4216
        [n < 256] whileTrue:[
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4217
            self writeShort:0.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4218
            n := n + 1.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4219
        ]
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4220
    ]
440
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4221
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  4222
    "Modified: 20.2.1997 / 18:06:10 / cg"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4223
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  4224
3f9277473954 Initial revision
claus
parents:
diff changeset
  4225
writeStripByteCounts
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
  4226
"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4227
'stripByteCounts: ' print. stripByteCounts printNewline.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4228
'store stripbytecounts at: ' print. outStream position printNewline.
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
  4229
"
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4230
    stripByteCountsPos := outStream position.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4231
    stripByteCounts do:[:c |
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4232
        self writeShort:c
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4233
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
  4234
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  4235
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4236
writeStripOffsets
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
  4237
"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4238
'stripOffsets: ' print. stripOffsets printNewline.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4239
'store stripoffsets at: ' print. outStream position printNewline.
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
  4240
"
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4241
    stripOffsetsPos := outStream position.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4242
    stripOffsets do:[:o |
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4243
        self writeLong:o
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4244
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
  4245
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  4246
3f9277473954 Initial revision
claus
parents:
diff changeset
  4247
writeTag:tagType
3f9277473954 Initial revision
claus
parents:
diff changeset
  4248
    self writeTiffTag:tagType.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4249
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  4250
3f9277473954 Initial revision
claus
parents:
diff changeset
  4251
writeTiffTag:tagType
3f9277473954 Initial revision
claus
parents:
diff changeset
  4252
    |value valueArray numberType count address|
3f9277473954 Initial revision
claus
parents:
diff changeset
  4253
3f9277473954 Initial revision
claus
parents:
diff changeset
  4254
    count := 1.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4255
    address := nil.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4256
    (tagType == 253) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4257
        "tiff class"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4258
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4259
    (tagType == 254) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4260
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4261
    (tagType == 255) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4262
        "SubfileType"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4263
        value := subFileType.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4264
        numberType := #long.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4265
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4266
    (tagType == 256) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4267
        "ImageWidth"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4268
        value := width.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4269
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4270
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4271
    (tagType == 257) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4272
        "ImageHeight"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4273
        value := height.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4274
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4275
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4276
    (tagType == 258) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4277
        "bitspersample"
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4278
        address := bitsPerSamplePos.
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4279
        numberType := #short.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4280
        count := bitsPerSample size.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4281
        valueArray := bitsPerSample
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4282
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4283
    (tagType == 259) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4284
        "compression"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4285
        value := compression.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4286
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4287
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4288
    (tagType == 262) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4289
        "photometric"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4290
        (photometric == #whiteIs0) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4291
            value := 0
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4292
        ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4293
            (photometric == #blackIs0) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4294
                value := 1
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4295
            ] ifFalse:[
4011
0dfddf756e27 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  4296
                ((photometric == #rgb) or:[(photometric == #rgba)]) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4297
                    value := 2
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4298
                ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4299
                    (photometric == #palette) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4300
                        value := 3
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4301
                    ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4302
                        (photometric == #transparency) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4303
                            value := 4
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4304
                        ] ifFalse:[
4011
0dfddf756e27 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  4305
                            self error:('TIFF-writer: unsupported photometric: ',photometric asString) mayProceed:true.
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4306
                        ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4307
                    ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4308
                ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4309
            ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4310
        ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4311
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4312
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4313
    (tagType == 263) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4314
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4315
    (tagType == 264) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4316
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4317
    (tagType == 265) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4318
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4319
    (tagType == 266) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4320
        "fillOrder"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4321
        (fillOrder == #msb) ifTrue:[
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4322
            value := FILLORDER_MSB2LSB
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4323
        ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4324
            (fillOrder == #lsb) ifTrue:[
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4325
                value := FILLORDER_LSB2MSB
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4326
            ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4327
                self error:'bad fillOrder' mayProceed:true
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4328
            ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4329
        ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4330
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4331
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4332
    (tagType == 269) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4333
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4334
    (tagType == 270) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4335
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4336
    (tagType == 271) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4337
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4338
    (tagType == 272) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4339
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4340
    (tagType == 273) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4341
        "stripoffsets"
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4342
        address := stripOffsetsPos.
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4343
        numberType := #long.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4344
        count := stripOffsets size.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4345
        valueArray := stripOffsets
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4346
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4347
    (tagType == 274) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4348
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4349
    (tagType == 277) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4350
        "samplesPerPixel"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4351
        value := samplesPerPixel.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4352
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4353
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4354
    (tagType == 278) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4355
        "rowsperstrip"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4356
        value := rowsPerStrip.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4357
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4358
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4359
    (tagType == 279) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4360
        "stripbytecount"
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4361
        address := stripByteCountsPos.
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4362
        numberType := #short.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4363
        count := stripByteCounts size.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4364
        valueArray := stripByteCounts
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4365
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4366
    (tagType == 280) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4367
        "min sample value"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4368
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4369
    (tagType == 281) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4370
        "max sample value"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4371
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4372
    (tagType == 282) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4373
        "x resolution"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4374
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4375
    (tagType == 283) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4376
        "y resolution"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4377
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4378
    (tagType == 284) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4379
        "planarconfig"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4380
        value := planarConfiguration.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4381
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4382
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4383
    (tagType == 285) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4384
        "pageName"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4385
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4386
    (tagType == 286) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4387
        "xPosition"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4388
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4389
    (tagType == 287) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4390
        "yPosition"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4391
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4392
    (tagType == 288) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4393
        "freeOffsets"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4394
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4395
    (tagType == 289) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4396
        "freeByteCounts"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4397
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4398
    (tagType == 290) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4399
        "grayResponceUnit"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4400
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4401
    (tagType == 291) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4402
        "grayResponceCurve"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4403
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4404
    (tagType == 292) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4405
        "group3options"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4406
        value := group3options.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4407
        numberType := #long.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4408
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4409
    (tagType == 293) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4410
        "group4options"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4411
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4412
    (tagType == 296) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4413
        "resolutionunit"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4414
        ^ self
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4415
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4416
    (tagType == 297) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4417
        "pageNumber"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4418
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4419
    (tagType == 300) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4420
        "colorResponceUnit"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4421
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4422
    (tagType == 301) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4423
        "colorResponceCurve"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4424
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4425
    (tagType == 306) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4426
        "dateTime"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4427
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4428
    (tagType == 315) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4429
        "artist"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4430
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4431
    (tagType == 317) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4432
        "predictor"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4433
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4434
    (tagType == 320) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4435
        "colormap"
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4436
        address := colorMapPos.
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4437
        numberType := #short.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4438
        count := 256 "(colorMap at:1) size" * 3.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4439
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4440
3f9277473954 Initial revision
claus
parents:
diff changeset
  4441
    (value isNil and:[address isNil]) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4442
        self error:'unhandled tag' mayProceed:true.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4443
        ^ self
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4444
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4445
14
20638e830834 *** empty log message ***
claus
parents: 11
diff changeset
  4446
"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4447
'tag:' print. tagType print. ' typ:' print. numberType print.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4448
' len:' print. count print.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4449
' val:' print. value printNewline.  
14
20638e830834 *** empty log message ***
claus
parents: 11
diff changeset
  4450
"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4451
3f9277473954 Initial revision
claus
parents:
diff changeset
  4452
    self writeShort:tagType.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4453
    numberType == #short ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4454
        self writeShort:3.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4455
        self writeLong:count.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4456
    ] ifFalse:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4457
        numberType == #long ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4458
            self writeShort:4.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4459
            self writeLong:count.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4460
        ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4461
            numberType == #byte ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4462
                self writeShort:1.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4463
                self writeLong:count.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4464
            ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4465
                self error:'bad numbertype'
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4466
            ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4467
        ]
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4468
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4469
    address notNil ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4470
        (numberType == #long and:[count == 1]) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4471
            self writeLong:(valueArray at:1).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4472
            ^ self
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4473
        ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4474
        (numberType == #short and:[count <= 2]) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4475
            self writeShort:(valueArray at:1).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4476
            count == 2 ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4477
                self writeShort:(valueArray at:2).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4478
            ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4479
                self writeShort:0
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4480
            ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4481
            ^ self
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4482
        ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4483
        (numberType == #byte and:[count <= 4]) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4484
            outStream nextPut:(valueArray at:1).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4485
            count > 1 ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4486
                outStream nextPut:(valueArray at:2).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4487
                count > 2 ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4488
                    outStream nextPut:(valueArray at:3).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4489
                    count > 3 ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4490
                        outStream nextPut:(valueArray at:4).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4491
                    ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4492
                        outStream nextPut:0
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4493
                    ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4494
                ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4495
                    outStream nextPut:0
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4496
                ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4497
            ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4498
                outStream nextPut:0
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4499
            ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4500
            ^ self
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4501
        ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4502
        self writeLong:address.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4503
        ^ self
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4504
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4505
    numberType == #short ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4506
        self writeShort:value.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4507
        self writeShort:0
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4508
    ] ifFalse:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4509
        numberType == #long ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4510
            self writeLong:value
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4511
        ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4512
            numberType == #byte ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4513
                outStream nextPut:value.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4514
                outStream nextPut:0.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4515
                outStream nextPut:0.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4516
                outStream nextPut:0.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4517
            ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4518
                self error:'bad numbertype'
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4519
            ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4520
        ]
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4521
    ].
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4522
4011
0dfddf756e27 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  4523
    "Modified: / 13-09-2017 / 10:08:52 / cg"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4524
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  4525
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4526
writeUncompressedBits
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4527
    "write bits as one or multiple strips"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4528
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4529
    |offs bytesPerRow nBytes
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4530
     h "{ Class: SmallInteger }"|
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4531
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4532
    nBytes := data size.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4533
    nBytes < 16rFFFF ifTrue:[
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4534
        stripOffsets := Array with:(outStream position).
1703
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4535
        stripByteCounts := Array with:nBytes.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4536
        outStream nextPutBytes:nBytes from:data.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4537
        rowsPerStrip := height
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4538
    ] ifFalse:[
1703
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4539
        stripOffsets := Array basicNew:height.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4540
        bytesPerRow := nBytes // height.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4541
        stripByteCounts := (Array basicNew:height) atAllPut:bytesPerRow.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4542
1703
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4543
        offs := 1.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4544
        h := height.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4545
        1 to:h do:[:row |
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4546
            stripOffsets at:row put:(outStream position).
1703
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4547
            outStream nextPutBytes:bytesPerRow from:data startingAt:offs.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4548
            offs := offs + bytesPerRow
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4549
        ].
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4550
        rowsPerStrip := 1
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4551
    ].
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4552
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4553
    'stripOffsets: ' print. stripOffsets printNewline.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4554
    'stripByteCounts: ' print. stripByteCounts printNewline.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4555
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4556
! !
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4557
1805
93f557cbe600 category changes
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
  4558
!TIFFReader methodsFor:'reading'!
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4559
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4560
fromStream:aStream
192
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4561
    "read a stream containing a TIFF image.
3899
fd43372bf11d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3777
diff changeset
  4562
     Leave image description in instance variables.
fd43372bf11d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3777
diff changeset
  4563
     (i.e. to get the image, ask with image)."
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4564
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4565
    |char1 char2 version offset msb
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4566
     bytesPerRow img moreIfds atEnd|
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4567
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4568
    inStream := aStream.
331
304f9c439efa allow reading from ByteArray-readStreams
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  4569
    aStream binary.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4570
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4571
    char1 := aStream next.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4572
    char2 := aStream next.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4573
    
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4574
    "/ first two chars are either II (intel byte order) 
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4575
    "/ or MM (motorola byte orrder)
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4576
    (char1 ~~ char2) ifTrue:[
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  4577
        ^ self fileFormatError:'not a tiff file'.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4578
    ].
1953
90f3c42ef3c1 Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents: 1846
diff changeset
  4579
    (char1 == $I codePoint) ifTrue:[
192
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4580
        byteOrder := #lsb.
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4581
        msb := false.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4582
    ] ifFalse:[
1953
90f3c42ef3c1 Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents: 1846
diff changeset
  4583
        (char1 == $M codePoint) ifTrue:[
192
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4584
            byteOrder := #msb.
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4585
            msb := true.
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4586
        ] ifFalse:[
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  4587
            ^ self fileFormatError:'not a tiff file'.
192
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4588
        ]
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4589
    ].
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4590
    
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4591
    version := aStream nextUnsignedInt16MSB:msb.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4592
    (version == 42) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4593
        isBigTiff := false.
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4594
    ] ifFalse:[
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4595
       (version == 43) ifTrue:[
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4596
            |byteSizeOfOffsets always0|
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4597
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4598
            "/ 43 is the proposed bigtiff format
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4599
            isBigTiff := true.
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4600
            byteSizeOfOffsets := aStream nextUnsignedInt16MSB:msb.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4601
            byteSizeOfOffsets == 8 ifFalse:[
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4602
                ^ self fileFormatError:'version of bigtiff-file not supported'.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4603
            ].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4604
            always0 := aStream nextUnsignedInt16MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4605
            always0 == 0 ifFalse:[
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4606
                ^ self fileFormatError:'version of bigtiff-file not supported'.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4607
            ].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4608
        ] ifFalse:[    
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4609
            ^ self fileFormatError:'version of tiff-file not supported'.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4610
        ].
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4611
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4612
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4613
    imageSequence := ImageSequence new.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4614
    isDNGImage := false.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4615
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4616
    isBigTiff ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4617
        offset := aStream nextUnsignedInt32MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4618
    ] ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4619
        offset := aStream nextUnsignedInt64MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4620
    ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4621
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4622
    [ offset ~~ 0 ] whileTrue:[    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4623
        Verbose == true ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4624
            Logger info:'------------------ reading image #%1 ------------------' with:imageSequence size+1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4625
        ].    
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4626
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4627
        "/ no more images, if tagData immediately follows (i.e. position == offset)
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4628
        atEnd := (aStream position == offset).
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4629
        atEnd := false.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4630
        
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4631
        aStream position:offset.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4632
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4633
        "setup default values"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4634
        metaData := TIFFMetaData new.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4635
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4636
        compression := 1. "none"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4637
        fillOrder := #msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4638
        planarConfiguration := PLANARCONFIG_CONTIG.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4639
        photometric := nil.
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4640
        bitsPerSample := nil.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4641
        samplesPerPixel := 1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4642
        width := height := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4643
        stripOffsets := stripByteCounts := rowsPerStrip := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4644
        "resolutionUnit := 2."
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4645
        predictor := 1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4646
        group3options := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4647
        orientation := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4648
        subFileType := subIfds := nil.
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4649
        sampleFormat := SAMPLEFORMAT_UINT.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4650
        minSampleValue := maxSampleValue := nil.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4651
        tileWidth := tileLength := tileOffsets := tileByteCounts := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4652
        
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4653
        self readTagsFrom:aStream.
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4654
        
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4655
        "/ read the next offset now,
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4656
        "/ because the stream's position will be changed when the image-data is read
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4657
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4658
        (stripOffsets at:1) == aStream position ifTrue:[
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4659
            offset := 0
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4660
        ] ifFalse:[
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4661
            isBigTiff ifFalse:[
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4662
                offset := aStream nextUnsignedInt32MSB:msb.
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4663
            ] ifTrue:[
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4664
                offset := aStream nextUnsignedInt64MSB:msb.
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4665
            ].    
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4666
        ].
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4667
        
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4668
        "check for required tags"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4669
        width isNil ifTrue:[ ^ self fileFormatError:'missing width tag' ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4670
        height isNil ifTrue:[ ^ self fileFormatError:'missing length tag' ].
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4671
        bitsPerSample isNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4672
            bitsPerSample := Array new:samplesPerPixel withAll:1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4673
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4674
        
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4675
        photometric isNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4676
            "/ try to repair
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4677
            bitsPerSample sum == 1 ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4678
                photometric := #whiteIs0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4679
            ] ifFalse:[    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4680
                ^ self fileFormatError:'missing photometric tag' 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4681
            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4682
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4683
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4684
        "given all the information, read the bits"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4685
        tileWidth notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4686
            tileOffsets := tileOffsets ? stripOffsets.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4687
            tileByteCounts := tileByteCounts ? stripByteCounts.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4688
            (tileOffsets notNil 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4689
                and:[tileLength notNil
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4690
                and:[tileByteCounts notNil ]]
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4691
            ) ifFalse:[    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4692
                ^ self fileFormatError:'missing stripOffsets (or tileOffsets)'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4693
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4694
            self reportDimension.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4695
            self readTiledTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4696
        ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4697
            stripByteCounts isNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4698
                stripOffsets size == 1 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4699
                    stripByteCounts := Array with:(self bitsPerPixel // 8) * width * height
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4700
                ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4701
                    ^ self fileFormatError:'missing stripByteCounts'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4702
                ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4703
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4704
            rowsPerStrip isNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4705
                rowsPerStrip := height
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4706
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4707
            self reportDimension.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4708
            self readTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4709
        ].
3693
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
  4710
    
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4711
        orientation notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4712
            orientation == #unsupported ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4713
                'TIFFReader [warning]: unsupported orientation' errorPrintCR
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4714
            ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4715
                orientation == #vFlip ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4716
                    |tmp offset1 offset2|
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4717
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4718
                    "/ reverse rows to top-to bottom 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4719
                    "/ (oops - depends on side-effecting the data array)
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4720
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4721
                    bytesPerRow := self bytesPerRow.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4722
                    tmp := ByteArray new:bytesPerRow.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4723
                    offset1 := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4724
                    offset2 := (height-1)*bytesPerRow + 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4725
                    0 to:((height-1)//2) do:[:row |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4726
                        tmp replaceFrom:1 to:bytesPerRow with:data startingAt:offset1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4727
                        data replaceFrom:offset1 to:(offset1+bytesPerRow-1) with:data startingAt:offset2.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4728
                        data replaceFrom:offset2 to:(offset2+bytesPerRow-1) with:tmp startingAt:1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4729
                        offset1 := offset1 + bytesPerRow.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4730
                        offset2 := offset2 - bytesPerRow.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4731
                    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4732
                ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4733
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4734
        ].
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4735
        
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4736
        "/ fixup photoetric
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4737
        photometric == #rgb ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4738
            samplesPerPixel == 4 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4739
                photometric := #rgba
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4740
            ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4741
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4742
        
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4743
        img := self makeImage.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4744
        img imageSequence:imageSequence.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4745
        imageSequence add:(ImageFrame new image:img).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4746
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4747
        offset == 0 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4748
            moreIfds isNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4749
                subIfds notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4750
                    (isDNGImage not or:[loadFullResolutionImage == true]) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4751
                        moreIfds := OrderedCollection withAll:subIfds.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4752
                        subIfds := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4753
                    ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4754
                        Verbose == true ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4755
                            Logger info:'skip high resolution images (use loadFullResolutionImage is false)'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4756
                        ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4757
                    ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4758
                ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4759
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4760
            moreIfds notEmptyOrNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4761
                offset := moreIfds removeFirst
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4762
            ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4763
        ].    
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4764
    ].
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4765
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4766
    imageSequence size > 1 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4767
        Verbose == true ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4768
            Logger info:'read %1 images' with:imageSequence size
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4769
        ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4770
    ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4771
    ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4772
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4773
    "Modified: / 17-09-2017 / 13:06:10 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4774
! !
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4775
1805
93f557cbe600 category changes
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
  4776
!TIFFReader methodsFor:'writing'!
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4777
1571
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4778
save:image onStream:aStream
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4779
    "save image as (uncompressed) TIFF file on aFileName"
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4780
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4781
    |pos1 pos indicator|
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4782
1078
fc33e172bbbc raise informationLostSignal before attemting to write the file
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
  4783
    image mask notNil ifTrue:[
fc33e172bbbc raise informationLostSignal before attemting to write the file
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
  4784
        Image informationLostQuerySignal
fc33e172bbbc raise informationLostSignal before attemting to write the file
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
  4785
            raiseWith:image
fc33e172bbbc raise informationLostSignal before attemting to write the file
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
  4786
            errorString:('TIFF writer does not (yet) support an imageMask').
fc33e172bbbc raise informationLostSignal before attemting to write the file
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
  4787
    ].
fc33e172bbbc raise informationLostSignal before attemting to write the file
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
  4788
1571
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4789
    outStream := aStream.
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4790
    outStream binary.
461
bacef118f54a more signals to be raised if anything happens during
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
  4791
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4792
    "save as msb"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4793
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4794
    byteOrder := #msb.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4795
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4796
    byteOrder := #lsb.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4797
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4798
    fillOrder := #msb.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4799
    width := image width.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4800
    height := image height.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4801
    photometric := image photometric.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4802
    samplesPerPixel := image samplesPerPixel.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4803
    bitsPerSample := image bitsPerSample.
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4804
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4805
    colorMap := image colorMap.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4806
    planarConfiguration := PLANARCONFIG_CONTIG.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4807
    compression := 1.   "none"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4808
    data := image bits.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4809
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4810
    currentOffset := 0.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4811
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4812
    (byteOrder == #msb) ifTrue:[
1953
90f3c42ef3c1 Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents: 1846
diff changeset
  4813
        indicator := $M codePoint.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4814
    ] ifFalse:[
1953
90f3c42ef3c1 Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents: 1846
diff changeset
  4815
        indicator := $I codePoint.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4816
    ].
1571
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4817
    outStream nextPut:indicator; nextPut:indicator.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4818
    currentOffset := currentOffset + 2.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4819
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4820
    self writeShort:42.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4821
    currentOffset := currentOffset + 2.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4822
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4823
    pos1 := outStream position.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4824
    self writeLong:0.           "start of tags - filled in later"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4825
    currentOffset := currentOffset + 4.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4826
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4827
    "output strips"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4828
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4829
    self writeUncompressedBits. "this outputs bits as strips, sets stripOffsets and stripByteCounts"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4830
    self writeStripOffsets.     "this outputs strip offsets, sets stripOffsetsPos"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4831
    self writeStripByteCounts.  "this outputs strip bytecounts, sets stripByteCountPos"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4832
    self writeBitsPerSample.    "this outputs bitsPerSample, sets bitsPerSamplePos"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4833
    photometric == #palette ifTrue:[
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4834
        self writeColorMap      "this outputs colorMap, sets colorMapPos"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4835
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4836
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4837
    pos := outStream position.        "backpatch tag offset"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4838
    outStream position:pos1.
1704
1526c7b84920 code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
  4839
    self writeLong:pos.                     "fill in tag offset"
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4840
    outStream position:pos.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4841
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4842
('patch tag offset at: ', (pos1 printStringRadix:16) , ' to ',
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4843
                         (pos printStringRadix:16)) printNewline.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4844
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4845
    "output tag data"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4846
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4847
    photometric == #palette ifTrue:[
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4848
        self writeShort:11.  "11 tags"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4849
    ] ifFalse:[
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4850
        self writeShort:10.  "10 tags"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4851
    ].
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4852
    self writeTag:256.               "image width"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4853
    self writeTag:257.               "image height"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4854
    self writeTag:258.               "bits per sample"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4855
    self writeTag:259.               "compression"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4856
    self writeTag:262.               "photometric"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4857
    self writeTag:273.               "strip offsets"
159
327da5085900 fixed saving of 24bit RGB images (forgot samplesPerPixel-TAG)
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
  4858
    self writeTag:277.               "samplesPerPixel"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4859
    self writeTag:278.               "rowsPerStrip"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4860
    self writeTag:279.               "strip byte counts"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4861
    self writeTag:284.               "planarconfig"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4862
    photometric == #palette ifTrue:[
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4863
        self writeTag:320            "colorMap"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4864
    ].
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4865
    self writeLong:0.                "end of tags mark"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4866
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4867
    "Modified: / 27-08-2017 / 13:36:35 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4868
! !
30
9638bc775850 *** empty log message ***
claus
parents: 28
diff changeset
  4869
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4870
!TIFFReader class methodsFor:'documentation'!
30
9638bc775850 *** empty log message ***
claus
parents: 28
diff changeset
  4871
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4872
version
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  4873
    ^ '$Header$'
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  4874
!
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  4875
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  4876
version_CVS
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  4877
    ^ '$Header$'
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4878
! !
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  4879
3112
d6fbee4954ca class: TIFFReader
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  4880
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4881
TIFFReader initialize!