TIFFReader.st
author convert-repo
Thu, 06 Dec 2018 04:35:51 +0000
changeset 4215 bc67d59fcf46
parent 4103 2d8da32cf18b
child 4336 7f2596e303be
permissions -rw-r--r--
update tags
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4103
2d8da32cf18b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4015
diff changeset
     1
"{ Encoding: utf8 }"
2d8da32cf18b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4015
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'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    26
	classVariableNames:'Verbose COMPRESSION_NONE COMPRESSION_CCITTRLE
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    27
		COMPRESSION_CCITTFAX3 COMPRESSION_CCITTFAX4 COMPRESSION_LZW
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    28
		COMPRESSION_OJPEG COMPRESSION_JPEG COMPRESSION_ADOBE_DEFLATE
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    29
		COMPRESSION_JBIG_T85 COMPRESSION_JBIG_T43 COMPRESSION_NEXT
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    30
		COMPRESSION_CCITTRLEW COMPRESSION_PACKBITS
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    31
		COMPRESSION_THUNDERSCAN COMPRESSION_IT8CTPAD COMPRESSION_IT8LW
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    32
		COMPRESSION_IT8MP COMPRESSION_IT8BL COMPRESSION_PIXARFILM
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    33
		COMPRESSION_PIXARLOG COMPRESSION_DEFLATE COMPRESSION_DCS
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    34
		COMPRESSION_JBIG COMPRESSION_JPEG2000 COMPRESSION_NIKON_NEF
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    35
		COMPRESSION_JBIG2 COMPRESSION_NEXT_JPEG SAMPLEFORMAT_UINT
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    36
		SAMPLEFORMAT_INT SAMPLEFORMAT_IEEEFP SAMPLEFORMAT_VOID
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    37
		SAMPLEFORMAT_COMPLEXINT SAMPLEFORMAT_COMPLEXIEEEFP
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    38
		COMPRESSION_SGILOG COMPRESSION_SGILOG24 PLANARCONFIG_CONTIG
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    39
		PLANARCONFIG_SEPARATE FILETYPE_MASK_REDUCEDIMAGE
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
    40
		FILETYPE_MASK_PAGE FILETYPE_MASK_MASK FILLORDER_MSB2LSB
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
    41
		FILLORDER_LSB2MSB'
192
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
    42
	poolDictionaries:''
1745
4fa0fad2a463 code cleanup (colorMap handling)
Claus Gittinger <cg@exept.de>
parents: 1712
diff changeset
    43
	category:'Graphics-Images-Readers'
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    44
!
3f9277473954 Initial revision
claus
parents:
diff changeset
    45
3693
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    46
Dictionary subclass:#TIFFMetaData
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    47
	instanceVariableNames:''
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    48
	classVariableNames:''
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    49
	poolDictionaries:''
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    50
	privateIn:TIFFReader
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    51
!
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
    52
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
    53
!TIFFReader class methodsFor:'documentation'!
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    54
21
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    55
copyright
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    56
"
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    57
 COPYRIGHT (c) 1991 by Claus Gittinger
28
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
    58
	      All Rights Reserved
21
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    59
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    60
 This software is furnished under a license and may be used
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    61
 only in accordance with the terms of that license and with the
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    62
 inclusion of the above copyright notice.   This software may not
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    63
 be provided or otherwise made available to, or used by, any
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    64
 other person.  No title to or ownership of the software is
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    65
 hereby transferred.
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    66
"
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    67
!
66b31c91177f *** empty log message ***
claus
parents: 19
diff changeset
    68
0
3f9277473954 Initial revision
claus
parents:
diff changeset
    69
documentation
3f9277473954 Initial revision
claus
parents:
diff changeset
    70
"
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    71
    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
    72
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    73
    Implemented & Missing Features:
14
20638e830834 *** empty log message ***
claus
parents: 11
diff changeset
    74
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    75
      - Only single image files are supported.
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    76
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    77
      - 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
    78
        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
    79
        although the alpha channel is currently not supported and ignored.
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    80
        It supports reading of uncompressed, LZW, packbits and CCITT-G3 compressed images
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    81
        JPEG and many other formats are currently not implemented.
30
9638bc775850 *** empty log message ***
claus
parents: 28
diff changeset
    82
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    83
      - Only writing of uncompressed images is currently implemented.
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    84
        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
    85
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    86
      - bigTiff is supported
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
    87
      
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
    88
      - some dng tags are supported
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    89
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    90
    More formats will come... (will they ever be needed?)
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
    91
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    92
    TODO (?): 
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    93
        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
    94
        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
    95
        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
    96
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    97
        Late note: 
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
    98
            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
    99
            w.r.t. memory leaks, non-reentrancy, non-interruptability etc.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   100
            (we recently fixed a malloc-non-reentrant bug for some architecture...)
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   101
            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
   102
220
4106d9ce7e02 documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
   103
    [author:]
4106d9ce7e02 documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
   104
        Claus Gittinger
4106d9ce7e02 documentation
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
   105
195
7975a2c4a890 commentary
Claus Gittinger <cg@exept.de>
parents: 192
diff changeset
   106
    [See also:]
234
b6352d13e792 xrefs in documentation
Claus Gittinger <cg@exept.de>
parents: 220
diff changeset
   107
        Image Form Icon
4103
2d8da32cf18b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4015
diff changeset
   108
        BlitImageReader FaceReader GIFReader JPEGReader MacOSXIconReader
2d8da32cf18b #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4015
diff changeset
   109
        PBMReader PCXReader PNGReader 
210
5405de794686 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
   110
        ST80FormReader SunRasterReader TargaReader WindowsIconReader 
209
840ddcf12904 commentary
Claus Gittinger <cg@exept.de>
parents: 198
diff changeset
   111
        XBMReader XPMReader XWDReader 
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   112
"
3f9277473954 Initial revision
claus
parents:
diff changeset
   113
! !
3f9277473954 Initial revision
claus
parents:
diff changeset
   114
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   115
!TIFFReader class methodsFor:'initialization'!
28
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
   116
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
   117
initialize
198
6d76856aaa80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   118
    "install myself in the Image classes fileFormat table
398
aef700d15416 new suffix-table
Claus Gittinger <cg@exept.de>
parents: 393
diff changeset
   119
     for the `.tiff' and `.tif' extensions."
198
6d76856aaa80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   120
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   121
    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
   122
    MIMETypes defineImageType:nil          suffix:'tiff' reader:self.
198
6d76856aaa80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   123
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   124
    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
   125
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   126
    COMPRESSION_NONE            := 1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   127
    COMPRESSION_CCITTRLE        := 2.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   128
    COMPRESSION_CCITTFAX3       := 3.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   129
    COMPRESSION_CCITTFAX4       := 4.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   130
    COMPRESSION_LZW             := 5.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   131
    COMPRESSION_OJPEG           := 6. "/ (old style jpeg)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   132
    COMPRESSION_JPEG            := 7. "/ (new style jpeg)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   133
    COMPRESSION_ADOBE_DEFLATE   := 8.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   134
    COMPRESSION_JBIG_T85        := 9.  "/ (ITU-T T85)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   135
    COMPRESSION_JBIG_T43        := 10. "/ (ITU-T T43)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   136
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   137
    COMPRESSION_NEXT            := 32766. "/ (NeXT 2-bit encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   138
    COMPRESSION_CCITTRLEW       := 32771.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   139
    COMPRESSION_PACKBITS        := 32773.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   140
    COMPRESSION_THUNDERSCAN     := 32809. "/ (ThunderScan 4-bit encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   141
    COMPRESSION_NEXT_JPEG       := 32865. "/ (NeXT jpeg encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   142
    COMPRESSION_IT8CTPAD        := 32895.  
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   143
    COMPRESSION_IT8LW           := 32896.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   144
    COMPRESSION_IT8MP           := 32897. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   145
    COMPRESSION_IT8BL           := 32898. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   146
    COMPRESSION_PIXARFILM       := 32908.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   147
    COMPRESSION_PIXARLOG        := 32909. "/ (Pixar companded 11-bit ZIP encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   148
    COMPRESSION_DEFLATE         := 32946. "/ (PKZIP-style Deflate encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   149
    COMPRESSION_DCS             := 32947. "/ (kodac)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   150
    COMPRESSION_JBIG            := 34661.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   151
    COMPRESSION_SGILOG          := 34676. "/ (SGI 32-bit Log Luminance encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   152
    COMPRESSION_SGILOG24        := 34677. "/ (SGI 24-bit Log Luminance encoding)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   153
    COMPRESSION_JPEG2000        := 34712. "/ JPEG2000
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   154
    COMPRESSION_NIKON_NEF       := 34713.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   155
    COMPRESSION_JBIG2           := 34715.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   156
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   157
    SAMPLEFORMAT_UINT           := 1.       "/ !!unsigned integer data 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   158
    SAMPLEFORMAT_INT            := 2.       "/ !!signed integer data 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   159
    SAMPLEFORMAT_IEEEFP         := 3.       "/ !!IEEE floating point data 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   160
    SAMPLEFORMAT_VOID           := 4.       "/ !!untyped data 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   161
    SAMPLEFORMAT_COMPLEXINT     := 5.       "/ !!complex signed int 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   162
    SAMPLEFORMAT_COMPLEXIEEEFP  := 6.       "/ !!complex ieee floating 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   163
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   164
    PLANARCONFIG_CONTIG         := 1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   165
    PLANARCONFIG_SEPARATE       := 2.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   166
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   167
    FILETYPE_MASK_REDUCEDIMAGE  := 1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   168
    FILETYPE_MASK_PAGE          := 2.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   169
    FILETYPE_MASK_MASK          := 4. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   170
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
   171
    FILLORDER_MSB2LSB := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
   172
    FILLORDER_LSB2MSB := 2.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
   173
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   174
"/    TYPE_NOTYPE := 0.           "/ placeholder 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   175
"/    TYPE_BYTE   := 1.           "/ 8-bit unsigned integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   176
"/    TYPE_ASCII  := 2.           "/ 8-bit bytes w/ last byte null 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   177
"/    TYPE_SHORT  := 3.           "/ 16-bit unsigned integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   178
"/    TYPE_LONG   := 4.           "/ 32-bit unsigned integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   179
"/    TYPE_RATIONAL := 5.         "/ 64-bit unsigned fraction 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   180
"/    TYPE_SBYTE  := 6.           "/ !!8-bit signed integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   181
"/    TYPE_UNDEFINED  := 7.       "/ !!8-bit untyped data 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   182
"/    TYPE_SSHORT     := 8.       "/ !!16-bit signed integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   183
"/    TYPE_SLONG      := 9.       "/ !!32-bit signed integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   184
"/    TYPE_SRATIONAL  := 10.      "/ !!64-bit signed fraction 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   185
"/    TYPE_FLOAT      := 11.      "/ !!32-bit IEEE floating point 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   186
"/    TYPE_DOUBLE     := 12.      "/ !!64-bit IEEE floating point 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   187
"/    TYPE_IFD        := 13.      "/ %32-bit unsigned integer (offset) 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   188
"/    TYPE_LONG8      := 16.      "/ BigTIFF 64-bit unsigned integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   189
"/    TYPE_SLONG8     := 17.      "/ BigTIFF 64-bit signed integer 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   190
"/    TYPE_IFD8       := 18.      "/ BigTIFF 64-bit unsigned integer (offset) 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   191
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
    "/ TIFF tags
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   194
    "/
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
"/    #define TIFFTAG_SUBFILETYPE             254     /* subfile data descriptor */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   197
"/    #define     FILETYPE_REDUCEDIMAGE       0x1     /* reduced resolution version */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   198
"/    #define     FILETYPE_PAGE               0x2     /* one page of many */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   199
"/    #define     FILETYPE_MASK               0x4     /* transparency mask */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   200
"/    #define TIFFTAG_OSUBFILETYPE            255     /* +kind of data in subfile */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   201
"/    #define     OFILETYPE_IMAGE             1       /* full resolution image data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   202
"/    #define     OFILETYPE_REDUCEDIMAGE      2       /* reduced size image data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   203
"/    #define     OFILETYPE_PAGE              3       /* one page of many */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   204
"/    #define TIFFTAG_IMAGEWIDTH              256     /* image width in pixels */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   205
"/    #define TIFFTAG_IMAGELENGTH             257     /* image height in pixels */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   206
"/    #define TIFFTAG_BITSPERSAMPLE           258     /* bits per channel (sample) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   207
"/    #define TIFFTAG_COMPRESSION             259     /* data compression technique */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   208
"/    #define     COMPRESSION_NONE            1       /* dump mode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   209
"/    #define     COMPRESSION_CCITTRLE        2       /* CCITT modified Huffman RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   210
"/    #define     COMPRESSION_CCITTFAX3       3       /* CCITT Group 3 fax encoding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   211
"/    #define     COMPRESSION_CCITT_T4        3       /* CCITT T.4 (TIFF 6 name) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   212
"/    #define     COMPRESSION_CCITTFAX4       4       /* CCITT Group 4 fax encoding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   213
"/    #define     COMPRESSION_CCITT_T6        4       /* CCITT T.6 (TIFF 6 name) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   214
"/    #define     COMPRESSION_LZW             5       /* Lempel-Ziv  & Welch */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   215
"/    #define     COMPRESSION_OJPEG           6       /* !!6.0 JPEG */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   216
"/    #define     COMPRESSION_JPEG            7       /* %JPEG DCT compression */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   217
"/    #define     COMPRESSION_T85                     9       /* !!TIFF/FX T.85 JBIG compression */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   218
"/    #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
   219
"/    #define     COMPRESSION_NEXT            32766   /* NeXT 2-bit RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   220
"/    #define     COMPRESSION_CCITTRLEW       32771   /* #1 w/ word alignment */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   221
"/    #define     COMPRESSION_PACKBITS        32773   /* Macintosh RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   222
"/    #define     COMPRESSION_THUNDERSCAN     32809   /* ThunderScan RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   223
"/    /* 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
   224
"/    #define     COMPRESSION_IT8CTPAD        32895   /* IT8 CT w/padding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   225
"/    #define     COMPRESSION_IT8LW           32896   /* IT8 Linework RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   226
"/    #define     COMPRESSION_IT8MP           32897   /* IT8 Monochrome picture */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   227
"/    #define     COMPRESSION_IT8BL           32898   /* IT8 Binary line art */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   228
"/    /* compression codes 32908-32911 are reserved for Pixar */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   229
"/    #define     COMPRESSION_PIXARFILM       32908   /* Pixar companded 10bit LZW */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   230
"/    #define     COMPRESSION_PIXARLOG        32909   /* Pixar companded 11bit ZIP */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   231
"/    #define     COMPRESSION_DEFLATE         32946   /* Deflate compression */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   232
"/    #define     COMPRESSION_ADOBE_DEFLATE   8       /* Deflate compression,
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   233
"/                                                       as recognized by Adobe */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   234
"/    /* compression code 32947 is reserved for Oceana Matrix <dev@oceana.com> */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   235
"/    #define     COMPRESSION_DCS             32947   /* Kodak DCS encoding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   236
"/    #define     COMPRESSION_JBIG            34661   /* ISO JBIG */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   237
"/    #define     COMPRESSION_SGILOG          34676   /* SGI Log Luminance RLE */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   238
"/    #define     COMPRESSION_SGILOG24        34677   /* SGI Log 24-bit packed */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   239
"/    #define     COMPRESSION_JP2000          34712   /* Leadtools JPEG2000 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   240
"/    #define     COMPRESSION_LZMA            34925   /* LZMA2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   241
"/    #define TIFFTAG_PHOTOMETRIC             262     /* photometric interpretation */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   242
"/    #define     PHOTOMETRIC_MINISWHITE      0       /* min value is white */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   243
"/    #define     PHOTOMETRIC_MINISBLACK      1       /* min value is black */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   244
"/    #define     PHOTOMETRIC_RGB             2       /* RGB color model */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   245
"/    #define     PHOTOMETRIC_PALETTE         3       /* color map indexed */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   246
"/    #define     PHOTOMETRIC_MASK            4       /* $holdout mask */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   247
"/    #define     PHOTOMETRIC_SEPARATED       5       /* !!color separations */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   248
"/    #define     PHOTOMETRIC_YCBCR           6       /* !!CCIR 601 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   249
"/    #define     PHOTOMETRIC_CIELAB          8       /* !!1976 CIE L*a*b* */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   250
"/    #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
   251
"/    #define     PHOTOMETRIC_ITULAB          10      /* ITU L*a*b* */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   252
"/    #define     PHOTOMETRIC_CFA             32803   /* color filter array */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   253
"/    #define     PHOTOMETRIC_LOGL            32844   /* CIE Log2(L) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   254
"/    #define     PHOTOMETRIC_LOGLUV          32845   /* CIE Log2(L) (u',v') */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   255
"/    #define TIFFTAG_THRESHHOLDING           263     /* +thresholding used on data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   256
"/    #define     THRESHHOLD_BILEVEL          1       /* b&w art scan */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   257
"/    #define     THRESHHOLD_HALFTONE         2       /* or dithered scan */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   258
"/    #define     THRESHHOLD_ERRORDIFFUSE     3       /* usually floyd-steinberg */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   259
"/    #define TIFFTAG_CELLWIDTH               264     /* +dithering matrix width */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   260
"/    #define TIFFTAG_CELLLENGTH              265     /* +dithering matrix height */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   261
"/    #define TIFFTAG_FILLORDER               266     /* data order within a byte */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   262
"/    #define     FILLORDER_MSB2LSB           1       /* most significant -> least */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   263
"/    #define     FILLORDER_LSB2MSB           2       /* least significant -> most */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   264
"/    #define TIFFTAG_DOCUMENTNAME            269     /* name of doc. image is from */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   265
"/    #define TIFFTAG_IMAGEDESCRIPTION        270     /* info about image */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   266
"/    #define TIFFTAG_MAKE                    271     /* scanner manufacturer name */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   267
"/    #define TIFFTAG_MODEL                   272     /* scanner model name/number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   268
"/    #define TIFFTAG_STRIPOFFSETS            273     /* offsets to data strips */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   269
"/    #define TIFFTAG_ORIENTATION             274     /* +image orientation */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   270
"/    #define     ORIENTATION_TOPLEFT         1       /* row 0 top, col 0 lhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   271
"/    #define     ORIENTATION_TOPRIGHT        2       /* row 0 top, col 0 rhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   272
"/    #define     ORIENTATION_BOTRIGHT        3       /* row 0 bottom, col 0 rhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   273
"/    #define     ORIENTATION_BOTLEFT         4       /* row 0 bottom, col 0 lhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   274
"/    #define     ORIENTATION_LEFTTOP         5       /* row 0 lhs, col 0 top */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   275
"/    #define     ORIENTATION_RIGHTTOP        6       /* row 0 rhs, col 0 top */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   276
"/    #define     ORIENTATION_RIGHTBOT        7       /* row 0 rhs, col 0 bottom */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   277
"/    #define     ORIENTATION_LEFTBOT         8       /* row 0 lhs, col 0 bottom */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   278
"/    #define TIFFTAG_SAMPLESPERPIXEL         277     /* samples per pixel */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   279
"/    #define TIFFTAG_ROWSPERSTRIP            278     /* rows per strip of data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   280
"/    #define TIFFTAG_STRIPBYTECOUNTS         279     /* bytes counts for strips */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   281
"/    #define TIFFTAG_MINSAMPLEVALUE          280     /* +minimum sample value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   282
"/    #define TIFFTAG_MAXSAMPLEVALUE          281     /* +maximum sample value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   283
"/    #define TIFFTAG_XRESOLUTION             282     /* pixels/resolution in x */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   284
"/    #define TIFFTAG_YRESOLUTION             283     /* pixels/resolution in y */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   285
"/    #define TIFFTAG_PLANARCONFIG            284     /* storage organization */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   286
"/    #define     PLANARCONFIG_CONTIG         1       /* single image plane */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   287
"/    #define     PLANARCONFIG_SEPARATE       2       /* separate planes of data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   288
"/    #define TIFFTAG_PAGENAME                285     /* page name image is from */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   289
"/    #define TIFFTAG_XPOSITION               286     /* x page offset of image lhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   290
"/    #define TIFFTAG_YPOSITION               287     /* y page offset of image lhs */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   291
"/    #define TIFFTAG_FREEOFFSETS             288     /* +byte offset to free block */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   292
"/    #define TIFFTAG_FREEBYTECOUNTS          289     /* +sizes of free blocks */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   293
"/    #define TIFFTAG_GRAYRESPONSEUNIT        290     /* $gray scale curve accuracy */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   294
"/    #define     GRAYRESPONSEUNIT_10S        1       /* tenths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   295
"/    #define     GRAYRESPONSEUNIT_100S       2       /* hundredths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   296
"/    #define     GRAYRESPONSEUNIT_1000S      3       /* thousandths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   297
"/    #define     GRAYRESPONSEUNIT_10000S     4       /* ten-thousandths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   298
"/    #define     GRAYRESPONSEUNIT_100000S    5       /* hundred-thousandths */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   299
"/    #define TIFFTAG_GRAYRESPONSECURVE       291     /* $gray scale response curve */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   300
"/    #define TIFFTAG_GROUP3OPTIONS           292     /* 32 flag bits */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   301
"/    #define TIFFTAG_T4OPTIONS               292     /* TIFF 6.0 proper name alias */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   302
"/    #define     GROUP3OPT_2DENCODING        0x1     /* 2-dimensional coding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   303
"/    #define     GROUP3OPT_UNCOMPRESSED      0x2     /* data not compressed */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   304
"/    #define     GROUP3OPT_FILLBITS          0x4     /* fill to byte boundary */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   305
"/    #define TIFFTAG_GROUP4OPTIONS           293     /* 32 flag bits */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   306
"/    #define TIFFTAG_T6OPTIONS               293     /* TIFF 6.0 proper name */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   307
"/    #define     GROUP4OPT_UNCOMPRESSED      0x2     /* data not compressed */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   308
"/    #define TIFFTAG_RESOLUTIONUNIT          296     /* units of resolutions */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   309
"/    #define     RESUNIT_NONE                1       /* no meaningful units */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   310
"/    #define     RESUNIT_INCH                2       /* english */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   311
"/    #define     RESUNIT_CENTIMETER          3       /* metric */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   312
"/    #define TIFFTAG_PAGENUMBER              297     /* page numbers of multi-page */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   313
"/    #define TIFFTAG_COLORRESPONSEUNIT       300     /* $color curve accuracy */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   314
"/    #define     COLORRESPONSEUNIT_10S       1       /* tenths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   315
"/    #define     COLORRESPONSEUNIT_100S      2       /* hundredths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   316
"/    #define     COLORRESPONSEUNIT_1000S     3       /* thousandths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   317
"/    #define     COLORRESPONSEUNIT_10000S    4       /* ten-thousandths of a unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   318
"/    #define     COLORRESPONSEUNIT_100000S   5       /* hundred-thousandths */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   319
"/    #define TIFFTAG_TRANSFERFUNCTION        301     /* !!colorimetry info */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   320
"/    #define TIFFTAG_SOFTWARE                305     /* name & release */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   321
"/    #define TIFFTAG_DATETIME                306     /* creation date and time */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   322
"/    #define TIFFTAG_ARTIST                  315     /* creator of image */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   323
"/    #define TIFFTAG_HOSTCOMPUTER            316     /* machine where created */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   324
"/    #define TIFFTAG_PREDICTOR               317     /* prediction scheme w/ LZW */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   325
"/    #define     PREDICTOR_NONE              1       /* no prediction scheme used */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   326
"/    #define     PREDICTOR_HORIZONTAL        2       /* horizontal differencing */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   327
"/    #define     PREDICTOR_FLOATINGPOINT     3       /* floating point predictor */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   328
"/    #define TIFFTAG_WHITEPOINT              318     /* image white point */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   329
"/    #define TIFFTAG_PRIMARYCHROMATICITIES   319     /* !!primary chromaticities */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   330
"/    #define TIFFTAG_COLORMAP                320     /* RGB map for palette image */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   331
"/    #define TIFFTAG_HALFTONEHINTS           321     /* !!highlight+shadow info */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   332
"/    #define TIFFTAG_TILEWIDTH               322     /* !!tile width in pixels */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   333
"/    #define TIFFTAG_TILELENGTH              323     /* !!tile height in pixels */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   334
"/    #define TIFFTAG_TILEOFFSETS             324     /* !!offsets to data tiles */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   335
"/    #define TIFFTAG_TILEBYTECOUNTS          325     /* !!byte counts for tiles */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   336
"/    #define TIFFTAG_BADFAXLINES             326     /* lines w/ wrong pixel count */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   337
"/    #define TIFFTAG_CLEANFAXDATA            327     /* regenerated line info */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   338
"/    #define     CLEANFAXDATA_CLEAN          0       /* no errors detected */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   339
"/    #define     CLEANFAXDATA_REGENERATED    1       /* receiver regenerated lines */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   340
"/    #define     CLEANFAXDATA_UNCLEAN        2       /* uncorrected errors exist */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   341
"/    #define TIFFTAG_CONSECUTIVEBADFAXLINES  328     /* max consecutive bad lines */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   342
"/    #define TIFFTAG_SUBIFD                  330     /* subimage descriptors */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   343
"/    #define TIFFTAG_INKSET                  332     /* !!inks in separated image */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   344
"/    #define     INKSET_CMYK                 1       /* !!cyan-magenta-yellow-black color */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   345
"/    #define     INKSET_MULTIINK             2       /* !!multi-ink or hi-fi color */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   346
"/    #define TIFFTAG_INKNAMES                333     /* !!ascii names of inks */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   347
"/    #define TIFFTAG_NUMBEROFINKS            334     /* !!number of inks */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   348
"/    #define TIFFTAG_DOTRANGE                336     /* !!0% and 100% dot codes */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   349
"/    #define TIFFTAG_TARGETPRINTER           337     /* !!separation target */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   350
"/    #define TIFFTAG_EXTRASAMPLES            338     /* !!info about extra samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   351
"/    #define     EXTRASAMPLE_UNSPECIFIED     0       /* !!unspecified data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   352
"/    #define     EXTRASAMPLE_ASSOCALPHA      1       /* !!associated alpha data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   353
"/    #define     EXTRASAMPLE_UNASSALPHA      2       /* !!unassociated alpha data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   354
"/    #define TIFFTAG_SAMPLEFORMAT            339     /* !!data sample format */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   355
"/    #define     SAMPLEFORMAT_UINT           1       /* !!unsigned integer data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   356
"/    #define     SAMPLEFORMAT_INT            2       /* !!signed integer data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   357
"/    #define     SAMPLEFORMAT_IEEEFP         3       /* !!IEEE floating point data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   358
"/    #define     SAMPLEFORMAT_VOID           4       /* !!untyped data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   359
"/    #define     SAMPLEFORMAT_COMPLEXINT     5       /* !!complex signed int */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   360
"/    #define     SAMPLEFORMAT_COMPLEXIEEEFP  6       /* !!complex ieee floating */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   361
"/    #define TIFFTAG_SMINSAMPLEVALUE         340     /* !!variable MinSampleValue */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   362
"/    #define TIFFTAG_SMAXSAMPLEVALUE         341     /* !!variable MaxSampleValue */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   363
"/    #define TIFFTAG_CLIPPATH                343     /* %ClipPath
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   364
"/                                                       [Adobe TIFF technote 2] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   365
"/    #define TIFFTAG_XCLIPPATHUNITS          344     /* %XClipPathUnits
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   366
"/                                                       [Adobe TIFF technote 2] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   367
"/    #define TIFFTAG_YCLIPPATHUNITS          345     /* %YClipPathUnits
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   368
"/                                                       [Adobe TIFF technote 2] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   369
"/    #define TIFFTAG_INDEXED                 346     /* %Indexed
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   370
"/                                                       [Adobe TIFF Technote 3] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   371
"/    #define TIFFTAG_JPEGTABLES              347     /* %JPEG table stream */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   372
"/    #define TIFFTAG_OPIPROXY                351     /* %OPI Proxy [Adobe TIFF technote] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   373
"/    /* Tags 400-435 are from the TIFF/FX spec */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   374
"/    #define TIFFTAG_GLOBALPARAMETERSIFD     400     /* !! */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   375
"/    #define TIFFTAG_PROFILETYPE                     401     /* !! */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   376
"/    #define     PROFILETYPE_UNSPECIFIED     0       /* !! */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   377
"/    #define     PROFILETYPE_G3_FAX          1       /* !! */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   378
"/    #define TIFFTAG_FAXPROFILE                      402     /* !! */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   379
"/    #define     FAXPROFILE_S                        1       /* !!TIFF/FX FAX profile S */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   380
"/    #define     FAXPROFILE_F                        2       /* !!TIFF/FX FAX profile F */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   381
"/    #define     FAXPROFILE_J                        3       /* !!TIFF/FX FAX profile J */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   382
"/    #define     FAXPROFILE_C                        4       /* !!TIFF/FX FAX profile C */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   383
"/    #define     FAXPROFILE_L                        5       /* !!TIFF/FX FAX profile L */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   384
"/    #define     FAXPROFILE_M                        6       /* !!TIFF/FX FAX profile LM */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   385
"/    #define TIFFTAG_CODINGMETHODS           403     /* !!TIFF/FX coding methods */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   386
"/    #define     CODINGMETHODS_T4_1D         (1 << 1)        /* !!T.4 1D */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   387
"/    #define     CODINGMETHODS_T4_2D         (1 << 2)        /* !!T.4 2D */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   388
"/    #define     CODINGMETHODS_T6            (1 << 3)        /* !!T.6 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   389
"/    #define     CODINGMETHODS_T85           (1 << 4)        /* !!T.85 JBIG */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   390
"/    #define     CODINGMETHODS_T42           (1 << 5)        /* !!T.42 JPEG */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   391
"/    #define     CODINGMETHODS_T43           (1 << 6)        /* !!T.43 colour by layered JBIG */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   392
"/    #define TIFFTAG_VERSIONYEAR                     404     /* !!TIFF/FX version year */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   393
"/    #define TIFFTAG_MODENUMBER                      405     /* !!TIFF/FX mode number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   394
"/    #define TIFFTAG_DECODE                          433     /* !!TIFF/FX decode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   395
"/    #define TIFFTAG_IMAGEBASECOLOR          434     /* !!TIFF/FX image base colour */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   396
"/    #define TIFFTAG_T82OPTIONS                      435     /* !!TIFF/FX T.82 options */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   397
"/    /*
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   398
"/     * 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
   399
"/     * revised JPEG-in-TIFF scheme.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   400
"/     */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   401
"/    #define TIFFTAG_JPEGPROC                512     /* !!JPEG processing algorithm */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   402
"/    #define     JPEGPROC_BASELINE           1       /* !!baseline sequential */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   403
"/    #define     JPEGPROC_LOSSLESS           14      /* !!Huffman coded lossless */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   404
"/    #define TIFFTAG_JPEGIFOFFSET            513     /* !!pointer to SOI marker */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   405
"/    #define TIFFTAG_JPEGIFBYTECOUNT         514     /* !!JFIF stream length */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   406
"/    #define TIFFTAG_JPEGRESTARTINTERVAL     515     /* !!restart interval length */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   407
"/    #define TIFFTAG_JPEGLOSSLESSPREDICTORS  517     /* !!lossless proc predictor */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   408
"/    #define TIFFTAG_JPEGPOINTTRANSFORM      518     /* !!lossless point transform */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   409
"/    #define TIFFTAG_JPEGQTABLES             519     /* !!Q matrix offsets */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   410
"/    #define TIFFTAG_JPEGDCTABLES            520     /* !!DCT table offsets */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   411
"/    #define TIFFTAG_JPEGACTABLES            521     /* !!AC coefficient offsets */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   412
"/    #define TIFFTAG_YCBCRCOEFFICIENTS       529     /* !!RGB -> YCbCr transform */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   413
"/    #define TIFFTAG_YCBCRSUBSAMPLING        530     /* !!YCbCr subsampling factors */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   414
"/    #define TIFFTAG_YCBCRPOSITIONING        531     /* !!subsample positioning */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   415
"/    #define     YCBCRPOSITION_CENTERED      1       /* !!as in PostScript Level 2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   416
"/    #define     YCBCRPOSITION_COSITED       2       /* !!as in CCIR 601-1 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   417
"/    #define TIFFTAG_REFERENCEBLACKWHITE     532     /* !!colorimetry info */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   418
"/    #define TIFFTAG_STRIPROWCOUNTS          559 /* !!TIFF/FX strip row counts */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   419
"/    #define TIFFTAG_XMLPACKET               700     /* %XML packet
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   420
"/                                                       [Adobe XMP Specification,
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   421
"/                                                       January 2004 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   422
"/    #define TIFFTAG_OPIIMAGEID              32781   /* %OPI ImageID
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   423
"/                                                       [Adobe TIFF technote] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   424
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   425
"/    /* tags 32952-32956 are private tags registered to Island Graphics */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   426
"/    #define TIFFTAG_REFPTS                  32953   /* image reference points */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   427
"/    #define TIFFTAG_REGIONTACKPOINT         32954   /* region-xform tack point */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   428
"/    #define TIFFTAG_REGIONWARPCORNERS       32955   /* warp quadrilateral */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   429
"/    #define TIFFTAG_REGIONAFFINE            32956   /* affine transformation mat */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   430
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   431
"/    /* tags 32995-32999 are private tags registered to SGI */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   432
"/    #define TIFFTAG_MATTEING                32995   /* $use ExtraSamples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   433
"/    #define TIFFTAG_DATATYPE                32996   /* $use SampleFormat */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   434
"/    #define TIFFTAG_IMAGEDEPTH              32997   /* z depth of image */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   435
"/    #define TIFFTAG_TILEDEPTH               32998   /* z depth/data tile */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   436
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   437
"/    /* tags 33300-33309 are private tags registered to Pixar */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   438
"/    /*
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   439
"/     * TIFFTAG_PIXAR_IMAGEFULLWIDTH and TIFFTAG_PIXAR_IMAGEFULLLENGTH
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   440
"/     * 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
   441
"/     * They reflect the size of the original uncropped image.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   442
"/     * The TIFFTAG_XPOSITION and TIFFTAG_YPOSITION can be used
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   443
"/     * 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
   444
"/     */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   445
"/    #define TIFFTAG_PIXAR_IMAGEFULLWIDTH    33300   /* full image size in x */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   446
"/    #define TIFFTAG_PIXAR_IMAGEFULLLENGTH   33301   /* full image size in y */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   447
"/     /* 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
   448
"/      * used by Pixar's texture formats.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   449
"/      */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   450
"/    #define TIFFTAG_PIXAR_TEXTUREFORMAT     33302   /* texture map format */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   451
"/    #define TIFFTAG_PIXAR_WRAPMODES         33303   /* s & t wrap modes */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   452
"/    #define TIFFTAG_PIXAR_FOVCOT            33304   /* cotan(fov) for env. maps */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   453
"/    #define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN 33305
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   454
"/    #define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA 33306
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   455
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   456
"/    /* tag 33405 is a private tag registered to Eastman Kodak */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   457
"/    #define TIFFTAG_WRITERSERIALNUMBER      33405   /* device serial number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   458
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   459
"/    #define TIFFTAG_CFAREPEATPATTERNDIM     33421   /* dimensions of CFA pattern */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   460
"/    #define TIFFTAG_CFAPATTERN              33422   /* color filter array pattern */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   461
"/    /* 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
   462
"/    #define TIFFTAG_COPYRIGHT               33432   /* copyright string */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   463
"/    /* IPTC TAG from RichTIFF specifications */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   464
"/    #define TIFFTAG_RICHTIFFIPTC            33723
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   465
"/    /* 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
   466
"/    #define TIFFTAG_IT8SITE                 34016   /* site name */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   467
"/    #define TIFFTAG_IT8COLORSEQUENCE        34017   /* color seq. [RGB,CMYK,etc] */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   468
"/    #define TIFFTAG_IT8HEADER               34018   /* DDES Header */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   469
"/    #define TIFFTAG_IT8RASTERPADDING        34019   /* raster scanline padding */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   470
"/    #define TIFFTAG_IT8BITSPERRUNLENGTH     34020   /* # of bits in short run */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   471
"/    #define TIFFTAG_IT8BITSPEREXTENDEDRUNLENGTH 34021/* # of bits in long run */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   472
"/    #define TIFFTAG_IT8COLORTABLE           34022   /* LW colortable */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   473
"/    #define TIFFTAG_IT8IMAGECOLORINDICATOR  34023   /* BP/BL image color switch */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   474
"/    #define TIFFTAG_IT8BKGCOLORINDICATOR    34024   /* BP/BL bg color switch */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   475
"/    #define TIFFTAG_IT8IMAGECOLORVALUE      34025   /* BP/BL image color value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   476
"/    #define TIFFTAG_IT8BKGCOLORVALUE        34026   /* BP/BL bg color value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   477
"/    #define TIFFTAG_IT8PIXELINTENSITYRANGE  34027   /* MP pixel intensity value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   478
"/    #define TIFFTAG_IT8TRANSPARENCYINDICATOR 34028  /* HC transparency switch */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   479
"/    #define TIFFTAG_IT8COLORCHARACTERIZATION 34029  /* color character. table */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   480
"/    #define TIFFTAG_IT8HCUSAGE              34030   /* HC usage indicator */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   481
"/    #define TIFFTAG_IT8TRAPINDICATOR        34031   /* Trapping indicator
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   482
"/                                                       (untrapped=0, trapped=1) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   483
"/    #define TIFFTAG_IT8CMYKEQUIVALENT       34032   /* CMYK color equivalents */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   484
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   485
"/    /* tags 34232-34236 are private tags registered to Texas Instruments */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   486
"/    #define TIFFTAG_FRAMECOUNT              34232   /* Sequence Frame Count */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   487
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   488
"/    /* tag 34377 is private tag registered to Adobe for PhotoShop */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   489
"/    #define TIFFTAG_PHOTOSHOP               34377 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   490
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   491
"/    /* tags 34665, 34853 and 40965 are documented in EXIF specification */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   492
"/    #define TIFFTAG_EXIFIFD                 34665   /* Pointer to EXIF private directory */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   493
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   494
"/    /* tag 34750 is a private tag registered to Adobe? */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   495
"/    #define TIFFTAG_ICCPROFILE              34675   /* ICC profile data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   496
"/    #define TIFFTAG_IMAGELAYER              34732   /* !!TIFF/FX image layer information */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   497
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   498
"/    /* tag 34750 is a private tag registered to Pixel Magic */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   499
"/    #define TIFFTAG_JBIGOPTIONS             34750   /* JBIG options */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   500
"/    #define TIFFTAG_GPSIFD                  34853   /* Pointer to GPS private directory */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   501
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   502
"/    /* tags 34908-34914 are private tags registered to SGI */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   503
"/    #define TIFFTAG_FAXRECVPARAMS           34908   /* encoded Class 2 ses. parms */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   504
"/    #define TIFFTAG_FAXSUBADDRESS           34909   /* received SubAddr string */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   505
"/    #define TIFFTAG_FAXRECVTIME             34910   /* receive time (secs) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   506
"/    #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
   507
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   508
"/    /* tags 37439-37443 are registered to SGI <gregl@sgi.com> */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   509
"/    #define TIFFTAG_STONITS                 37439   /* Sample value to Nits */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   510
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   511
"/    /* tag 34929 is a private tag registered to FedEx */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   512
"/    #define TIFFTAG_FEDEX_EDR               34929   /* unknown use */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   513
"/    #define TIFFTAG_INTEROPERABILITYIFD     40965   /* Pointer to Interoperability private directory */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   514
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
    "/ Adobe Digital Negative (DNG) format tags
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   517
    "/
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
"/    #define TIFFTAG_DNGVERSION              50706   /* &DNG version number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   520
"/    #define TIFFTAG_DNGBACKWARDVERSION      50707   /* &DNG compatibility version */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   521
"/    #define TIFFTAG_UNIQUECAMERAMODEL       50708   /* &name for the camera model */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   522
"/    #define TIFFTAG_LOCALIZEDCAMERAMODEL    50709   /* &localized camera model name */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   523
"/    #define TIFFTAG_CFAPLANECOLOR           50710   /* &CFAPattern->LinearRaw space mapping */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   524
"/    #define TIFFTAG_CFALAYOUT               50711   /* &spatial layout of the CFA */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   525
"/    #define TIFFTAG_LINEARIZATIONTABLE      50712   /* &lookup table description */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   526
"/    #define TIFFTAG_BLACKLEVELREPEATDIM     50713   /* &repeat pattern size for the BlackLevel tag */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   527
"/    #define TIFFTAG_BLACKLEVEL              50714   /* &zero light encoding level */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   528
"/    #define TIFFTAG_BLACKLEVELDELTAH        50715   /* &zero light encoding level differences (columns) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   529
"/    #define TIFFTAG_BLACKLEVELDELTAV        50716   /* &zero light encoding level differences (rows) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   530
"/    #define TIFFTAG_WHITELEVEL              50717   /* &fully saturated encoding level */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   531
"/    #define TIFFTAG_DEFAULTSCALE            50718   /* &default scale factors */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   532
"/    #define TIFFTAG_DEFAULTCROPORIGIN       50719   /* &origin of the final image area */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   533
"/    #define TIFFTAG_DEFAULTCROPSIZE         50720   /* &size of the final image area */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   534
"/    #define TIFFTAG_COLORMATRIX1            50721   /* &XYZ->reference color space transformation matrix 1 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   535
"/    #define TIFFTAG_COLORMATRIX2            50722   /* &XYZ->reference color space transformation matrix 2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   536
"/    #define TIFFTAG_CAMERACALIBRATION1      50723   /* &calibration matrix 1 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   537
"/    #define TIFFTAG_CAMERACALIBRATION2      50724   /* &calibration matrix 2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   538
"/    #define TIFFTAG_REDUCTIONMATRIX1        50725   /* &dimensionality reduction matrix 1 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   539
"/    #define TIFFTAG_REDUCTIONMATRIX2        50726   /* &dimensionality reduction matrix 2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   540
"/    #define TIFFTAG_ANALOGBALANCE           50727   /* &gain applied the stored raw values*/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   541
"/    #define TIFFTAG_ASSHOTNEUTRAL           50728   /* &selected white balance in linear reference space */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   542
"/    #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
   543
"/    #define TIFFTAG_BASELINEEXPOSURE        50730   /* &how much to move the zero point */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   544
"/    #define TIFFTAG_BASELINENOISE           50731   /* &relative noise level */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   545
"/    #define TIFFTAG_BASELINESHARPNESS       50732   /* &relative amount of sharpening */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   546
"/    #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
   547
"/    #define TIFFTAG_LINEARRESPONSELIMIT     50734   /* &non-linear encoding range */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   548
"/    #define TIFFTAG_CAMERASERIALNUMBER      50735   /* &camera's serial number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   549
"/    #define TIFFTAG_LENSINFO                50736   /* info about the lens */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   550
"/    #define TIFFTAG_CHROMABLURRADIUS        50737   /* &chroma blur radius */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   551
"/    #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
   552
"/    #define TIFFTAG_SHADOWSCALE             50739   /* &used by Adobe Camera Raw */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   553
"/    #define TIFFTAG_DNGPRIVATEDATA          50740   /* &manufacturer's private data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   554
"/    #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
   555
"/    #define TIFFTAG_CALIBRATIONILLUMINANT1  50778   /* &illuminant 1 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   556
"/    #define TIFFTAG_CALIBRATIONILLUMINANT2  50779   /* &illuminant 2 */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   557
"/    #define TIFFTAG_BESTQUALITYSCALE        50780   /* &best quality multiplier */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   558
"/    #define TIFFTAG_RAWDATAUNIQUEID         50781   /* &unique identifier for the raw image data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   559
"/    #define TIFFTAG_ORIGINALRAWFILENAME     50827   /* &file name of the original raw file */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   560
"/    #define TIFFTAG_ORIGINALRAWFILEDATA     50828   /* &contents of the original raw file */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   561
"/    #define TIFFTAG_ACTIVEAREA              50829   /* &active (non-masked) pixels of the sensor */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   562
"/    #define TIFFTAG_MASKEDAREAS             50830   /* &list of coordinates of fully masked pixels */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   563
"/    #define TIFFTAG_ASSHOTICCPROFILE        50831   /* &these two tags used to */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   564
"/    #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
   565
"/    #define TIFFTAG_CURRENTICCPROFILE       50833   /* & */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   566
"/    #define TIFFTAG_CURRENTPREPROFILEMATRIX 50834   /* & */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   567
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   568
"/    /* tag 65535 is an undefined tag used by Eastman Kodak */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   569
"/    #define TIFFTAG_DCSHUESHIFTVALUES       65535   /* hue shift correction data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   570
"/
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
"/     * The following are ``pseudo tags'' that can be used to control
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   573
"/     * codec-specific functionality.  These tags are not written to file.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   574
"/     * 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
   575
"/     * collide with Aldus-assigned tags.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   576
"/     *
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   577
"/     * 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
   578
"/     * 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
   579
"/     * http://www.remotesensing.org/libtiff/bugs.html with the appropriate
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   580
"/     * C definitions to add.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   581
"/     */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   582
"/    #define TIFFTAG_FAXMODE                 65536   /* Group 3/4 format control */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   583
"/    #define     FAXMODE_CLASSIC     0x0000          /* default, include RTC */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   584
"/    #define     FAXMODE_NORTC       0x0001          /* no RTC at end of data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   585
"/    #define     FAXMODE_NOEOL       0x0002          /* no EOL code at end of row */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   586
"/    #define     FAXMODE_BYTEALIGN   0x0004          /* byte align row */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   587
"/    #define     FAXMODE_WORDALIGN   0x0008          /* word align row */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   588
"/    #define     FAXMODE_CLASSF      FAXMODE_NORTC   /* TIFF Class F */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   589
"/    #define TIFFTAG_JPEGQUALITY             65537   /* Compression quality level */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   590
"/    /* 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
   591
"/    #define TIFFTAG_JPEGCOLORMODE           65538   /* Auto RGB<=>YCbCr convert? */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   592
"/    #define     JPEGCOLORMODE_RAW   0x0000          /* no conversion (default) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   593
"/    #define     JPEGCOLORMODE_RGB   0x0001          /* do auto conversion */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   594
"/    #define TIFFTAG_JPEGTABLESMODE          65539   /* What to put in JPEGTables */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   595
"/    #define     JPEGTABLESMODE_QUANT 0x0001         /* include quantization tbls */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   596
"/    #define     JPEGTABLESMODE_HUFF 0x0002          /* include Huffman tbls */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   597
"/    /* Note: default is JPEGTABLESMODE_QUANT | JPEGTABLESMODE_HUFF */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   598
"/    #define TIFFTAG_FAXFILLFUNC             65540   /* G3/G4 fill function */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   599
"/    #define TIFFTAG_PIXARLOGDATAFMT         65549   /* PixarLogCodec I/O data sz */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   600
"/    #define     PIXARLOGDATAFMT_8BIT        0       /* regular u_char samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   601
"/    #define     PIXARLOGDATAFMT_8BITABGR    1       /* ABGR-order u_chars */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   602
"/    #define     PIXARLOGDATAFMT_11BITLOG    2       /* 11-bit log-encoded (raw) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   603
"/    #define     PIXARLOGDATAFMT_12BITPICIO  3       /* as per PICIO (1.0==2048) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   604
"/    #define     PIXARLOGDATAFMT_16BIT       4       /* signed short samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   605
"/    #define     PIXARLOGDATAFMT_FLOAT       5       /* IEEE float samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   606
"/    /* 65550-65556 are allocated to Oceana Matrix <dev@oceana.com> */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   607
"/    #define TIFFTAG_DCSIMAGERTYPE           65550   /* imager model & filter */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   608
"/    #define     DCSIMAGERMODEL_M3           0       /* M3 chip (1280 x 1024) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   609
"/    #define     DCSIMAGERMODEL_M5           1       /* M5 chip (1536 x 1024) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   610
"/    #define     DCSIMAGERMODEL_M6           2       /* M6 chip (3072 x 2048) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   611
"/    #define     DCSIMAGERFILTER_IR          0       /* infrared filter */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   612
"/    #define     DCSIMAGERFILTER_MONO        1       /* monochrome filter */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   613
"/    #define     DCSIMAGERFILTER_CFA         2       /* color filter array */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   614
"/    #define     DCSIMAGERFILTER_OTHER       3       /* other filter */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   615
"/    #define TIFFTAG_DCSINTERPMODE           65551   /* interpolation mode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   616
"/    #define     DCSINTERPMODE_NORMAL        0x0     /* whole image, default */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   617
"/    #define     DCSINTERPMODE_PREVIEW       0x1     /* preview of image (384x256) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   618
"/    #define TIFFTAG_DCSBALANCEARRAY         65552   /* color balance values */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   619
"/    #define TIFFTAG_DCSCORRECTMATRIX        65553   /* color correction values */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   620
"/    #define TIFFTAG_DCSGAMMA                65554   /* gamma value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   621
"/    #define TIFFTAG_DCSTOESHOULDERPTS       65555   /* toe & shoulder points */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   622
"/    #define TIFFTAG_DCSCALIBRATIONFD        65556   /* calibration file desc */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   623
"/    /* 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
   624
"/    #define TIFFTAG_ZIPQUALITY              65557   /* compression quality level */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   625
"/    #define TIFFTAG_PIXARLOGQUALITY         65558   /* PixarLog uses same scale */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   626
"/    /* 65559 is allocated to Oceana Matrix <dev@oceana.com> */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   627
"/    #define TIFFTAG_DCSCLIPRECTANGLE        65559   /* area of image to acquire */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   628
"/    #define TIFFTAG_SGILOGDATAFMT           65560   /* SGILog user data format */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   629
"/    #define     SGILOGDATAFMT_FLOAT         0       /* IEEE float samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   630
"/    #define     SGILOGDATAFMT_16BIT         1       /* 16-bit samples */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   631
"/    #define     SGILOGDATAFMT_RAW           2       /* uninterpreted data */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   632
"/    #define     SGILOGDATAFMT_8BIT          3       /* 8-bit RGB monitor values */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   633
"/    #define TIFFTAG_SGILOGENCODE            65561 /* SGILog data encoding control*/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   634
"/    #define     SGILOGENCODE_NODITHER       0     /* do not dither encoded values*/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   635
"/    #define     SGILOGENCODE_RANDITHER      1     /* randomly dither encd values */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   636
"/    #define TIFFTAG_LZMAPRESET              65562   /* LZMA2 preset (compression level) */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   637
"/    #define TIFFTAG_PERSAMPLE       65563   /* interface for per sample tags */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   638
"/    #define     PERSAMPLE_MERGED        0   /* present as a single value */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   639
"/    #define     PERSAMPLE_MULTI         1   /* present as multiple values */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   640
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
    "/ EXIF tags
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   643
    "/
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   644
"/    #define EXIFTAG_EXPOSURETIME            33434   /* Exposure time */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   645
"/    #define EXIFTAG_FNUMBER                 33437   /* F number */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   646
"/    #define EXIFTAG_EXPOSUREPROGRAM         34850   /* Exposure program */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   647
"/    #define EXIFTAG_SPECTRALSENSITIVITY     34852   /* Spectral sensitivity */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   648
"/    #define EXIFTAG_ISOSPEEDRATINGS         34855   /* ISO speed rating */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   649
"/    #define EXIFTAG_OECF                    34856   /* Optoelectric conversion factor */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   650
"/    #define EXIFTAG_EXIFVERSION             36864   /* Exif version */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   651
"/    #define EXIFTAG_DATETIMEORIGINAL        36867   /* Date and time of original data generation */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   652
"/    #define EXIFTAG_DATETIMEDIGITIZED       36868   /* Date and time of digital data generation */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   653
"/    #define EXIFTAG_COMPONENTSCONFIGURATION 37121   /* Meaning of each component */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   654
"/    #define EXIFTAG_COMPRESSEDBITSPERPIXEL  37122   /* Image compression mode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   655
"/    #define EXIFTAG_SHUTTERSPEEDVALUE       37377   /* Shutter speed */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   656
"/    #define EXIFTAG_APERTUREVALUE           37378   /* Aperture */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   657
"/    #define EXIFTAG_BRIGHTNESSVALUE         37379   /* Brightness */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   658
"/    #define EXIFTAG_EXPOSUREBIASVALUE       37380   /* Exposure bias */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   659
"/    #define EXIFTAG_MAXAPERTUREVALUE        37381   /* Maximum lens aperture */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   660
"/    #define EXIFTAG_SUBJECTDISTANCE         37382   /* Subject distance */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   661
"/    #define EXIFTAG_METERINGMODE            37383   /* Metering mode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   662
"/    #define EXIFTAG_LIGHTSOURCE             37384   /* Light source */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   663
"/    #define EXIFTAG_FLASH                   37385   /* Flash */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   664
"/    #define EXIFTAG_FOCALLENGTH             37386   /* Lens focal length */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   665
"/    #define EXIFTAG_SUBJECTAREA             37396   /* Subject area */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   666
"/    #define EXIFTAG_MAKERNOTE               37500   /* Manufacturer notes */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   667
"/    #define EXIFTAG_USERCOMMENT             37510   /* User comments */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   668
"/    #define EXIFTAG_SUBSECTIME              37520   /* DateTime subseconds */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   669
"/    #define EXIFTAG_SUBSECTIMEORIGINAL      37521   /* DateTimeOriginal subseconds */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   670
"/    #define EXIFTAG_SUBSECTIMEDIGITIZED     37522   /* DateTimeDigitized subseconds */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   671
"/    #define EXIFTAG_FLASHPIXVERSION         40960   /* Supported Flashpix version */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   672
"/    #define EXIFTAG_COLORSPACE              40961   /* Color space information */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   673
"/    #define EXIFTAG_PIXELXDIMENSION         40962   /* Valid image width */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   674
"/    #define EXIFTAG_PIXELYDIMENSION         40963   /* Valid image height */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   675
"/    #define EXIFTAG_RELATEDSOUNDFILE        40964   /* Related audio file */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   676
"/    #define EXIFTAG_FLASHENERGY             41483   /* Flash energy */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   677
"/    #define EXIFTAG_SPATIALFREQUENCYRESPONSE 41484  /* Spatial frequency response */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   678
"/    #define EXIFTAG_FOCALPLANEXRESOLUTION   41486   /* Focal plane X resolution */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   679
"/    #define EXIFTAG_FOCALPLANEYRESOLUTION   41487   /* Focal plane Y resolution */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   680
"/    #define EXIFTAG_FOCALPLANERESOLUTIONUNIT 41488  /* Focal plane resolution unit */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   681
"/    #define EXIFTAG_SUBJECTLOCATION         41492   /* Subject location */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   682
"/    #define EXIFTAG_EXPOSUREINDEX           41493   /* Exposure index */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   683
"/    #define EXIFTAG_SENSINGMETHOD           41495   /* Sensing method */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   684
"/    #define EXIFTAG_FILESOURCE              41728   /* File source */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   685
"/    #define EXIFTAG_SCENETYPE               41729   /* Scene type */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   686
"/    #define EXIFTAG_CFAPATTERN              41730   /* CFA pattern */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   687
"/    #define EXIFTAG_CUSTOMRENDERED          41985   /* Custom image processing */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   688
"/    #define EXIFTAG_EXPOSUREMODE            41986   /* Exposure mode */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   689
"/    #define EXIFTAG_WHITEBALANCE            41987   /* White balance */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   690
"/    #define EXIFTAG_DIGITALZOOMRATIO        41988   /* Digital zoom ratio */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   691
"/    #define EXIFTAG_FOCALLENGTHIN35MMFILM   41989   /* Focal length in 35 mm film */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   692
"/    #define EXIFTAG_SCENECAPTURETYPE        41990   /* Scene capture type */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   693
"/    #define EXIFTAG_GAINCONTROL             41991   /* Gain control */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   694
"/    #define EXIFTAG_CONTRAST                41992   /* Contrast */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   695
"/    #define EXIFTAG_SATURATION              41993   /* Saturation */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   696
"/    #define EXIFTAG_SHARPNESS               41994   /* Sharpness */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   697
"/    #define EXIFTAG_DEVICESETTINGDESCRIPTION 41995  /* Device settings description */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   698
"/    #define EXIFTAG_SUBJECTDISTANCERANGE    41996   /* Subject distance range */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   699
"/    #define EXIFTAG_GAINCONTROL             41991   /* Gain control */
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_IMAGEUNIQUEID           42016   /* Unique image ID */
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   702
392
7729a280960c handle bottom-to-top images (orientation==4)
Claus Gittinger <cg@exept.de>
parents: 359
diff changeset
   703
    "
7729a280960c handle bottom-to-top images (orientation==4)
Claus Gittinger <cg@exept.de>
parents: 359
diff changeset
   704
     self initialize
7729a280960c handle bottom-to-top images (orientation==4)
Claus Gittinger <cg@exept.de>
parents: 359
diff changeset
   705
    "
7729a280960c handle bottom-to-top images (orientation==4)
Claus Gittinger <cg@exept.de>
parents: 359
diff changeset
   706
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
   707
    "Modified: / 28-08-2017 / 00:46:15 / cg"
28
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
   708
! !
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
   709
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   710
!TIFFReader class methodsFor:'testing'!
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
   711
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   712
canRepresent:anImage
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   713
    "return true, if anImage can be represented in my file format.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   714
     Any image is supported."
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   715
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   716
    ^ true
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   717
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   718
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
   719
isValidImageFile:aFileName
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   720
    "return true, if aFileName contains a TIFF image"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   721
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   722
    |inStream bytes1_2 byte3 byte4 versionLow versionHi|
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
   723
11
1d0df18a7049 *** empty log message ***
claus
parents: 6
diff changeset
   724
    inStream := self streamReadingFile:aFileName.
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
   725
    inStream isNil ifTrue:[^ false].
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
   726
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   727
    bytes1_2 := inStream next:2.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   728
    byte3 := inStream nextByte.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   729
    byte4 := inStream nextByte.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   730
    inStream close.
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"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   750
! !
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   751
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   752
!TIFFReader methodsFor:'accessing'!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   753
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   754
decodeMetaTags:aBoolean
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   755
    "by default, extra meta tags (photoshop) are not decoded;
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   756
     set to true to get them in metatags"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   757
     
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   758
    decodeMetaTags := aBoolean.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   759
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   760
    "Modified (comment): / 27-08-2017 / 18:37:04 / cg"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   761
!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   762
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   763
loadFullResolutionImage:aBoolean
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   764
    "by default, the full-resolution dng image is not decoded;
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   765
     set to true to get it in the imageSequence"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   766
     
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   767
    loadFullResolutionImage := aBoolean.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   768
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   769
    "Created: / 27-08-2017 / 18:41:48 / cg"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   770
! !
3f9277473954 Initial revision
claus
parents:
diff changeset
   771
1762
55cf76514c8c method category rename
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
   772
!TIFFReader methodsFor:'private-data reading'!
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   773
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   774
readAdobeDeflateTiffImageData
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   775
    ^ self readDeflateTiffImageData
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   776
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   777
    "Created: / 26-08-2017 / 14:44:35 / cg"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   778
    "Modified: / 27-08-2017 / 18:55:11 / cg"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   779
!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   780
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   781
readCCITT3RLETiffImageData
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   782
    ^ 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
   783
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   784
    "Modified: / 3.2.1998 / 18:03:14 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   785
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   786
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   787
readCCITT3RLEWTiffImageData
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   788
    ^ 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
   789
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   790
    "Modified: / 3.2.1998 / 18:03:30 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   791
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   792
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   793
readCCITTGroup3TiffImageData
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   794
    "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
   795
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   796
    |bytesPerRow bitsPerRow compressedStrip nPlanes 
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   797
     stripNr       "{ Class: SmallInteger }"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   798
     offset        "{ Class: SmallInteger }"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   799
     row           "{ Class: SmallInteger }"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   800
     bytesPerStrip "{ Class: SmallInteger }" 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   801
     count dstIndex|
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   802
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   803
    nPlanes := samplesPerPixel.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   804
    (nPlanes ~~ 1) ifTrue:[
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   805
        (nPlanes == 2) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   806
            (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   807
                ^ self fileFormatError:'only separate planes are supported'.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   808
            ].
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   809
            'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   810
            nPlanes := 1
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   811
        ] ifFalse:[
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   812
            ^ self fileFormatError:'only monochrome/greyscale ccitt3supported'.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   813
        ].   
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   814
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   815
    stripRowCounts notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   816
        ^ self fileFormatError:'stripRowCounts not supported'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   817
    ].
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   818
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   819
"/    (rowsPerStrip ~~ 1) ifTrue:[
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   820
"/        ^ self fileFormatError:'currently require rowsPerStrip to be 1'.
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   821
"/    ].
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   822
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   823
    "/ 'TIFFReader: decompressing CCITT-3 ...' infoPrintNL.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   824
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   825
    bitsPerRow := width * (bitsPerSample at:1).
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   826
    bytesPerRow := bitsPerRow // 8.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   827
    ((bitsPerRow \\ 8) ~~ 0) ifTrue:[
335
a32831edacc5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   828
        bytesPerRow := bytesPerRow + 1
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   829
    ].
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   830
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   831
    data := ByteArray new:(bytesPerRow * height).
3977
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
    "/ if the number of rows per strip is unknown (-1),
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   834
    "/ make it one big strip and decompress that
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   835
    rowsPerStrip = 16rFFFFFFFF ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   836
        self assert:(stripByteCounts size == 1).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   837
        count := stripByteCounts sum.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   838
        compressedStrip := ByteArray uninitializedNew:count.
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   839
        self positionToStrip:1.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   840
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   841
        (inStream nextBytes:count into:compressedStrip) == count ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   842
            self error:'short read'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   843
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   844
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   845
        compressedStrip := compressedStrip copyFrom:16r227.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   846
        
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   847
        dstIndex := self class 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   848
                    _decompressCCITT3From:compressedStrip
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   849
                    count:count
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   850
                    into:data
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   851
                    startingAt:1.
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   852
        ^ self 
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   853
    ].
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
   854
    
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   855
    compressedStrip := ByteArray uninitializedNew:bytesPerRow.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   856
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   857
    offset := 1.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   858
    stripNr := 1.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   859
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   860
    row := 1.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   861
    bytesPerStrip := bytesPerRow * rowsPerStrip.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   862
    [row <= height] whileTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   863
        self positionToStrip:stripNr.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   864
        count := stripByteCounts at:stripNr.
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
        dstIndex := self class 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   869
                    _decompressCCITT3From:compressedStrip
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   870
                    count:count
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   871
                    into:data
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   872
                    startingAt:offset
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   873
                    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
   874
        offset := offset + bytesPerStrip.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   875
        row := row + rowsPerStrip.
335
a32831edacc5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   876
        stripNr := stripNr + 1.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   877
    ]
335
a32831edacc5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   878
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   879
    "
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   880
     TIFFReader fromFile:'/Users/cg/DownloadsUnsaved/image_software/libtiffpic/g3test.tif'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   881
    "
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   882
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
   883
    "Modified: / 27-08-2017 / 15:37:51 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   884
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   885
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   886
readCCITTGroup4TiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   887
    ^ self fileFormatError:'ccitt group4 fax compression not implemented'.
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   888
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   889
    "Modified: / 3.2.1998 / 18:04:34 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   890
!
0
3f9277473954 Initial revision
claus
parents:
diff changeset
   891
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   892
readCCITTRLEWTiffImageData
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   893
    ^ self fileFormatError:'ccitt mod Huffman (rlew) compression not implemented'
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   894
!
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
   895
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   896
readDCSTiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   897
    ^ self fileFormatError:'dcs compression not implemented'.
329
5fb99e0734e4 handle empty character-strings
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   898
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
   899
    "Modified: / 3.2.1998 / 18:04:44 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   900
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
   901
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   902
readDeflateTiffImageData
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
   903
    self readImageDataUsingDecompressor:
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   904
        [:inBytes :inCount :outBytes :outOffset :outCount |
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   905
            |zlibReader|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   906
            
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   907
            zlibReader := ZipStream readOpenAsZipStreamOn:(inBytes readStream) suppressHeaderAndChecksum:false.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   908
            zlibReader binary.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   909
            zlibReader next:outCount into:outBytes startingAt:outOffset.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   910
            outCount.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   911
        ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   912
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   913
"/    |bytesPerRowIn bytesPerRow nPlanes overAllBytes
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   914
"/     bytesPerStrip "{ Class: SmallInteger }"
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   915
"/     nBytes        "{ Class: SmallInteger }"
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   916
"/     stripNr       "{ Class: SmallInteger }"
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   917
"/     offset        "{ Class: SmallInteger }"
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   918
"/     row           "{ Class: SmallInteger }" 
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   919
"/     zlibReader nread msb
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   920
"/     convertFloats convertDoubles conversionBuffer|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   921
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   922
"/    nPlanes := samplesPerPixel.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   923
"/    convertFloats := convertDoubles := false.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   924
"/    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   925
"/    (nPlanes >= 3) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   926
"/        bytesPerRowIn := width * ((bitsPerSample sum + 7) // 8).
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   927
"/        (bitsPerSample conform:[:each | each == 8]) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   928
"/            sampleFormat == SAMPLEFORMAT_UINT ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   929
"/                ^ self fileFormatError:'unsupported sample format'.
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
"/        ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   932
"/            sampleFormat == SAMPLEFORMAT_IEEEFP ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   933
"/                nPlanes == 3 ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   934
"/                    (bitsPerSample conform:[:each | each == 64]) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   935
"/                        convertDoubles := true.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   936
"/                        bytesPerRow := width * nPlanes.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   937
"/                        bitsPerSample := #(8 8 8).
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   938
"/                    ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   939
"/                        (bitsPerSample conform:[:each | each == 32]) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   940
"/                            convertFloats := true.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   941
"/                            bytesPerRow := width * nPlanes.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   942
"/                            bitsPerSample := #(8 8 8).
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   943
"/                        ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   944
"/                            ^ 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
   945
"/                        ].    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   946
"/                    ].    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   947
"/                ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   948
"/                    ^ self fileFormatError:'only support 3 planes with IEEE_FP sample format'.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   949
"/                ]    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   950
"/            ] ifFalse:[    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   951
"/                ^ self fileFormatError:'unsupported sample format'.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   952
"/            ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   953
"/        ]
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   954
"/    ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   955
"/        (nPlanes == 2) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   956
"/            (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   957
"/                ^ self fileFormatError:'only separate planes are supported'.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   958
"/            ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   959
"/            'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   960
"/            nPlanes := 1
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   961
"/        ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   962
"/        (nPlanes == 1) ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   963
"/            ^ 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
   964
"/        ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   965
"/        bytesPerRowIn := (width * (bitsPerSample at:1) + 7) // 8.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   966
"/    ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   967
"/    stripRowCounts notNil ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   968
"/        ^ self fileFormatError:'stripRowCounts not supported'.
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
"/    "/ 'TIFFReader: decompressing Deflate ...' infoPrintNL.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   972
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   973
"/    bytesPerRow isNil ifTrue:[ bytesPerRow := bytesPerRowIn ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   974
"/    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   975
"/    overAllBytes := bytesPerRow * height.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   976
"/    data := ByteArray new:overAllBytes.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   977
"/    (convertFloats or:[convertDoubles]) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   978
"/        conversionBuffer := ByteArray new:(bytesPerRowIn * rowsPerStrip).
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   979
"/    ].    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   980
"/    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   981
"/    offset := 1.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   982
"/    stripNr := 0.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   983
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   984
"/    row := 1.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   985
"/    bytesPerStrip := bytesPerRow * rowsPerStrip.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   986
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   987
"/    [row <= height] whileTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   988
"/        stripNr := stripNr + 1.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   989
"/        self positionToStrip:stripNr.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   990
"/        nBytes := stripByteCounts at:stripNr.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   991
"/        
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   992
"/        zlibReader := ZipStream readOpenAsZipStreamOn:inStream suppressHeaderAndChecksum:false.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   993
"/        zlibReader binary.
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
"/        conversionBuffer notNil ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   996
"/            nread := zlibReader next:nBytes into:conversionBuffer startingAt:1.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   997
"/            msb := (byteOrder == #msb).
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   998
"/            convertFloats ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
   999
"/                |i|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1000
"/
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1001
"/                self assert:(nread \\ 4) == 0.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1002
"/                i := 0.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1003
"/                1 to:nread-1 by:4 do:[:iF |
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1004
"/                    |dVal byteVal|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1005
"/                    dVal := conversionBuffer floatAt:iF MSB:msb.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1006
"/                    "/ rescale from 0..1 to 0..255
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1007
"/                    byteVal := (dVal * 255) asInteger clampBetween:0 and:255.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1008
"/                    data at:offset+i put:byteVal.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1009
"/                    i := i + 1.
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
"/            ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1012
"/                convertDoubles ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1013
"/                    |i|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1014
"/                    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1015
"/                    self assert:(nread \\ 8) == 0.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1016
"/                    i := 0.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1017
"/                    1 to:nread-1 by:8 do:[:iF |
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1018
"/                        |dVal byteVal|
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1019
"/                        dVal := conversionBuffer doubleAt:iF MSB:msb.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1020
"/                        "/ rescale from 0..1 to 0..255
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1021
"/                        byteVal := (dVal * 255) asInteger clampBetween:0 and:255.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1022
"/                        data at:offset+i put:byteVal.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1023
"/                        i := i + 1.
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
"/                ]
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1026
"/            ].    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1027
"/        ] ifFalse:[    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1028
"/            nread := zlibReader next:nBytes into:data startingAt:offset.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1029
"/        ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1030
"/        
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1031
"/        offset := offset + bytesPerStrip.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1032
"/        row := row + rowsPerStrip
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1033
"/    ].
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
"/    (predictor ~~ 1) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1036
"/        (predictor == 2) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1037
"/            self class decodeDelta:nPlanes in:data width:width height:height
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1038
"/        ] ifFalse:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1039
"/            ^ self fileFormatError:'unsupported predictor'
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1040
"/        ].    
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1041
"/    ]
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1042
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1043
    "Modified: / 29-08-2017 / 23:14:55 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1044
!
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1045
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1046
readImageDataUsingDecompressor:decompressorBlock
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1047
    |bytesPerRowIn bytesPerRow nPlanes overAllBytes
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1048
     nBytes        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1049
     stripNr       "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1050
     offset        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1051
     row           "{ Class: SmallInteger }" 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1052
     msb
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1053
     convert convertFloats convertDoubles convertHalfFloats 
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1054
     swapInt16s convertFillOrder
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1055
     inBuffer conversionBuffer floats nDecompressed 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1056
     rowsInThisStrip bytesInThisStrip|
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1057
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1058
    nPlanes := samplesPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1059
    convert := convertFloats := convertDoubles := convertHalfFloats := false.
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1060
    swapInt16s := convertFillOrder := false.
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1061
    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1062
    (nPlanes >= 3) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1063
        (planarConfiguration ~~ PLANARCONFIG_CONTIG) ifTrue:[
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1064
            ^ 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
  1065
        ].
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1066
        (nPlanes > 4) ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1067
            photometric == #cmyk ifTrue:[
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1068
                "/ ignore alpha
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1069
                'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1070
                nPlanes := samplesPerPixel := 4.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1071
                bitsPerSample := bitsPerSample copyTo:4.
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1072
            ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1073
        ].
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1074
        
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1075
        bytesPerRowIn := width * ((bitsPerSample sum + 7) // 8).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1076
        sampleFormat == SAMPLEFORMAT_UINT ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1077
            (bitsPerSample conform:[:each | each == 8]) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1078
                "/ ok
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1079
            ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1080
                (bitsPerSample conform:[:each | each == 16]) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1081
                    "/ ok
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1082
                ] ifFalse:[
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1083
                    ^ 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
  1084
                ]
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
        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1087
            sampleFormat == SAMPLEFORMAT_IEEEFP ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1088
                nPlanes == 3 ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1089
                    (bitsPerSample conform:[:each | each == 64]) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1090
                        convertDoubles := convert := true.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1091
                        bytesPerRow := width * nPlanes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1092
                        bitsPerSample := #(8 8 8).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1093
                    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1094
                        (bitsPerSample conform:[:each | each == 32]) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1095
                            convertFloats := convert := true.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1096
                            bytesPerRow := width * nPlanes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1097
                            bitsPerSample := #(8 8 8).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1098
                        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1099
                            (bitsPerSample conform:[:each | each == 16]) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1100
                                convertHalfFloats := convert := true.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1101
                                bytesPerRow := width * nPlanes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1102
                                bitsPerSample := #(8 8 8).
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
                                ^ 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
  1105
                            ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1106
                        ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1107
                    ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1108
                ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1109
                    ^ self fileFormatError:'only support 3 planes with IEEE_FP sample format'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1110
                ]    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1111
            ] ifFalse:[    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1112
                ^ self fileFormatError:'unsupported sample format'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1113
            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1114
        ]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1115
    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1116
        (nPlanes == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1117
            (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1118
                ^ self fileFormatError:'only separate planes are supported with 2 planes'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1119
            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1120
            'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1121
            nPlanes := 1
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1122
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1123
        (nPlanes == 1) ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1124
            ^ 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
  1125
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1126
        bytesPerRowIn := (width * (bitsPerSample at:1) + 7) // 8.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1127
        (bitsPerSample at:1) == 16 ifTrue:[
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1128
            byteOrder ~~ #msb ifTrue:[
3989
a1fa18648a9c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3987
diff changeset
  1129
                "/ swapInt16s := true.
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1130
            ].    
3986
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
    ].
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1133
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1134
    bitsPerSample sum isPowerOfTwo ifFalse:[
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1135
        (#(24 48) includes:bitsPerSample sum) ifFalse:[
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1136
            ^ self fileFormatError:'unsupported bitsPerSample: ' , bitsPerSample printString
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1137
        ].
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1138
    ].
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1139
    
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1140
    fillOrder ~~ #msb ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1141
        (bitsPerSample conform:[:n | n == 8]) ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1142
            ^ self fileFormatError:'unsupported bitsPerSample with lsb fillOrder'
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
        convertFillOrder := true.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1145
    ].
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
    bytesPerRow isNil ifTrue:[ bytesPerRow := bytesPerRowIn ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1148
    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1149
    overAllBytes := bytesPerRow * height.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1150
    data := ByteArray new:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1151
    convert ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1152
        conversionBuffer := ByteArray new:(bytesPerRowIn * rowsPerStrip).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1153
    ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1154
    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1155
    offset := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1156
    stripNr := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1157
    row := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1158
    msb := (byteOrder == #msb).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1159
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1160
    [row <= height] whileTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1161
        self positionToStrip:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1162
        nBytes := stripByteCounts at:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1163
        rowsInThisStrip := stripRowCounts notNil 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1164
                                ifTrue:[stripRowCounts at:stripNr]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1165
                                ifFalse:[rowsPerStrip].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1166
        bytesInThisStrip := bytesPerRowIn * rowsInThisStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1167
        
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1168
        "/ 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
  1169
        "/ compression == 1 ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1170
        "/    self assert:( nBytes == (bytesPerRowIn * rowsInThisStrip) ).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1171
        "/ ].
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
        conversionBuffer notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1174
            decompressorBlock notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1175
                inBuffer := ByteArray new:nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1176
                (inStream nextBytes:nBytes into:inBuffer startingAt:1) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1177
                    self fileFormatError:'short read'
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
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1180
                nDecompressed := decompressorBlock 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1181
                                    value:inBuffer value:nBytes 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1182
                                    value:conversionBuffer value:1
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1183
                                    value:bytesInThisStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1184
            ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1185
                (nDecompressed := inStream nextBytes:nBytes into:conversionBuffer startingAt:1) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1186
                    self fileFormatError:'short read'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1187
                ]. 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1188
            ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1189
            convertFloats ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1190
                self assert:(nDecompressed \\ 4) == 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1191
                floats := FloatArray new:(nDecompressed // 4).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1192
            ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1193
                convertDoubles ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1194
                    self assert:(nDecompressed \\ 8) == 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1195
                    floats := DoubleArray new:(nDecompressed // 8).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1196
                ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1197
                    convertHalfFloats ifTrue:[  
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1198
                        self assert:(nDecompressed \\ 2) == 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1199
                        floats := HalfFloatArray new:(nDecompressed // 2).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1200
                    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1201
                ].
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
            floats replaceBytesWith:conversionBuffer.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1204
            1 to:floats size do:[:i |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1205
                |dVal byteVal|
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1206
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1207
                dVal := floats at:i.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1208
                "/ rescale from 0..1 to 0..255
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1209
                byteVal := (dVal * 255) asInteger clampBetween:0 and:255.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1210
                data at:offset+i-1 put:byteVal.
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
        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1213
            decompressorBlock notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1214
                inBuffer := ByteArray new:nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1215
                (inStream nextBytes:nBytes into:inBuffer startingAt:1) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1216
                    self fileFormatError:'short read'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1217
                ]. 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1218
                nDecompressed := decompressorBlock 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1219
                                    value:inBuffer value:nBytes 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1220
                                    value:data value:offset 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1221
                                    value:bytesInThisStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1222
            ] ifFalse:[    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1223
                (inStream nextBytes:nBytes into:data startingAt:offset) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1224
                    self fileFormatError:'short read'
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
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1228
        
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1229
        offset := offset + bytesInThisStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1230
        row := row + rowsInThisStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1231
        stripNr := stripNr + 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1232
    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1233
3987
d061c7dccdbe #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3986
diff changeset
  1234
    swapInt16s ifTrue:[
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1235
        data swapBytes
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1236
    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1237
    convertFillOrder ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1238
        1 to:data size do:[:i |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1239
            data at:i put:(data at:i) bitReversed8.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1240
        ].    
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
    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1243
    (predictor ~~ 1) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1244
        (predictor == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1245
            self class decodeDelta:nPlanes in:data width:width height:height
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
            ^ self fileFormatError:'unsupported predictor'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1248
        ].    
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
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1251
    "Created: / 29-08-2017 / 23:15:10 / cg"
3986
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
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1254
readJBIGTiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1255
    ^ self fileFormatError:'jbig compression not implemented'.
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1256
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1257
    "Modified: / 3.2.1998 / 18:05:04 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1258
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1259
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1260
readJPEGTiffImageData
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1261
    |nBytes compressedData|
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1262
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1263
    stripByteCounts size == 1 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1264
        "/ single strip
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1265
        self positionToStrip:1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1266
        nBytes := stripByteCounts at:1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1267
        compressedData := ByteArray uninitializedNew:nBytes.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1268
        (inStream nextBytes:nBytes into:compressedData) == nBytes ifFalse:[ self error:'short read' ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1269
        "/ pngOrJPGImage := JPEGReader fromStream:compressedData readStream.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1270
        "/ self halt.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1271
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1272
    stripRowCounts notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1273
        ^ self fileFormatError:'stripRowCounts not supported'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1274
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1275
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1276
    ^ self fileFormatError:'jpeg (old) compression not implemented'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1277
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1278
    "Modified: / 27-08-2017 / 15:38:23 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1279
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1280
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1281
readLZWTiffImageData
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1282
    self readImageDataUsingDecompressor:
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1283
        [:inBytes :inCount :outBytes :outOffset :outCount |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1284
            self class 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1285
                decompressLZWFrom:inBytes count:inCount
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1286
                into:outBytes startingAt:outOffset.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1287
            outCount.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1288
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1289
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1290
"/    "read LZW compressed tiff data; 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1291
"/     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
  1292
"/     and 2bit or 2+2bit greyscale images.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1293
"/     For 2+2bit greyscale images, the alpha plane is ignored.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1294
"/     (maybe other formats work also - but simply not tested)"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1295
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1296
"/    |bytesPerRow compressedStrip nPlanes overAllBytes
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1297
"/     bytesPerStrip "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1298
"/     nBytes        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1299
"/     prevSize      "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1300
"/     stripNr       "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1301
"/     offset        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1302
"/     row           "{ Class: SmallInteger }" |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1303
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1304
"/    nPlanes := samplesPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1305
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1306
"/    (nPlanes >= 3) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1307
"/        (bitsPerSample conform:[:each | each == 8]) ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1308
"/            ^ self fileFormatError:'only 8/8/8(/8) bits/sample are supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1309
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1310
"/        bytesPerRow := width * samplesPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1311
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1312
"/        (nPlanes == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1313
"/            (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1314
"/                ^ self fileFormatError:'only separate planes are supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1315
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1316
"/            'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1317
"/            nPlanes := 1
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1318
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1319
"/        (nPlanes == 1) ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1320
"/            ^ 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
  1321
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1322
"/        bytesPerRow := (width * (bitsPerSample at:1) + 7) // 8.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1323
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1324
"/    stripRowCounts notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1325
"/        ^ self fileFormatError:'stripRowCounts not supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1326
"/    ].
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
"/    "/ 'TIFFReader: decompressing LZW ...' infoPrintNL.
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
"/    overAllBytes := bytesPerRow * height.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1331
"/    bytesPerRow == width ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1332
"/        data := ByteArray uninitializedNew:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1333
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1334
"/        data := ByteArray new:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1335
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1336
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1337
"/    offset := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1338
"/    stripNr := 0.
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
"/    row := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1341
"/    bytesPerStrip := bytesPerRow * rowsPerStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1342
"/    prevSize := 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1343
"/    [row <= height] whileTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1344
"/        stripNr := stripNr + 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1345
"/        self positionToStrip:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1346
"/        nBytes := stripByteCounts at:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1347
"/        (nBytes > prevSize) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1348
"/            compressedStrip := ByteArray uninitializedNew:nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1349
"/            prevSize := nBytes
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
"/        (inStream nextBytes:nBytes into:compressedStrip) == nBytes ifFalse:[ self fileFormatError:'short file' ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1352
"/        self class 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1353
"/            decompressLZWFrom:compressedStrip count:nBytes
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1354
"/            into:data startingAt:offset.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1355
"/        offset := offset + bytesPerStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1356
"/        row := row + rowsPerStrip
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1357
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1358
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1359
"/    predictor ~~ 1 ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1360
"/        (predictor == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1361
"/            self class decodeDelta:nPlanes in:data width:width height:height
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1362
"/        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1363
"/            self fileFormatError:'unsupported predictor'
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1364
"/        ]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1365
"/    ]
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1366
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1367
    "Modified: / 29-08-2017 / 23:14:59 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1368
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1369
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1370
readNeXTJPEGTiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1371
    ^ self fileFormatError:'next jpeg compression not implemented'.
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  1372
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1373
    "Modified: / 3.2.1998 / 18:10:45 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1374
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1375
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1376
readNeXTRLE2TiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1377
    ^ self fileFormatError:'next 2bit rle compression not implemented'.
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  1378
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1379
    "Modified: / 3.2.1998 / 18:10:54 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1380
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1381
1826
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
  1382
readNewJPEGTiffImageData
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
  1383
    ^ self fileFormatError:'new jpeg compression not implemented'.
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
  1384
!
0a452034f661 comment
Claus Gittinger <cg@exept.de>
parents: 1814
diff changeset
  1385
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1386
readPackbitsTiffImageData
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1387
    self readImageDataUsingDecompressor:
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1388
        [:inBytes :inCount :outBytes :outOffset :outCount |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1389
            self class decompressTiffPackBitsFrom:inBytes to:outBytes at:outOffset count:outCount.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1390
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1391
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1392
"/    "this has only been tested with monochrome images"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1393
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1394
"/    |bytesPerRow bitsPerRow nPlanes 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1395
"/     stripNr       "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1396
"/     offset        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1397
"/     row           "{ Class: SmallInteger }" 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1398
"/     nBytes        "{ Class: SmallInteger }" bitsPerPixel overAllBytes buffer|
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1399
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1400
"/    nPlanes := samplesPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1401
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1402
"/    "only support 1-sample/pixel,
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1403
"/     with alpha - if separate planes,
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1404
"/     or rgb - if non separate planes and no alpha"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1405
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1406
"/    (nPlanes == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1407
"/        (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1408
"/            ^ self fileFormatError:'with alpha, only separate planes supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1409
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1410
"/        'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1411
"/        nPlanes := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1412
"/        bitsPerPixel := bitsPerSample at:1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1413
"/        bitsPerSample := Array with:bitsPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1414
"/        samplesPerPixel := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1415
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1416
"/        (nPlanes == 3) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1417
"/            (planarConfiguration ~~ PLANARCONFIG_CONTIG) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1418
"/                ^ self fileFormatError:'only non separate planes supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1419
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1420
"/            bitsPerSample ~= #(8 8 8) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1421
"/                ^ self fileFormatError:'only 8/8/8 rgb images supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1422
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1423
"/            bitsPerPixel := 24
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1424
"/        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1425
"/            (nPlanes ~~ 1) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1426
"/                ^ self fileFormatError:('format (nplanes == %1) not supported' bindWith:nPlanes).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1427
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1428
"/            bitsPerPixel := bitsPerSample at:1.
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
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1431
"/    stripRowCounts notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1432
"/        ^ self fileFormatError:'stripRowCounts not 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
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1435
"/    bitsPerRow := width * bitsPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1436
"/    bytesPerRow := bitsPerRow // 8.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1437
"/    ((bitsPerRow \\ 8) ~~ 0) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1438
"/        bytesPerRow := bytesPerRow + 1
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1439
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1440
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1441
"/    overAllBytes := bytesPerRow * height.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1442
"/    bytesPerRow == width ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1443
"/        data := ByteArray uninitializedNew:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1444
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1445
"/        data := ByteArray new:overAllBytes.
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
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1448
"/    offset := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1449
"/    stripNr := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1450
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1451
"/    buffer := nil.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1452
"/    row := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1453
"/    [row <= height] whileTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1454
"/        nBytes := stripByteCounts at:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1455
"/        self positionToStrip:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1456
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1457
"/        nBytes > buffer size ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1458
"/            "/ realloc
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1459
"/            buffer := ByteArray uninitializedNew:nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1460
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1461
"/        (inStream nextBytes:nBytes into:buffer) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1462
"/            self fileFormatError:'short file read'
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
"/        self class decompressTiffPackBitsFrom:buffer to:data at:offset count:(bytesPerRow * rowsPerStrip).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1465
"/        "/ nDecompressedBytes := self class decompressPackBits:nBytes from:buffer to:data startingAt:offset.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1466
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1467
"/        offset := offset + (bytesPerRow * rowsPerStrip).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1468
"/        row := row + rowsPerStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1469
"/        stripNr := stripNr + 1.
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
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1472
    "Modified: / 29-08-2017 / 23:15:03 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1473
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1474
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1475
readPixarFilmTiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1476
    ^ self fileFormatError:'pixar film compression not implemented'.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1477
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1478
    "Modified: / 3.2.1998 / 18:11:45 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1479
!
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1480
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1481
readPixarLogTiffImageData
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1482
    ^ self fileFormatError:'pixar log compression not implemented'.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  1483
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  1484
    "Modified: / 3.2.1998 / 18:11:53 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1485
!
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1486
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1487
readSGI24TiffImageData
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1488
    ^ self fileFormatError:'SGI 24-bit Log Luminance encoding not implemented' .
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1489
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1490
    "Created: / 25-08-2017 / 11:17:25 / cg"
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1491
!
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1492
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1493
readSGI32TiffImageData
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1494
    ^ self fileFormatError:'SGI 32-bit Log Luminance encoding not implemented' .
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1495
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1496
    "Created: / 25-08-2017 / 11:17:21 / cg"
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1497
!
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1498
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1499
readThunderScanTiffImageData
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1500
    |bytesPerRow compressedStrip nPlanes overAllBytes
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1501
     bytesPerStrip "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1502
     nBytes        "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1503
     prevSize      "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1504
     stripNr       "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1505
     offset        "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1506
     row           "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1507
     pixelIndex
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1508
     i even gen highNibble lastPixel d1 d2 d3|
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1509
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1510
    nPlanes := samplesPerPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1511
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1512
    (nPlanes == 2) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1513
        (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1514
            ^ self fileFormatError:'only separate planes are supported'.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1515
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1516
        'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1517
        nPlanes := 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1518
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1519
    (nPlanes == 1) ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1520
        ^ self fileFormatError:'unsupported nPlanes: ' , nPlanes printString.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1521
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1522
    (bitsPerSample at:1) == 4 ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1523
        ^ 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
  1524
    ].    
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1525
    stripRowCounts notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1526
        ^ self fileFormatError:'stripRowCounts not supported'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1527
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1528
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1529
    bytesPerRow := (width * (bitsPerSample at:1) + 7) // 8.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1530
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1531
    "/ 'TIFFReader: decompressing ThunderScan ...' infoPrintNL.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1532
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1533
    overAllBytes := bytesPerRow * height.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1534
    bytesPerRow == width ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1535
        data := ByteArray uninitializedNew:overAllBytes.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1536
    ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1537
        data := ByteArray new:overAllBytes.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1538
    ].
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
    offset := 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1541
    stripNr := 0.
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
    gen := [:pixel | 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1544
                even ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1545
                    highNibble := pixel. 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1546
                    even := false.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1547
                ] ifFalse:[    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1548
                    data at:pixelIndex put:((highNibble bitShift:4) bitOr:pixel).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1549
                    pixelIndex := pixelIndex + 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1550
                    even := true.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1551
                ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1552
            ].    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1553
    even := true.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1554
    lastPixel := 0.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1555
    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1556
    row := 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1557
    bytesPerStrip := bytesPerRow * rowsPerStrip.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1558
    prevSize := 0.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1559
    [row <= height] whileTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1560
        stripNr := stripNr + 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1561
        self positionToStrip:stripNr.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1562
        nBytes := stripByteCounts at:stripNr.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1563
        (nBytes > prevSize) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1564
            compressedStrip := ByteArray uninitializedNew:nBytes.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1565
            prevSize := nBytes
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
        (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
  1568
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1569
        "/ RLE decode... (see http://fileformats.archiveteam.org/wiki/ThunderScan_compression)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1570
        i := 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1571
        pixelIndex := offset.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1572
        
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1573
        [i <= nBytes] whileTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1574
            |code|
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
            code := compressedStrip at:i.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1577
            i := i + 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1578
            code >= 2r11000000 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1579
                "/ a single pixel
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1580
                lastPixel := code bitAnd:2r00111111.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1581
                self assert:(lastPixel <= 2r1111).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1582
                
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1583
                gen value:lastPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1584
            ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1585
                code >= 2r10000000 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1586
                    "/ three bit deltas (2 pixels)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1587
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1588
                    d1 := (code rightShift:3) bitAnd:2r111.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1589
                    d2 := code bitAnd:2r111.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1590
                    d1 ~~ 4 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1591
                        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
  1592
                        gen value:lastPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1593
                    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1594
                    d2 ~~ 4 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1595
                        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
  1596
                        gen value:lastPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1597
                    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1598
                ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1599
                    code >= 2r01000000 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1600
                        "/ two bit deltas (3 pixels)    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1601
                        d1 := (code rightShift:4) bitAnd:2r11.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1602
                        d2 := (code rightShift:2) bitAnd:2r11.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1603
                        d3 := code bitAnd:2r11.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1604
                        d1 ~~ 2 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1605
                            lastPixel := lastPixel + (#(0 1 0 -1) at:d1+1).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1606
                            gen value:lastPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1607
                        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1608
                        d2 ~~ 2 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1609
                            lastPixel := lastPixel + (#(0 1 0 -1) at:d2+1).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1610
                            gen value:lastPixel.
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
                        d3 ~~ 2 ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1613
                            lastPixel := lastPixel + (#(0 1 0 -1) at:d3+1).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1614
                            gen value:lastPixel.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1615
                        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1616
                    ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1617
                        code timesRepeat:[ gen value:lastPixel ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1618
                    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1619
                ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1620
            ].
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
        "/ self assert:(pixelIndex == (offset + bytesPerStrip)).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1623
        
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1624
        offset := offset + bytesPerStrip.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1625
        row := row + rowsPerStrip
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1626
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1627
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1628
    (predictor ~~ 1) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1629
        ^ self fileFormatError:('unsupported predictor: %1' bindWith:predictor).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1630
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1631
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1632
    "Modified: / 27-08-2017 / 15:38:47 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1633
!
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1634
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1635
readTiffImageData
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1636
    (compression == COMPRESSION_NONE " 1 " ) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1637
        self readUncompressedTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1638
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1639
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1640
    (compression == COMPRESSION_CCITTRLE " 2 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1641
        self readCCITT3RLETiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1642
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1643
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1644
    (compression == COMPRESSION_CCITTFAX3 " 3 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1645
        self readCCITTGroup3TiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1646
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1647
    ]. 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1648
    (compression == COMPRESSION_CCITTFAX4 " 4 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1649
        self readCCITTGroup4TiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1650
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1651
    ]. 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1652
    (compression == COMPRESSION_LZW " 5 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1653
        self readLZWTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1654
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1655
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1656
    (compression == COMPRESSION_OJPEG " 6 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1657
        self readJPEGTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1658
        ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1659
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1660
    (compression == COMPRESSION_JPEG " 7 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1661
        self readNewJPEGTiffImageData.
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_ADOBE_DEFLATE " 8 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1665
        self readAdobeDeflateTiffImageData.
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
    ].
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1668
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1669
    (compression == COMPRESSION_NEXT " 32766 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1670
        self readNeXTRLE2TiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1671
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1672
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1673
    (compression == COMPRESSION_CCITTRLEW " 32771 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1674
        self readCCITTRLEWTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1675
        ^ self
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1676
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1677
    (compression == COMPRESSION_PACKBITS " 32773 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1678
        self readPackbitsTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1679
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1680
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1681
    (compression == COMPRESSION_THUNDERSCAN " 32809 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1682
        self readThunderScanTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1683
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1684
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1685
    (compression == COMPRESSION_PIXARFILM " 32908 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1686
        self readPixarFilmTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1687
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1688
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1689
    (compression == COMPRESSION_PIXARLOG " 32909 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1690
        self readPixarLogTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1691
        ^ self
516
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_DEFLATE " 32946 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1694
        self readDeflateTiffImageData.
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_DCS " 32947 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1698
        self readDCSTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1699
        ^ self
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1700
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1701
    (compression == COMPRESSION_NEXT_JPEG " 32865 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1702
        self readNeXTJPEGTiffImageData.
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_JBIG " 34661 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1706
        self readJBIGTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1707
        ^ self
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1708
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1709
    (compression == COMPRESSION_SGILOG " 34676 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1710
        self readSGI32TiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1711
        ^ self
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1712
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1713
    (compression == COMPRESSION_SGILOG24 " 34677 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1714
        self readSGI24TiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1715
        ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1716
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1717
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1718
    self fileFormatError:('compression type ' , compression printString , ' not known').
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1719
3977
c78bab5f36f2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  1720
    "Created: / 11-04-1997 / 00:19:44 / cg"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1721
    "Modified: / 26-08-2017 / 21:46:56 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1722
!
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1723
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1724
readTiledJPEGTiffImageData
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1725
    ^ self fileFormatError:'tiled jpeg (old) compression not implemented'.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1726
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1727
    "Created: / 25-08-2017 / 16:27:28 / cg"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1728
    "Modified: / 26-08-2017 / 13:39:04 / cg"
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1729
!
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1730
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1731
readTiledLZWTiffImageData
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1732
    ^ self fileFormatError:'tiled LZW data not implemented' .
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1733
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1734
    "Created: / 25-08-2017 / 01:05:13 / cg"
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1735
!
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1736
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1737
readTiledNewJPEGTiffImageData
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1738
    ^ self fileFormatError:'tiled new jpeg compression not implemented'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1739
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1740
    "Created: / 26-08-2017 / 13:37:51 / cg"
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
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1743
readTiledTiffImageData
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1744
    (compression == COMPRESSION_NONE " 1 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1745
        self readTiledUncompressedTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1746
        ^ self
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1747
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1748
    (compression == COMPRESSION_LZW " 5 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1749
        self readTiledLZWTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1750
        ^ self
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1751
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1752
    (compression == COMPRESSION_OJPEG " 6 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1753
        self readTiledJPEGTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1754
        ^ self
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  1755
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1756
    (compression == COMPRESSION_JPEG " 7 ") ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1757
        self readTiledNewJPEGTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1758
        ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1759
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1760
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1761
    self fileFormatError:('tiled compression type ' , compression printString , ' not supported').
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1762
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1763
    "Created: / 25-08-2017 / 00:19:14 / cg"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1764
    "Modified: / 26-08-2017 / 13:39:15 / cg"
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1765
!
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1766
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1767
readTiledUncompressedTiffImageData
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1768
    |bytesPerRow     "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1769
     bitsPerRow      "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1770
     bytesPerTileRow "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1771
     bitsPerTileRow  "{ Class: SmallInteger }" 
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1772
     nPlanes 
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1773
     tileNr          "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1774
     "/ offset          "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1775
     "/ row             "{ Class: SmallInteger }" 
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1776
     nBytes          "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1777
     bitsPerPixel    "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1778
     overAllBytes    "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1779
     where           "{ Class: SmallInteger }"
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1780
     x               "{ Class: SmallInteger }"       
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1781
     y               "{ Class: SmallInteger }" 
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1782
     imageRowOffset  "{ Class: SmallInteger }" 
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1783
     imageOffset     "{ Class: SmallInteger }" 
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1784
     tileOffset      "{ Class: SmallInteger }"   
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1785
     dataOffset      "{ Class: SmallInteger }"   
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1786
     tilePos tile tH tW tb|
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1787
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1788
    nPlanes := samplesPerPixel.
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
    "/ not all formats are supported here,
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1791
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1792
    (nPlanes == 2) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1793
        (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1794
            ^ self fileFormatError:'with alpha, only separate planes supported'.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1795
        ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1796
        'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1797
        nPlanes := 1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1798
        bitsPerPixel := bitsPerSample at:1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1799
        bitsPerSample := Array with:bitsPerPixel.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1800
        samplesPerPixel := 1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1801
    ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1802
        (nPlanes == 4) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1803
            (planarConfiguration ~~ PLANARCONFIG_CONTIG) ifTrue:[
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1804
                ^ self fileFormatError:'only non separate planes supported'.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1805
            ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1806
            bitsPerSample ~= #(8 8 8 8) ifTrue:[
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1807
                ^ 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
  1808
            ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1809
            bitsPerPixel := 32.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1810
        ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1811
            (nPlanes == 3) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1812
                (planarConfiguration ~~ PLANARCONFIG_CONTIG) ifTrue:[
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1813
                    ^ self fileFormatError:'only non separate planes supported'.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1814
                ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1815
                bitsPerSample ~= #(8 8 8) ifTrue:[
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  1816
                    ^ 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
  1817
                ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1818
                bitsPerPixel := 24
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1819
            ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1820
                (nPlanes ~~ 1) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1821
                    ^ self fileFormatError:('unsupported format: nplanes=' , nPlanes printString).
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1822
                ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1823
                bitsPerPixel := bitsPerSample at:1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1824
            ]
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1825
        ]
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1826
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1827
    stripRowCounts notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1828
        ^ self fileFormatError:'stripRowCounts not supported'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1829
    ].
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1830
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1831
    bitsPerRow := width * bitsPerPixel.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1832
    bytesPerRow := (bitsPerRow + 7) // 8.
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1833
    
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1834
    bitsPerTileRow := tileWidth * bitsPerPixel.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1835
    bytesPerTileRow := (bitsPerTileRow + 7) // 8.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1836
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1837
    overAllBytes := bytesPerRow * height.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1838
    data := ByteArray new:overAllBytes.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1839
    
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1840
    tileNr := 1.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1841
    where := -1.
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1842
    y := 0.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1843
    imageRowOffset := 1.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1844
    [ y < height ] whileTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1845
        tH := tileLength.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1846
        (y+tileLength) > height ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1847
            tH := height - y.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1848
        ].    
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1849
        x := 0.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1850
        imageOffset := imageRowOffset.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1851
        [ x < width ] whileTrue:[
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1852
            nBytes := tileByteCounts at:tileNr.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1853
            tilePos := tileOffsets at:tileNr.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1854
            tileNr := tileNr + 1.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1855
            
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1856
            where ~~ tilePos ifTrue:[
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1857
                inStream position:tilePos.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1858
                where := tilePos.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1859
            ].
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1860
            tile := ByteArray new:nBytes.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1861
            inStream nextBytes:nBytes into:tile startingAt:1 blockSize:4096.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1862
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1863
            "/ copy the tile.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1864
            tileOffset := 1.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1865
            dataOffset := imageOffset. 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1866
            tW := tileWidth.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1867
            tb := bytesPerTileRow.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1868
            (x+tileWidth) > width ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1869
                tW := width-x.
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1870
                tb := ((bitsPerPixel * tW) + 7) // 8.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1871
            ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1872
            1 to:tH do:[:yT |
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1873
                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
  1874
                dataOffset := dataOffset + bytesPerRow.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1875
                tileOffset := tileOffset + bytesPerTileRow.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1876
            ].
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1877
            
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1878
            "/ offset := offset + nBytes.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1879
            "/ row := row + rowsPerStrip.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1880
            where := where + nBytes.
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1881
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1882
            x := x + tW.
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  1883
            imageOffset := imageOffset + bytesPerTileRow.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1884
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1885
        y := y + tH.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  1886
        imageRowOffset := imageRowOffset + (bytesPerRow*tH).
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1887
    ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1888
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1889
    "Created: / 25-08-2017 / 00:22:31 / cg"
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1890
    "Modified: / 28-08-2017 / 01:14:00 / cg"
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1891
!
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  1892
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  1893
readUncompressedTiffImageData
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1894
    self readImageDataUsingDecompressor:nil
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1895
    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1896
"/    |bytesPerRow   "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1897
"/     bitsPerRow    "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1898
"/     nPlanes 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1899
"/     stripNr       "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1900
"/     offset        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1901
"/     row           "{ Class: SmallInteger }" 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1902
"/     nBytes        "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1903
"/     bitsPerPixel 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1904
"/     overAllBytes  "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1905
"/     where         "{ Class: SmallInteger }"
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1906
"/     stripPos 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1907
"/     convertFloats convertDoubles convertHalfFloats|
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1908
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1909
"/    nPlanes := samplesPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1910
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1911
"/    "/ not all formats are supported here,
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1912
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1913
"/    (nPlanes == 2) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1914
"/        (planarConfiguration ~~ PLANARCONFIG_SEPARATE) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1915
"/            ^ self fileFormatError:'with alpha, only separate planes supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1916
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1917
"/        'TIFFReader [info]: ignoring alpha plane' infoPrintCR.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1918
"/        nPlanes := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1919
"/        bitsPerPixel := bitsPerSample at:1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1920
"/        bitsPerSample := Array with:bitsPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1921
"/        samplesPerPixel := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1922
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1923
"/        (nPlanes == 4) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1924
"/            (planarConfiguration ~~ PLANARCONFIG_CONTIG) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1925
"/                ^ self fileFormatError:'only non separate planes supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1926
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1927
"/            bitsPerSample ~= #(8 8 8 8) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1928
"/                bitsPerSample ~= #(16 16 16 16) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1929
"/                    ^ 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
  1930
"/                ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1931
"/            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1932
"/            bitsPerPixel := bitsPerSample sum.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1933
"/        ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1934
"/            (nPlanes == 3) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1935
"/                (planarConfiguration ~~ 1) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1936
"/                    ^ self fileFormatError:'only non separate planes supported'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1937
"/                ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1938
"/                bitsPerSample ~= #(8 8 8) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1939
"/                    bitsPerSample ~= #(16 16 16) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1940
"/                        ^ 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
  1941
"/                    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1942
"/                ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1943
"/                bitsPerPixel := bitsPerSample sum.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1944
"/            ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1945
"/                (nPlanes ~~ 1) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1946
"/                    ^ self fileFormatError:('unsupported format: nplanes=' , nPlanes printString).
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1947
"/                ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1948
"/                bitsPerPixel := bitsPerSample at:1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1949
"/            ]
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
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1952
"/    stripRowCounts notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1953
"/        ^ self fileFormatError:'stripRowCounts not 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
"/    bitsPerRow := width * bitsPerPixel.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1957
"/    bytesPerRow := bitsPerRow // 8.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1958
"/    ((bitsPerRow \\ 8) ~~ 0) ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1959
"/        bytesPerRow := bytesPerRow + 1
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1960
"/    ].
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
"/    overAllBytes := bytesPerRow * height.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1963
"/    bytesPerRow == width ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1964
"/        data := ByteArray uninitializedNew:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1965
"/    ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1966
"/        data := ByteArray new:overAllBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1967
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1968
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1969
"/    offset := 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1970
"/    stripNr := 0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1971
"/    where := -1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1972
"/    row := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1973
"/    [row <= height] whileTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1974
"/        stripNr := stripNr + 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1975
"/        nBytes := stripByteCounts at:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1976
"/        stripPos := stripOffsets at:stripNr.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1977
"/        where ~~ stripPos ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1978
"/            inStream position:stripPos.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1979
"/            where := stripPos.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1980
"/        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1981
"/        
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1982
"/        offset + nBytes > overAllBytes ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1983
"/            nBytes := overAllBytes - offset.
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
"/        (inStream nextBytes:nBytes into:data startingAt:offset+1) == nBytes ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1987
"/            ^ self fileFormatError:'short read'.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1988
"/        ].    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1989
"/
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1990
"/        offset := offset + nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1991
"/        row := row + rowsPerStrip.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1992
"/        where := where + nBytes.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1993
"/    ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  1994
4000
d39d58494281 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3989
diff changeset
  1995
    "Modified: / 29-08-2017 / 23:15:07 / cg"
440
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1996
! !
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1997
1762
55cf76514c8c method category rename
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  1998
!TIFFReader methodsFor:'private-reading'!
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1999
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2000
decodePhotoshopImageResourceBlock:bytes
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2001
    "8BIM is the signature for Photoshop Image Resource Block (IRB). 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2002
     See http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_38034.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2003
     
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2004
     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
  2005
     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
  2006
     The structure of the IRB is as follows:
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2007
     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
  2008
     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
  2009
     For example: 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2010
        0x040c for thumbnail; 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2011
        0x041a for slices; 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2012
        0x0408 for grid information; 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2013
        0x040f for ICC Profile etc.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2014
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2015
     After the identifier is a variable length string for name. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2016
     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
  2017
     After the first byte comes the string itself. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2018
     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
  2019
     Otherwise, pad one more byte after the string.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2020
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2021
     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
  2022
     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
  2023
     This finishes a whole 8BIM.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2024
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2025
     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
  2026
     How to interpret the data depends on the unique identifier.
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
     Now let's see how the IRBs are include in images. 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2029
     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
  2030
     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
  2031
     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
  2032
     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
  2033
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2034
     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
  2035
     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
  2036
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2037
    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
  2038
    0x03E9 Macintosh print manager print info record
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2039
    0x03EA Macintosh page format information. No longer read by Photoshop. (Obsolete)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2040
    0x03EB Obsolete--Photoshop 2.0 only ) Indexed color table
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2041
    0x03ED ResolutionInfo structure. See Appendix A in Photoshop API Guide.pdf.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2042
    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
  2043
    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
  2044
    0x03F0 The caption as a Pascal string.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2045
    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
  2046
    0x03F2 Background color. See See Color structure.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2047
    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
  2048
    0x03F4 Grayscale and multichannel halftoning information
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2049
    0x03F5 Color halftoning information
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2050
    0x03F6 Duotone halftoning information
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2051
    0x03F7 Grayscale and multichannel transfer function
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2052
    0x03F8 Color transfer functions
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2053
    0x03F9 Duotone transfer functions
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2054
    0x03FA Duotone image information
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2055
    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
  2056
    0x03FC (Obsolete)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2057
    0x03FD EPS options
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2058
    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
  2059
    0x03FF (Obsolete)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2060
    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
  2061
    0x0401 Working path (not saved). See See Path resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2062
    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
  2063
    0x0403 (Obsolete)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2064
    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
  2065
    0x0405 Image mode for raw format files
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2066
    0x0406 JPEG quality. Private.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2067
    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
  2068
    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
  2069
    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
  2070
    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
  2071
    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
  2072
    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
  2073
    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
  2074
    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
  2075
    0x0410 (Photoshop 5.0) Watermark. One byte.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2076
    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
  2077
    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
  2078
    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
  2079
    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
  2080
    0x0415 (Photoshop 5.0) Unicode Alpha Names. Unicode string
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2081
    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
  2082
    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
  2083
    0x0419 (Photoshop 6.0) Global Altitude. 4 byte entry for altitude
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2084
    0x041A (Photoshop 6.0) Slices. See See Slices resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2085
    0x041B (Photoshop 6.0) Workflow URL. Unicode string
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2086
    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
  2087
    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
  2088
    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
  2089
    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
  2090
    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
  2091
    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
  2092
    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
  2093
    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
  2094
    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
  2095
    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
  2096
    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
  2097
    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
  2098
    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
  2099
    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
  2100
    0x042E (Photoshop CS2) HDR Toning information
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2101
    0x042F (Photoshop CS2) Print info
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2102
    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
  2103
    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
  2104
    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
  2105
    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
  2106
    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
  2107
    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
  2108
    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
  2109
    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
  2110
    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
  2111
    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
  2112
    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
  2113
    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
  2114
    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
  2115
    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
  2116
    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
  2117
    0x07D0-0x0BB6 Path Information (saved paths). See See Path resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2118
    0x0BB7 Name of clipping path. See See Path resource format.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2119
    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
  2120
    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
  2121
    0x1B58 Image Ready variables. XML representation of variables definition
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2122
    0x1B59 Image Ready data sets
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2123
    0x1B5A Image Ready default selected state
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2124
    0x1B5B Image Ready 7 rollover expanded state
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2125
    0x1B5C Image Ready rollover expanded state
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2126
    0x1B5D Image Ready save layer settings
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2127
    0x1B5E Image Ready version
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2128
    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
  2129
    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
  2130
    "
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2131
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2132
    |s id name len resource record|
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2133
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2134
    record := OrderedCollection new.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2135
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2136
    s := bytes readStream.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2137
    [s atEnd] whileFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2138
        (s next:4) asString = '8BIM' ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2139
            id := s nextUnsignedInt16MSB.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2140
            name := s upTo:0.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2141
            name size odd ifFalse:[ s next ]. "/ padding
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2142
            len := s nextUnsignedInt32MSB.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2143
            resource := s next:len.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2144
            Verbose == true ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2145
                Transcript showCR:('      8BIM-%1: %2' bindWith:(id hexPrintString:4) with:resource).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2146
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2147
            record add:(Dictionary new
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2148
                            at:#id put:id;
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2149
                            at:#name put:name;
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2150
                            at:#resource put:resource;
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2151
                            yourself).                    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2152
        ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2153
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2154
    metaData at:#'PhotoshopIRB' put:record.
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
    "Created: / 27-08-2017 / 17:12:25 / cg"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2157
    "Modified: / 27-08-2017 / 18:14:56 / cg"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2158
!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2159
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2160
decodeTiffTag:tagType numberType:numberType length:length
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2161
    |offset value valueArray 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2162
     val scaleFactor rV gV bV
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2163
     n  "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2164
     i2 "{ Class: SmallInteger }"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2165
     i3 "{ Class: SmallInteger }" |
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2166
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2167
    Verbose == true ifTrue:[ Logger info:'tiffTag: %1' with:tagType ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2168
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2169
    (numberType == 3 "TIFF_SHORT") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2170
        "16 bit ushort"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2171
        valueArray := self readShorts:length signed:false.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2172
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2173
    ] ifFalse:[(numberType == 4 "TIFF_LONG") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2174
        "32 bit uinteger"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2175
        valueArray := self readLongs:length signed:false.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2176
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2177
    ] ifFalse:[(numberType == 2 "TIFF_ASCII") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2178
        "ascii characters"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2179
        value := self readChars:length
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2180
    ] ifFalse:[(numberType == 5 "TIFF_RATIONAL") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2181
        "64 (32+32) bit ufraction"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2182
        valueArray := self readFracts:length signed:false.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2183
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2184
    ] ifFalse:[(numberType == 1 "TIFF_BYTE") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2185
        "8bit uinteger"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2186
        value := self readBytes:length signed:false
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2187
    ] ifFalse:[(numberType == 6 "TIFF_SBYTE") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2188
        "TIFF6: 8bit signed integer"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2189
        value := self readBytes:length  signed:true
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2190
    ] ifFalse:[(numberType == 8 "TIFF_SSHORT") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2191
        "TIFF6: 16bit signed integer"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2192
        valueArray := self readShorts:length signed:true.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2193
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2194
    ] ifFalse:[(numberType == 9 "TIFF_SLONG") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2195
        "TIFF6: 32bit signed integer"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2196
        valueArray := self readLongs:length signed:true.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2197
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2198
    ] ifFalse:[(numberType == 10 "TIFF_SRATIONAL") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2199
        "TIFF6: 64 (32+32) bit signed fraction"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2200
        valueArray := self readFracts:length signed:true.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2201
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2202
    ] ifFalse:[(numberType == 11 "TIFF_FLOAT") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2203
        "TIFF6: 32 bit IEEE float"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2204
        valueArray := self readFloats:length.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2205
        value := valueArray at:1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2206
    ] ifFalse:[(numberType == 12 "TIFF_DOUBLE") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2207
        "TIFF6: 64 bit IEEE double"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2208
        valueArray := self readDoubles:length.
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
        
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2211
    ] ifFalse:[(numberType == 7 "TIFF_UNDEFINED") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2212
        "8bit anything"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2213
        value := self readBytes:length signed:false
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2214
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2215
    "/ the following are preps for the propsed bigTiff format    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2216
    ] ifFalse:[(numberType == 16 "TIFF_LONG8") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2217
        "BIGTIFF: 8-byte unsigned integer"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2218
        valueArray := self readLong8s:length signed:false.
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 == 17 "TIFF_SLONG8") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2221
        "BIGTIFF: 8-byte signed integer"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2222
        valueArray := self readLong8s: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 == 18 "TIFF_IFD8") ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2225
        "BIGTIFF: 8-byte unsigned IFD offset"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2226
        valueArray := self readLong8s:length signed:false.
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:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2229
        isBigTiff ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2230
            offset := (inStream nextInt64MSB:(byteOrder ~~ #lsb))
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2231
        ] ifFalse:[    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2232
            offset := (inStream nextInt32MSB:(byteOrder ~~ #lsb))
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2233
        ]
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2234
    ]]]]]]]]]]]]]]].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2235
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2236
    (tagType between:200 and:299) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2237
        (tagType == 254) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2238
            "/ New SubfileType
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2239
            "/      REDUCEDIMAGE    -> 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2240
            "/      PAGE            -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2241
            "/      MASK            -> 4
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2242
            "newSubFileType := value."
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2243
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2244
            "/ 'newSubfiletype ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2245
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2246
                Logger info:'      newSubfiletype: %1' with:value
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2247
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2248
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2249
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2250
        (tagType == 255) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2251
            "/ Old SubfileType
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2252
            "/      IMAGE           -> 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2253
            "/      REDUCEDIMAGE    -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2254
            "/      PAGE            -> 3
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2255
            subFileType := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2256
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2257
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2258
                Logger info:'      oldSubfiletype: %1' with:value 
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
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2262
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2263
        (tagType == 256) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2264
            "ImageWidth"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2265
            width := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2266
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2267
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2268
                Logger info:'      width: %1' with: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
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2271
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2272
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2273
        (tagType == 257) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2274
            "ImageHeight"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2275
            height := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2276
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2277
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2278
                Logger info:'      height: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2279
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2280
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2281
            ^ self
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
        (tagType == 258) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2284
            "bitspersample"  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2285
             bitsPerSample := valueArray.
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
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2288
                Logger info:'      bitspersample: %1' with:valueArray 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2289
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2290
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2291
            ^ self
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
        (tagType == 259) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2294
            "/ compression
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2295
            "/      NONE            -> 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2296
            "/      CCITTRLE        -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2297
            "/      CCITTFAX3       -> 3
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2298
            "/      CCITTFAX4       -> 4
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2299
            "/      LZW             -> 5
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2300
            "/      OJPEG           -> 6 (old style jpeg)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2301
            "/      JPEG            -> 7 (new style jpeg)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2302
            "/      ADOBE_DEFLATE   -> 8
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2303
            "/      JBIG            -> 9 (ITU-T T85)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2304
            "/      JBIG            -> 10 (ITU-T T43)
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
            "/      NEXT            -> 32766 (NeXT 2-bit encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2307
            "/      CCITTRLEW       -> 32771
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2308
            "/      PACKBITS        -> 32773
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2309
            "/      THUNDERSCAN     -> 32809 (ThunderScan 4-bit encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2310
            "/      IT8CTPAD        -> 32895  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2311
            "/      IT8LW           -> 32896  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2312
            "/      IT8MP           -> 32897  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2313
            "/      IT8BL           -> 32898  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2314
            "/      PIXARFILM       -> 32908
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2315
            "/      PIXARLOG        -> 32909 (Pixar companded 11-bit ZIP encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2316
            "/      DEFLATE         -> 32946 (PKZIP-style Deflate encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2317
            "/      DCS             -> 32947 (kodac)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2318
            "/      JBIG            -> 34661
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2319
            "/      SGI32           -> 34676 (SGI 32-bit Log Luminance encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2320
            "/      SGI24           -> 34677 (SGI 24-bit Log Luminance encoding)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2321
            "/      JPEG2000        -> 34712 JPEG2000
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2322
            "/      NIKON_NEF       -> 34713 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2323
            "/      JBIG2           -> 34715 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2324
            compression := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2325
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2326
            Verbose == true ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2327
                |s|
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2328
                s := (Dictionary withKeyValuePairs:
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2329
                        #( (1 uncompressed)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2330
                            (2 CCITTRLE)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2331
                            (3 CCITTFAX3)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2332
                            (4 CCITTFAX4)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2333
                            (5 LZW)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2334
                            (6 OJPEG)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2335
                            (7 JPEG)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2336
                            (8 ADOBE_DEFLATE)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2337
                            (9 JBIG_T85)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2338
                            (10 JBIG_T43)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2339
                            (32766 NEXT)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2340
                            (32771 CCITTRLEW)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2341
                            (32773 PACKBITS)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2342
                            (32809 THUNDERSCAN)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2343
                            (32895 IT8CTPAD)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2344
                            (32896 IT8LW)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2345
                            (32897 IT8MP)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2346
                            (32898 IT8BL)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2347
                            (32908 PIXARFILM)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2348
                            (32909 PIXARLOG)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2349
                            (32946 DEFLATE)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2350
                            (32947 DCS)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2351
                            (34661 JBIG)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2352
                            (34676 SGI32)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2353
                            (34677 SGI24)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2354
                            (34712 JPEG2000)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2355
                            (34713 NIKON_NEF)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2356
                            (34715 JBIG2) 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2357
                        )) at:value ifAbsent:'???'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2358
                Logger info:'      compression: %1 (=%2)' with:value with:s.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2359
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2360
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2361
        ].
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2362
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2363
        (tagType == 262) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2364
            "photometric"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2365
            |p|
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2366
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2367
            (value between:0 and:10) ifTrue:[
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2368
                p := 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2369
                    #(
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2370
                        whiteIs0            "/  0 - grayscale or monochrome; faxes
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2371
                        blackIs0            "/  1 - grayscale or monochrome; faxes
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2372
                        rgb                 "/  2
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2373
                        palette             "/  3
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2374
                        transparencyMask    "/  4
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2375
                        cmyk                "/  5 - color separations
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2376
                        YCbCr               "/  6 - CCIR 601
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2377
                        nil                 "/  7
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2378
                        CIElab              "/  8 - 1976 CIE L*a*b*
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2379
                        ICClab              "/  9 - ICC L*a*b*
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2380
                        ITUlab              "/ 10 - see ITO-T- Rec T42 (RFC 2301)
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2381
                    ) at:(value + 1)    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2382
            ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2383
                (value == 32803) ifTrue:[
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2384
                    p := #ColorFilterArray    "/ camera rw format
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
                (value == 32844) ifTrue:[
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2387
                    p := #PixarLogL   
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2388
                ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2389
                (value == 32845) ifTrue:[
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2390
                    p := #PixarLogLuv    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2391
                ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2392
                (value == 34892) ifTrue:[
3980
209cd9407fe9 oops: compilability!
Claus Gittinger <cg@exept.de>
parents: 3979
diff changeset
  2393
                    p := #LinearRaw           "/ camera rw format
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2394
                ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2395
            ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2396
            photometric := p.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2397
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2398
                Logger info:'      photometric: %1 (=%2)' with:value with:photometric
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2399
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2400
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2401
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2402
        (tagType == 263) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2403
            "/ Thresholding
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2404
            "/      BILEVEL         -> 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2405
            "/      HALFTONE        -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2406
            "/      ERRORDIFFUSE    -> 3
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2407
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2408
            "thresholding := value."
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2409
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2410
            "/ 'thresholding ' print. value printNewline.
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
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2413
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2414
        (tagType == 264) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2415
            "CellWidth"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2416
            "/ 'cellWidth ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2417
            metaData at:#CellWidth put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2418
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2419
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2420
        (tagType == 265) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2421
            "CellLength"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2422
            "/ 'cellLength ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2423
            metaData at:#CellLength put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2424
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2425
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2426
        (tagType == 266) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2427
            "fillOrder"
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2428
            (value == FILLORDER_MSB2LSB ) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2429
                fillOrder := #msb
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2430
            ] ifFalse:[
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  2431
                (value == FILLORDER_LSB2MSB) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2432
                    fillOrder := #lsb
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2433
                ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2434
                    fillOrder := nil
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2435
                ]
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2436
            ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2437
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2438
                Logger info:'      fillorder: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2439
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2440
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2441
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2442
        (tagType == 269) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2443
            "documentName - info only"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2444
            metaData at:#DocumentName put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2445
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2446
                Logger info:'      documentName: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2447
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2448
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2449
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2450
        (tagType == 270) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2451
            "imageDescription - info only"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2452
            metaData at:#ImageDescription put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2453
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2454
                Logger info:'      imageDescription: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2455
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2456
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2457
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2458
        (tagType == 271) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2459
            "make - info only"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2460
            metaData at:#Make put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2461
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2462
                Logger info:'      make: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2463
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2464
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2465
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2466
        (tagType == 272) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2467
            "model - info only"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2468
            metaData at:#Model put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2469
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2470
                Logger info:'      model: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2471
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2472
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2473
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2474
        (tagType == 273) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2475
            "stripOffsets"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2476
            stripOffsets := valueArray.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2477
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2478
                Logger info:'      stripOffsets: %1' with:valueArray 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2479
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2480
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2481
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2482
        (tagType == 274) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2483
            "Orientation"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2484
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2485
            orientation :=
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2486
                            #( nil          "/ 1 normal (topLeft)
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2487
                               hFlip        "/ 2 horizontal flip
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2488
                               hvFlip       "/ 3 horizontal & vertical flip
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2489
                               vFlip        "/ 4 vertical flip
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2490
                               rot90ccw     "/ 5 rot 90' counter clock-wise
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2491
                               rot90        "/ 6 rot 90' clock-wise
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2492
                               rot90flip    "/ 7 rot 90' & flip
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2493
                               rot90ccwFlip "/ 8 rot 90' ccw & flip
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2494
                             ) at:value ifAbsent:#unsupported.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2495
            metaData at:#Orientation put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2496
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2497
                Logger info:'      orientation: %1 (=%2)' with:value with:(orientation ? #normal)
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2498
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2499
            ^ self
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
        (tagType == 277) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2502
            samplesPerPixel := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2503
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2504
                Logger info:'      samplesperpixel: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2505
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2506
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2507
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2508
        (tagType == 278) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2509
            rowsPerStrip := value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2510
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2511
                Logger info:'      rowsPerStrip: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2512
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2513
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2514
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2515
        (tagType == 279) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2516
            "stripbytecount"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2517
            stripByteCounts := valueArray.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2518
            "/        'stripByteCounts Array(' print. 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2519
            "/        stripByteCounts size print.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2520
            "/        ')' printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2521
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2522
                Logger info:'      stripByteCounts: %1' with:valueArray 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2523
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2524
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2525
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2526
        (tagType == 280) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2527
            "/ minSampleValue
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2528
            metaData at:#MinSampleValue put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2529
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2530
                Logger info:'      minSampleValue: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2531
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2532
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2533
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2534
        (tagType == 281) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2535
            "/ maxSampleValue
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2536
            metaData at:#MaxSampleValue put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2537
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2538
                Logger info:'      maxSampleValue: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2539
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2540
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2541
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2542
        (tagType == 282) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2543
            "/ xResolution
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2544
            metaData at:#ResolutionX put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2545
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2546
                Logger info:'      xResolution: %1 (%2)' with:value with:value asFloat 
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2547
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2548
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2549
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2550
        (tagType == 283) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2551
            "/ yResolution
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2552
            metaData at:#ResolutionY put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2553
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2554
                Logger info:'      yResolution: %1 (%2)' with:value with:value asFloat 
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2555
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2556
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2557
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2558
        (tagType == 284) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2559
            (value == 1) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2560
                planarConfiguration := PLANARCONFIG_CONTIG
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2561
            ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2562
                (value == 2) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2563
                    planarConfiguration := PLANARCONFIG_SEPARATE
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2564
                ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2565
                    planarConfiguration := nil
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2566
                ]
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2567
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2568
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2569
                Logger info:'      planarConfiguration: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2570
            ].
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 == 285) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2574
            "/ 'pageName ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2575
            metaData at:#PageName put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2576
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2577
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2578
        (tagType == 286) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2579
            "/ xPosition
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2580
            metaData at:#PositionX put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2581
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2582
                Logger info:'      xPosition: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2583
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2584
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2585
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2586
        (tagType == 287) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2587
            "/ yPosition
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2588
            metaData at:#PositionY put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2589
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2590
                Logger info:'      yPosition: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2591
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2592
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2593
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2594
        (tagType == 288) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2595
            "/ 'freeOffsets ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2596
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2597
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2598
        (tagType == 289) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2599
            "/ 'freeByteCounts ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2600
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2601
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2602
        (tagType == 290) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2603
            "/ 'grayResponceUnit' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2604
            metaData at:#GrayResponceUnit put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2605
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2606
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2607
        (tagType == 291) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2608
            "/ 'grayResponceCurve' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2609
            metaData at:#GrayResponceCurve put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2610
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2611
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2612
        (tagType == 292) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2613
            "/ group3options (now called T4Options)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2614
            "/      2DENCODING      -> 1
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2615
            "/      UNCOMPRESSED    -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2616
            "/      FILLBITS        -> 4
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2617
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2618
            group3options := value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2619
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2620
                Logger info:'      group3options: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2621
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2622
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2623
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2624
        (tagType == 293) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2625
            "/ group4options (now called T6Options)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2626
            "/      UNCOMPRESSED    -> 2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2627
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2628
            "/ group4options := value.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2629
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2630
                Logger info:'      group4options: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2631
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2632
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2633
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2634
        (tagType == 296) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2635
            "resolutionunit"
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
            "/        (value == 1) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2638
            "/            'res-unit pixel' printNewline
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2639
            "/        ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2640
            "/            (value == 2) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2641
            "/                'res-unit inch' printNewline
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2642
            "/            ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2643
            "/                (value == 3) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2644
            "/                    'res-unit mm' printNewline
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2645
            "/                ] ifFalse:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2646
            "/                    'res-unit invalid' printNewline
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2647
            "/                ]
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2648
            "/            ]
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2649
            "/        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2650
            metaData at:#ResolutionUnit put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2651
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2652
                Logger info:'      resolutionUnit: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2653
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2654
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2655
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2656
        (tagType == 297) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2657
            "/ 'pageNumber ' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2658
            metaData at:#PageNumber put:value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2659
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2660
                Logger info:'      PageNumber: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2661
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2662
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2663
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2664
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2665
    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2666
    (tagType between:300 and:399) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2667
        (tagType == 300) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2668
            "/ 'colorResponceUnit' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2669
            metaData at:#ColorResponceUnit put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2670
            ^ self
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
        (tagType == 301) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2673
            "/ 'colorResponceCurve' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2674
            metaData at:#ColorResponceCurve put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2675
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2676
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2677
        (tagType == 305) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2678
            "software - info only"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2679
            metaData at:#Software put:value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2680
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2681
                Logger info:'      software: %1' with:value
3979
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
            ^ self
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
        (tagType == 306) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2686
            "dateTime - info only"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2687
            metaData at:#DateTime put:value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2688
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2689
                Logger info:'      dateTime: %1' with:value
3979
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
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2692
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2693
        (tagType == 315) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2694
            "artist - info only"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2695
            metaData at:#Artist put:value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2696
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2697
                Logger info:'      artist: %1' with:value
3979
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
            ^ self
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 == 316) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2702
            "host computer - info only"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2703
            metaData at:#HostComputer put:value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2704
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2705
                Logger info:'      host: %1' with:value
3979
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
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2708
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2709
        (tagType == 317) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2710
            "/ predictor
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2711
            "/ 1 -> no predictor
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2712
            "/ 2 -> horiz. difference (see tiff spec 6.0)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2713
            "/ 3 -> flt pnt (see adobe tech notes)
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2714
            "/ 34892 -> horiz difference x2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2715
            "/ 34893 -> horiz difference x4
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2716
            "/ 34894 -> flt pnt x2
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2717
            "/ 34895 -> flt pnt x4
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2718
            predictor := value.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2719
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2720
                Logger info:'      predictor: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2721
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2722
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2723
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2724
        (tagType == 318) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2725
            "/ whitePoint
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2726
            metaData at:#WhitePoint put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2727
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2728
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2729
        (tagType == 319) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2730
            "/ primaryChromatics
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2731
            metaData at:#PrimaryChromatics put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2732
            ^ self
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
        (tagType == 320) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2735
            "/ 'colorMap (size=' print. valueArray size print. ')' printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2736
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2737
            "
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2738
             the tiff colormap contains 16bit values;
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2739
             our colormap expects 8bit values
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2740
            "
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2741
            n := valueArray size // 3.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2742
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2743
            rV := ByteArray uninitializedNew:n.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2744
            gV := ByteArray uninitializedNew:n.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2745
            bV := ByteArray uninitializedNew:n.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2746
            scaleFactor := 255.0 / 16rFFFF.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2747
            i2 := n+1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2748
            i3 := 2*n+1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2749
            1 to:n do:[:vi |
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2750
                val := ((valueArray at:vi) * scaleFactor) rounded.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2751
                rV at:vi put:val.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2752
                val := ((valueArray at:i2) * scaleFactor) rounded.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2753
                gV at:vi put:val.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2754
                val := ((valueArray at:i3) * scaleFactor) rounded.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2755
                bV at:vi put:val.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2756
                i2 := i2 + 1.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2757
                i3 := i3 + 1.
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
            colorMap := MappedPalette redVector:rV greenVector:gV blueVector:bV.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2760
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2761
                Logger info:'      colormap: ...'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2762
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2763
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2764
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2765
        (tagType == 321) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2766
            "/ halftonehints
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2767
            metaData at:#HalftoneHints put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2768
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2769
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2770
        (tagType == 322) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2771
            "/ tilewidth
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2772
            tileWidth := value.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2773
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2774
                Logger info:'      tileWidth: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2775
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2776
            (tileWidth \\ 16) == 0 ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2777
                Logger warning:'TIFFReader: tile width is not a multiple of 16'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2778
            ].    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2779
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2780
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2781
        (tagType == 323) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2782
            "/ tilelength (height)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2783
            tileLength := value.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2784
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2785
                Logger info:'      tileLength: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2786
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2787
            (tileLength \\ 16) == 0 ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2788
                Logger warning:'TIFFReader: tile height is not a multiple of 16'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2789
            ].    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2790
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2791
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2792
        (tagType == 324) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2793
            "/ tileoffsets
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2794
            tileOffsets := valueArray.
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:'      tileOffsets: %1' with:valueArray 
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 == 325) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2801
            "/ tilebytecounts
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2802
            tileByteCounts := valueArray.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2803
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2804
                Logger info:'      tileByteCounts: %1' with:valueArray 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2805
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2806
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2807
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2808
        (tagType == 326) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2809
            "/ badFaxLines
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2810
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2811
                Logger info:'      badFaxLines: %1' with:valueArray 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2812
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2813
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2814
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2815
        (tagType == 327) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2816
            "CleanFaxData"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2817
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2818
                "/        'cleanfaxdata' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2819
                "/        (value == 0) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2820
                "/            'no lines with incorrect pixel counts' printNewline
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2821
                "/        ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2822
                "/            (value == 1) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2823
                "/                'incorrect lines were regenerated' printNewline
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2824
                "/            ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2825
                "/                (value == 2) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2826
                "/                    'incorrect lines were not regenerated' printNewline
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2827
                "/                ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2828
                "/                    'cleanfaxdata invalid' printNewline
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2829
                "/                ]
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2830
                "/            ]
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2831
                "/        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2832
                Logger info:'      cleanfaxdata: %1' with:value  
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2833
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2834
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2835
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2836
        (tagType == 328) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2837
            "/ consecutiveBadFaxLines
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:'      consecutiveBadFaxLines: %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 == 330) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2844
            "/ subifd
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2845
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2846
                Logger info:'      subifd: %1' with:valueArray 
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2847
            ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2848
            subIfds := valueArray. 
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2849
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2850
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2851
        (tagType == 332) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2852
            "/ 'ink set' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2853
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2854
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2855
        (tagType == 333) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2856
            "/ 'ink names' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2857
            metaData at:#IncNames put:value.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2858
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2859
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2860
        (tagType == 334) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2861
            "/ 'numinks' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2862
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2863
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2864
        (tagType == 336) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2865
            "/ 'dot range' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2866
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2867
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2868
        (tagType == 337) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2869
            "/ 'target printer' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2870
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2871
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2872
        (tagType == 338) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2873
            "/ 'extrasamples' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2874
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2875
                Logger info:'      extrasamples: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2876
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2877
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2878
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2879
        (tagType == 339) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2880
            "/ 'sample format' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2881
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2882
                Logger info:'      sample format: %1 (=%2)' 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2883
                            with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2884
                            with:(#( uint int float undef ) at:value ifAbsent:'???')
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2885
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2886
            sampleFormat := value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2887
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2888
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2889
        (tagType == 340) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2890
            "/ 'min sample value' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2891
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2892
                Logger info:'      min sample value: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2893
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2894
            minSampleValue := value.
3979
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 == 341) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2898
            "/ 'max sample value' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2899
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2900
                Logger info:'      max sample value: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2901
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2902
            maxSampleValue := value.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2903
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2904
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2905
        (tagType == 342) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2906
            "/ 'transfer range' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2907
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2908
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2909
        (tagType == 343) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2910
            "/ 'clip path' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2911
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2912
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2913
        (tagType == 344) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2914
            "/ 'xclip path units' print. value printNewline.
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 == 345) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2918
            "/ 'yclip path units' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2919
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2920
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2921
        (tagType == 346) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2922
            "/ 'indexed' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2923
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2924
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2925
        (tagType == 347) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2926
            "/ 'jpegtables' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2927
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2928
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2929
        (tagType == 351) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2930
            "/ opiproxy
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2931
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  2932
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2933
    ].
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 between:400 and:499) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2936
        (tagType == 400) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2937
            "/ 'GlobalParametersIFD' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2938
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2939
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2940
        (tagType == 401) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2941
            "/ 'ProfileType' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2942
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2943
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2944
        (tagType == 402) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2945
            "/ 'FaxProfile' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2946
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2947
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2948
        (tagType == 403) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2949
            "/ 'CodingMethods' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2950
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2951
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2952
        (tagType == 404) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2953
            "/ 'VersionYear' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2954
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2955
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2956
        (tagType == 405) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2957
            "/ 'ModeNumber' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2958
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2959
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2960
        (tagType == 433) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2961
            "/ 'Decode' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2962
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2963
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2964
        (tagType == 434) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2965
            "/ 'DefaultImageColor' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2966
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2967
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2968
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2969
    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2970
    (tagType between:500 and:599) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2971
        "/ obsolete JPEG tags
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2972
        (tagType == 512) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2973
            "/ 'jpeg proc' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2974
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2975
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2976
        (tagType == 513) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2977
            "/ 'jpeg proc' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2978
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2979
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2980
        (tagType == 514) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2981
            "/ 'jpeg ifByteCount' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2982
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2983
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2984
        (tagType == 515) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2985
            "/ 'jpeg restartInterval' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2986
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2987
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2988
        (tagType == 517) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2989
            "/ 'jpeg glossLessPredictors' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2990
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2991
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2992
        (tagType == 518) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2993
            "/ 'jpeg pointTransform' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2994
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2995
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2996
        (tagType == 519) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2997
            "/ 'jpeg qTables' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2998
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  2999
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3000
        (tagType == 520) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3001
            "/ 'jpeg dcTables' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3002
             ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3003
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3004
        (tagType == 521) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3005
            "/ 'jpeg acTables' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3006
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3007
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3008
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3009
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3010
        (tagType == 529) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3011
            "/ ycbr coeff
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3012
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3013
                Logger info:'      ycbr coeff: %1' with:value 
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
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3016
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3017
        (tagType == 530) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3018
            "/ ycbr subsampling
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3019
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3020
                Logger info:'      ycbr subsampling: %1' with:value 
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
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3023
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3024
        (tagType == 531) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3025
            "/ ycbr positioning
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3026
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3027
                Logger info:'      ycbr positioning: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3028
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3029
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3030
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3031
        (tagType == 532) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3032
            "/ referenceBlackWhite
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3033
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3034
                Logger info:'      referenceBlackWhite: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3035
            ].
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 == 559) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3039
            "/ stripRowCounts
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3040
            "/ Defined in the Mixed Raster Content part of RFC 2301, 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3041
            "/ used to replace RowsPerStrip for IFDs with variable-sized strips.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3042
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3043
                Logger info:'      stripRowCounts: %1' with:valueArray 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3044
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3045
            stripRowCounts := valueArray.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3046
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3047
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3048
    ].
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 between:700 and:799) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3051
        (tagType == 700) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3052
            "XMP metadata (xml)"
3979
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
            "/ 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
  3055
            "/ 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
  3056
            "/ 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
  3057
            "/ XML Packets
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3058
            
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3059
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3060
                Logger info:'      XMLPACKET: %1' with:value asString
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3061
            ].
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3062
            decodeMetaTags == true ifTrue:[
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3063
                metaData at:#xmpData put:value asString.
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3064
            ].    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3065
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3066
        ].
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
    
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3069
    (tagType between:18000 and:18999) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3070
        (tagType == 18246) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3071
            "/ Image Rating by windows
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3072
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3073
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3074
        (tagType == 18249) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3075
            "/ Image Rating Percent by windows
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3076
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3077
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3078
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3079
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3080
    (tagType between:32000 and:32999) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3081
        (tagType == 32781) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3082
            "/'imageid' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3083
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3084
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3085
        (tagType == 32932) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3086
            "/'wang annotation' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3087
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3088
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3089
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3090
        "/ Private Island graphics tags
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3091
        (tagType == 32953) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3092
            "/'ref points' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3093
            ^ self
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
        (tagType == 32954) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3096
            "/ 'regionTagPoint' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3097
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3098
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3099
        (tagType == 32955) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3100
            "/ 'regionWarpCorners' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3101
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3102
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3103
        (tagType == 32956) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3104
            "/ 'regionAffine' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3105
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3106
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3107
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3108
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3109
        "/ Private SGI tags
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3110
        (tagType == 32995) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3111
            "/ 'matteing' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3112
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3113
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3114
        
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3115
        (tagType == 32996) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3116
            "/ datatype
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3117
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3118
                Logger info:'      datatype: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3119
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3120
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3121
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3122
        (tagType == 32997) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3123
            "/ imagedepth
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3124
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3125
                Logger info:'      imagedepth: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3126
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3127
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3128
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3129
        (tagType == 32998) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3130
            "/ tiledepth
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3131
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3132
                Logger info:'      tiledepth: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3133
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3134
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3135
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3136
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3137
    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3138
    (tagType between:33000 and:33999) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3139
        "/ Private Pixar tags
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3140
        (tagType == 33300) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3141
            "/ 'image full width' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3142
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3143
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3144
        (tagType == 33301) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3145
            "/ 'image full length' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3146
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3147
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3148
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3149
        "/ Private Eastman Kodak tags
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3150
        (tagType == 33405) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3151
            "/ 'write serial number' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3152
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3153
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3154
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3155
        (tagType == 33421) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3156
            "/ CFARepeatPatternDim - For camera raw files from sensors with CFA overlay
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3157
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3158
                Logger info:'      CFARepeatPatternDim: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3159
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3160
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3161
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3162
        (tagType == 33422) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3163
            "/ CFAPattern - For camera raw files from sensors with CFA overlay
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3164
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3165
                Logger info:'      CFAPattern: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3166
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3167
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3168
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3169
        (tagType == 33423) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3170
            "/ BatteryLevel - Encodes camera battery level at time of image capture
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3171
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3172
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3173
        (tagType == 33432) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3174
            "/ 'copyright' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3175
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3176
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3177
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3178
        (tagType == 33550) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3179
            "/ 'geotiff modelpixelscaletag' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3180
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3181
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3182
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3183
        (tagType == 33723) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3184
            "/ 'RICHTIFFIPTC' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3185
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3186
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3187
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3188
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3189
        (tagType == 33920) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3190
            "/ 'geotiff IntergraphMatrixTag' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3191
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3192
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3193
        (tagType == 33922) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3194
            "/ 'geotiff ModelTiepointTag' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3195
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3196
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3197
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3198
    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3199
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3200
    (tagType between:34000 and:34999) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3201
        (tagType == 34016) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3202
            "/ Site
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3203
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3204
                Logger info:'      site: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3205
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3206
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3207
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3208
        (tagType == 34017) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3209
            "/ colorSequence
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3210
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3211
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3212
        (tagType == 34018) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3213
            "/ it8header
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3214
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3215
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3216
        (tagType == 34019) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3217
            "/ rasterPadding
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3218
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3219
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3220
        (tagType == 34020) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3221
            "/ bitsPerRunLength
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 == 34021) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3225
            "/ bitsPerExtendedRunLength
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3226
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3227
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3228
        (tagType == 34022) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3229
            "/ colorTable
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3230
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3231
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3232
        (tagType == 34023) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3233
            "/ imageColorIndicator
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3234
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3235
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3236
        (tagType == 34024) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3237
            "/ backgroundColorIndicator
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3238
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3239
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3240
        (tagType == 34025) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3241
            "/ imageColorValue
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3242
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3243
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3244
        (tagType == 34026) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3245
            "/ backgroundColorValue
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3246
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3247
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3248
        (tagType == 34027) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3249
            "/ pixelIntensityRange
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3250
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3251
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3252
        (tagType == 34028) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3253
            "/ transparencyIndicator
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3254
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3255
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3256
        (tagType == 34029) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3257
            "/ colorCharacterization
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3258
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3259
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3260
        (tagType == 34030) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3261
            "/ hcUsage
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3262
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3263
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3264
        (tagType == 34031) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3265
            "/ trapIndicator
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3266
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3267
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3268
        (tagType == 34032) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3269
            "/ cmykEquivalent
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3270
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3271
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3272
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3273
        "/ Private Pixel magic
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3274
        (tagType == 34232) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3275
            "/ 'jbig options' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3276
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3277
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3278
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3279
        (tagType == 34264) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3280
            "/ 'geotiff ModelTransformationTag' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3281
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3282
        ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3283
        "/ private Photoshop
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3284
        (tagType == 34377) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3285
            "/ RICHTIFFIPTC
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3286
            "/ IPTC (International Press Telecommunications Council) metadata.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3287
            "/ (see http://www.iptc.org/std/photometadata/specification/IPTC-PhotoMetadata)
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3288
            decodeMetaTags == true ifTrue:[
3985
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3289
                Verbose == true ifTrue:[ 
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3290
                    Logger info:'      RICHTIFFIPTC: %1' with:value
3d9f0b1a06d0 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3984
diff changeset
  3291
                ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3292
                self decodePhotoshopImageResourceBlock:value.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3293
            ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3294
                Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3295
                    Logger info:'      skipped decoding of IPTC-PhotoMetadata'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3296
                ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3297
            ].    
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3298
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3299
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3300
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3301
        (tagType == 34665) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3302
            "/ EXIFIFD
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3303
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3304
                Logger info:'      EXIFIFD: %1' with:value 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3305
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3306
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3307
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3308
        (tagType == 34675) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3309
            "/ 'ICCPROFILE' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3310
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3311
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3312
        
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3313
        (tagType == 34732) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3314
            "/ 'ImageLayer' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3315
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3316
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3317
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3318
        (tagType == 34735) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3319
            "/ 'geotiff GeoKeyDirectoryTag' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3320
            ^ self
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
        (tagType == 34736) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3323
            "/ 'geotiff GeoDoubleParamsTag' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3324
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3325
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3326
        (tagType == 34737) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3327
            "/ 'geotiff GeoAsciiParamsTag' print. value printNewline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3328
            ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3329
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3330
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3331
        
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3332
        (tagType == 34859) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3333
            "/ '???' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3334
            "/ Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3335
            "/     Logger info:'      ?: %1' with:value 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3336
            "/ ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3337
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3338
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3339
        
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3340
        "/ More Private SGI
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3341
        (tagType == 34908) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3342
            "/ 'fax recv params' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3343
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3344
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3345
        (tagType == 34909) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3346
            "/ 'fax subaddress' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3347
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3348
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3349
        (tagType == 34910) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3350
            "/ 'fax recv time' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3351
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3352
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3353
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3354
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3355
    (tagType between:36000 and:36999) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3356
        (tagType == 36867) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3357
            "/ '???' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3358
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3359
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3360
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3361
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3362
    (tagType between:37000 and:37999) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3363
        (tagType == 37390) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3364
            "/ '???' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3365
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3366
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3367
        (tagType == 37391) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3368
            "/ '???' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3369
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3370
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3371
        (tagType == 37392) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3372
            "/ '???' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3373
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3374
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3375
        (tagType == 37398) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3376
            "/ '???' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3377
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3378
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3379
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3380
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3381
    (tagType between:42000 and:42999) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3382
        (tagType == 42112) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3383
            "/ 'GDAL_METADATA' print. value printNewline.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3384
            Verbose == true ifTrue:[ 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3385
                Logger info:'      GDAL_METADATA: %1' with:value
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3386
            ].
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3387
            ^ self
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
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3390
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3391
    "/ 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
  3392
    (tagType between:50000 and:50999) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3393
        (tagType == 50706) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3394
            "/ DNGVersion
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3395
            Verbose == true ifTrue:[ 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3396
                Logger info:'      DNGVersion: %1' with:value
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3397
            ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3398
            isDNGImage := true.
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3399
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3400
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3401
        (tagType == 50707) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3402
            "/ DNGBackwardVersion
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3403
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3404
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3405
        (tagType == 50708) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3406
            "/ UniqueCameraModel
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3407
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3408
                Logger info:'      UniqueCameraModel: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3409
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3410
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3411
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3412
        (tagType == 50709) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3413
            "/ LocalizedCameraModel
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3414
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3415
                Logger info:'      LocalizedCameraModel: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3416
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3417
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3418
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3419
        (tagType == 50710) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3420
            "/ 'CFAPlaneColor' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3421
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3422
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3423
        (tagType == 50711) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3424
            "/ 'CFALayout' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3425
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3426
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3427
        (tagType == 50712) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3428
            "/ 'LinearizationTable' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3429
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3430
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3431
        (tagType == 50713) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3432
            "/ 'BlackLevelRepeatDim' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3433
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3434
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3435
        (tagType == 50714) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3436
            "/ 'BlackLevel' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3437
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3438
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3439
        (tagType == 50715) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3440
            "/ 'BlackLevelDeltaH' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3441
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3442
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3443
        (tagType == 50716) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3444
            "/ 'BlackLevelDeltaV' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3445
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3446
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3447
        (tagType == 50717) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3448
            "/ 'WhiteLevel' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3449
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3450
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3451
        (tagType == 50718) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3452
            "/ 'DefaultScale' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3453
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3454
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3455
        (tagType == 50719) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3456
            "/ 'DefaultCropOrigin' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3457
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3458
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3459
        (tagType == 50720) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3460
            "/ 'DefaultCropSize' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3461
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3462
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3463
        (tagType == 50721) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3464
            "/ 'ColorMatrix1' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3465
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3466
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3467
        (tagType == 50722) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3468
            "/ 'ColorMatrix2' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3469
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3470
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3471
        (tagType == 50723) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3472
            "/ 'CameraCalibrarion1' print. value printNewline.
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
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3475
        (tagType == 50724) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3476
            "/ 'CameraCalibrarion2' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3477
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3478
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3479
        (tagType == 50725) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3480
            "/ 'ReductionMatrix1' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3481
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3482
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3483
        (tagType == 50726) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3484
            "/ 'ReductionMatrix2' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3485
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3486
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3487
        (tagType == 50727) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3488
            "/ 'AnalogBalance' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3489
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3490
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3491
        (tagType == 50728) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3492
            "/ 'AsShotNeutral' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3493
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3494
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3495
        (tagType == 50729) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3496
            "/ 'AsShotWhiteXY' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3497
            ^ self
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 == 50730) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3500
            "/ 'BaselineExposure' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3501
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3502
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3503
        (tagType == 50731) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3504
            "/ 'BaselineNoise' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3505
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3506
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3507
        (tagType == 50732) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3508
            "/ 'BaselineSharpness' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3509
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3510
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3511
        (tagType == 50733) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3512
            "/ 'ByerGreenSplit' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3513
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3514
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3515
        (tagType == 50734) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3516
            "/ 'LinearResponseLimit' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3517
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3518
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3519
        (tagType == 50735) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3520
            "/ 'CameraSerialNumber' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3521
            Verbose == true ifTrue:[ 
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3522
                Logger info:'      CameraSerialNumber: %1' with:value
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3523
            ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3524
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3525
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3526
        (tagType == 50736) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3527
            "/ 'LensInfo' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3528
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3529
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3530
        (tagType == 50737) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3531
            "/ 'ChromaBlurRadius' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3532
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3533
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3534
        (tagType == 50738) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3535
            "/ 'AntiAliasStrength' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3536
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3537
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3538
        (tagType == 50739) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3539
            "/ 'ShadowScale' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3540
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3541
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3542
        (tagType == 50740) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3543
            "/ 'DNGPrivateData' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3544
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3545
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3546
        (tagType == 50741) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3547
            "/ 'MakerNoteSafety' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3548
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3549
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3550
        
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3551
        (tagType == 50778) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3552
            "/ 'CalibrationIlluminant1' print. value printNewline.
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
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3555
        (tagType == 50779) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3556
            "/ 'CalibrationIlluminant2' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3557
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3558
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3559
        (tagType == 50780) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3560
            "/ 'BestQualityScale' print. value printNewline.
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
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3563
        (tagType == 50781) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3564
            "/ 'RawDataUniqueID' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3565
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3566
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3567
        
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3568
        (tagType == 50827) ifTrue:[
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3569
            "/ 'OriginalRawFileName' print. value printNewline.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3570
            ^ self
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3571
        ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3572
    ].
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3573
    
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3574
"/
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3575
"/ 'TIFFReader: tag:' print. tagType print. ' typ:' print. numberType print.
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3576
"/ ' len:' print. length print. ' offs:' print. offset print. 
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3577
"/ ' val:' print. value print. ' valArr:' print. valueArray printNewline.  
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3578
"/
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3579
    'TIFFReader [warning]: unknown tag type ' errorPrint. tagType errorPrintCR
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3580
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3581
    "Modified (format): / 23-05-2017 / 16:12:58 / mawalch"
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  3582
    "Modified: / 28-08-2017 / 00:48:37 / cg"
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
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  3585
positionToStrip:stripNr
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3586
    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
  3587
!
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  3588
3979
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3589
positionToTile:tileNr
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3590
    inStream position:((metaData at:#'TileOffsets') at:tileNr).
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3591
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3592
    "Created: / 25-08-2017 / 13:43:30 / cg"
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3593
!
5d915912216f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3977
diff changeset
  3594
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
  3595
readBytes:n signed:isSigned
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3596
    "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
  3597
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3598
    |oldPos offset bytes nInline|
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3599
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3600
    nInline := isBigTiff ifTrue:[8] ifFalse:[4].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3601
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3602
    n == 0 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3603
        "/ even in this case, one WORD is to be skipped.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3604
        inStream skip:nInline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3605
        ^ ''
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3606
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3607
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
  3608
    bytes := (isSigned ifTrue:[Array] ifFalse:[ByteArray]) new:n.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3609
    (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
  3610
        isSigned ifTrue:[
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3611
            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
  3612
        ] ifFalse:[
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3613
            inStream nextBytes:n into:bytes.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3614
        ].
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3615
        (n < nInline) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3616
            inStream skip:(nInline - n).
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3617
        ]
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3618
    ] ifFalse:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3619
        offset := inStream nextInt32MSB:(byteOrder ~~ #lsb).
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3620
        oldPos := inStream position.
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3621
        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
  3622
        isSigned ifTrue:[
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3623
            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
  3624
        ] ifFalse:[
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3625
            inStream nextBytes:n into:bytes.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3626
        ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3627
        inStream position:oldPos
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3628
    ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3629
    ^ bytes
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3630
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3631
    "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
  3632
!
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3633
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3634
readChars:n
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3635
    "read n characters and return them in a string"
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3636
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3637
    |oldPos offset string nInline|
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3638
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3639
    nInline := isBigTiff ifTrue:[8] ifFalse:[4].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3640
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3641
    n == 0 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3642
        "/ even in this case, one WORD is to be skipped.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3643
        inStream skip:nInline.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3644
        ^ ''
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3645
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3646
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3647
    string := String new:(n - 1).
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3648
    (n <= nInline) ifTrue:[
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3649
        inStream nextBytes:(n - 1) into:string.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3650
        inStream next. "/ skip the 0-byte.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3651
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3652
        (n < nInline) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3653
            inStream skip:(nInline - n).
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3654
        ]
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3655
    ] ifFalse:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3656
        offset := inStream nextInt32MSB:(byteOrder == #msb).
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3657
        oldPos := inStream position.
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3658
        inStream position:offset.
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3659
        inStream nextBytes:(n - 1) into:string.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3660
        inStream position:oldPos
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3661
    ].
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3662
    ^ string
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3663
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3664
    "Modified: / 27-08-2017 / 19:55:15 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3665
!
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3666
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3667
readDoubles:nFloats
3112
d6fbee4954ca class: TIFFReader
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  3668
    "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
  3669
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3670
    |oldPos offset values val msb 
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3671
     n "{ Class: SmallInteger }" |
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3672
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3673
    n := nFloats.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3674
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3675
    msb := byteOrder ~~ #lsb.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3676
    values := DoubleArray basicNew:n.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3677
    (n == 1) ifTrue:[
3112
d6fbee4954ca class: TIFFReader
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  3678
        val := Float readBinaryIEEEDoubleFrom:inStream MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3679
        values at:1 put:val.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3680
    ] ifFalse:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3681
        offset := inStream nextInt32MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3682
        oldPos := inStream position.
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3683
        inStream position:offset.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3684
        1 to:n do:[:index |
3112
d6fbee4954ca class: TIFFReader
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  3685
            val := Float readBinaryIEEEDoubleFrom:inStream MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3686
            values at:index put:val
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3687
        ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3688
        inStream position:oldPos
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3689
    ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3690
    ^ values
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3691
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3692
    "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
  3693
!
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3694
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3695
readFloats:nFloats
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3696
    "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
  3697
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3698
    |oldPos offset values val val1 val2 msb 
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3699
     n "{ Class: SmallInteger }" |
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3700
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3701
    n := nFloats.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3702
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3703
    msb := byteOrder ~~ #lsb.
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3704
    values := FloatArray basicNew:n.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3705
    (isBigTiff and:[ n == 2 ]) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3706
        val1 := ShortFloat readBinaryIEEESingleFrom:inStream MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3707
        val2 := ShortFloat readBinaryIEEESingleFrom:inStream MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3708
        values at:1 put:val1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3709
        n == 2 ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3710
            values at:2 put:val2.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3711
        ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3712
    ] ifFalse:[    
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3713
        (n == 1) ifTrue:[
3112
d6fbee4954ca class: TIFFReader
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  3714
            val := ShortFloat readBinaryIEEESingleFrom:inStream MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3715
            values at:1 put:val.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3716
        ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3717
            offset := inStream nextInt32MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3718
            oldPos := inStream position.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3719
            inStream position:offset.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3720
            1 to:n do:[:index |
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3721
                val := ShortFloat readBinaryIEEESingleFrom:inStream MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3722
                values at:index put:val
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3723
            ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3724
            inStream position:oldPos
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3725
        ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3726
    ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3727
    ^ values
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3728
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3729
    "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
  3730
!
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3731
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
  3732
readFracts:nFracts signed:isSigned
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3733
    "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
  3734
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3735
    |oldPos offset values numerator denominator msb
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3736
     n "{ Class: SmallInteger }" |
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3737
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3738
    n := nFracts.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3739
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3740
    msb := byteOrder ~~ #lsb.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3741
    values := Array basicNew:n.
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3742
    offset := inStream nextInt32MSB:msb.
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3743
    oldPos := inStream position.
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3744
    inStream position:offset.
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3745
    1 to:n do:[:index |
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3746
        numerator := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3747
        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
  3748
        values at:index put:(Fraction numerator:numerator denominator:denominator)
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3749
    ].
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3750
    inStream position:oldPos.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3751
    ^ values
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3752
!
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3753
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3754
readLong8s:nLongs signed:isSigned
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3755
    "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
  3756
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3757
    |oldPos offset values val msb 
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3758
     n "{ Class: SmallInteger }" |
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3759
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3760
    n := nLongs.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3761
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3762
    msb := byteOrder ~~ #lsb.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3763
    values := Array basicNew:n.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3764
    (n == 1) ifTrue:[
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3765
        val := isSigned ifTrue:[inStream nextInt64MSB:msb] ifFalse:[inStream nextUnsignedInt64MSB:msb].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3766
        values at:1 put:val.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3767
    ] ifFalse:[
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3768
        offset := inStream nextInt64MSB:msb.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3769
        oldPos := inStream position.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3770
        inStream position:offset.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3771
        1 to:n do:[:index |
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3772
            val := isSigned ifTrue:[inStream nextInt64MSB:msb] ifFalse:[inStream nextUnsignedInt64MSB:msb].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3773
            values at:index put:val
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3774
        ].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3775
        inStream position:oldPos
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3776
    ].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3777
    ^ values
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3778
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3779
    "Created: / 24-08-2017 / 22:01:26 / cg"
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3780
!
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  3781
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
  3782
readLongs:nLongs signed:isSigned
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3783
    "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
  3784
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3785
    |oldPos offset values val val1 val2 msb 
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3786
     n "{ Class: SmallInteger }" |
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3787
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3788
    n := nLongs.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3789
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3790
    msb := byteOrder ~~ #lsb.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3791
    values := Array basicNew:n.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3792
    (isBigTiff and:[ n <= 2 ]) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3793
        val1 := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3794
        val2 := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3795
        values at:1 put:val1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3796
        n == 2 ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3797
            values at:2 put:val2.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3798
        ].
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3799
    ] ifFalse:[
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3800
        (n == 1) ifTrue:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3801
            val := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3802
            values at:1 put:val.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3803
        ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3804
            offset := inStream nextInt32MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3805
            oldPos := inStream position.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3806
            inStream position:offset.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3807
            1 to:n do:[:index |
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3808
                val := isSigned ifTrue:[inStream nextInt32MSB:msb] ifFalse:[inStream nextUnsignedInt32MSB:msb].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3809
                values at:index put:val
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3810
            ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3811
            inStream position:oldPos
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  3812
        ].
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3813
    ].
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3814
    ^ values
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3815
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3816
    "Modified: / 24-08-2017 / 23:35:38 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3817
!
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3818
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
  3819
readShorts:nShorts signed:isSigned
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3820
    "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
  3821
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3822
    |oldPos offset values msb val1 val2 val3 val4
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3823
     n "{ Class: SmallInteger }" |
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3824
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3825
    n := nShorts.
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3826
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3827
    msb := (byteOrder ~~ #lsb).
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3828
    values := Array basicNew:n.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3829
    (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
  3830
        isSigned ifTrue:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3831
            val1 := inStream nextInt16MSB:msb.
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3832
            val2 := inStream nextInt16MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3833
            val3 := inStream nextInt16MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3834
            val4 := inStream nextInt16MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3835
        ] ifFalse:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3836
            val1 := inStream nextUnsignedInt16MSB:msb.
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3837
            val2 := inStream nextUnsignedInt16MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3838
            val3 := inStream nextUnsignedInt16MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3839
            val4 := inStream nextUnsignedInt16MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3840
        ].
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3841
        values at:1 put:val1.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3842
        (n >= 2) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3843
            values at:2 put:val2.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3844
            (n >= 3) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3845
                values at:3 put:val3.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3846
                (n == 4) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3847
                    values at:4 put:val4.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3848
                ]
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3849
            ]
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  3850
        ]
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3851
    ] ifFalse:[
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3852
        (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
  3853
            isSigned ifTrue:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3854
                val1 := inStream nextInt16MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3855
                val2 := inStream nextInt16MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3856
            ] ifFalse:[
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  3857
                val1 := inStream nextUnsignedInt16MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3858
                val2 := inStream nextUnsignedInt16MSB:msb.
1829
af94d3366af3 tiff6 tag values added (signed byte,....)
Claus Gittinger <cg@exept.de>
parents: 1827
diff changeset
  3859
            ].
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3860
            values at:1 put:val1.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3861
            (n == 2) ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3862
                values at:2 put:val2
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3863
            ]
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3864
        ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3865
            offset := inStream nextInt32MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3866
            oldPos := inStream position.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3867
            inStream position:offset.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3868
            1 to:n do:[:index |
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3869
                isSigned ifTrue:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3870
                    val1 := inStream nextInt16MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3871
                ] ifFalse:[
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3872
                    val1 := inStream nextUnsignedInt16MSB:msb.
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3873
                ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3874
                values at:index put:val1
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3875
            ].
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3876
            inStream position:oldPos
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  3877
        ].
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3878
    ].
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3879
    ^ values
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3880
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  3881
    "Modified: / 24-08-2017 / 23:33:09 / cg"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3882
!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3883
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3884
readSingleTagFrom:aStream
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3885
    |msb tagType numberType length|
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3886
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3887
    msb := (byteOrder == #msb).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3888
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3889
    tagType := aStream nextUnsignedInt16MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3890
    numberType := aStream nextUnsignedInt16MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3891
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3892
    isBigTiff ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3893
        length := aStream nextInt32MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3894
    ] ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3895
        length := aStream nextInt64MSB:msb.
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
    self decodeTiffTag:tagType numberType:numberType length:length.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3898
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3899
    "Created: / 26-08-2017 / 11:04:50 / cg"
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  3900
    "Modified: / 17-09-2017 / 13:06:32 / cg"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3901
!
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3902
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3903
readTagsFrom:aStream
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3904
    |numberOfTags msb|
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3905
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3906
    msb := (byteOrder == #msb).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3907
    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3908
    isBigTiff ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3909
        numberOfTags := aStream nextUnsignedInt16MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3910
    ] ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3911
        numberOfTags := aStream nextUnsignedInt64MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3912
    ].
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  3913
    numberOfTags isNil ifTrue:[
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  3914
        "/ EOF
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  3915
        ^ self
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  3916
    ].
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  3917
    
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3918
    1 to:numberOfTags do:[:index |
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3919
        self readSingleTagFrom:aStream.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3920
    ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3921
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  3922
    "Created: / 26-08-2017 / 11:03:45 / cg"
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  3923
    "Modified: / 17-09-2017 / 11:28:03 / cg"
516
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3924
! !
76ffe180cff8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  3925
1762
55cf76514c8c method category rename
Claus Gittinger <cg@exept.de>
parents: 1759
diff changeset
  3926
!TIFFReader methodsFor:'private-writing'!
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  3927
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  3928
writeBitsPerSample
14
20638e830834 *** empty log message ***
claus
parents: 11
diff changeset
  3929
"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  3930
'bitsPerSample: ' print. bitsPerSample printNewline.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  3931
'store bitspersample at: ' print. outStream position printNewline.
14
20638e830834 *** empty log message ***
claus
parents: 11
diff changeset
  3932
"
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3933
    bitsPerSamplePos := outStream position.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  3934
    bitsPerSample do:[:n |
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3935
        self writeShort:n
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  3936
    ]
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  3937
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  3938
3f9277473954 Initial revision
claus
parents:
diff changeset
  3939
writeColorMap
28
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
  3940
    |n|
8daff0234d2e *** empty log message ***
claus
parents: 25
diff changeset
  3941
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3942
    colorMapPos := outStream position.
35
f13cdd0b44c7 *** empty log message ***
claus
parents: 32
diff changeset
  3943
    #(red green blue) do:[:component |
440
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3944
        n := 0.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3945
        colorMap do:[:clr |
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3946
            |entry|
35
f13cdd0b44c7 *** empty log message ***
claus
parents: 32
diff changeset
  3947
440
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3948
            clr isNil ifTrue:[
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3949
                entry := 0
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3950
            ] ifFalse:[
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3951
                entry := clr perform:component.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3952
                "
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3953
                 tiff map is 16 bit - scale from percent to 0..16rFFFF
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3954
                "
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3955
                entry := (entry * 16rFFFF / 100) rounded.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3956
            ].
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3957
            self writeShort:entry.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3958
            n := n + 1
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3959
        ].
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3960
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3961
        "
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3962
         fill to 256 entries
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3963
        "
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3964
        [n < 256] whileTrue:[
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3965
            self writeShort:0.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3966
            n := n + 1.
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3967
        ]
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  3968
    ]
440
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3969
fa1e1a56ea43 category rename
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  3970
    "Modified: 20.2.1997 / 18:06:10 / cg"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  3971
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  3972
3f9277473954 Initial revision
claus
parents:
diff changeset
  3973
writeStripByteCounts
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
  3974
"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  3975
'stripByteCounts: ' print. stripByteCounts printNewline.
3f9277473954 Initial revision
claus
parents:
diff changeset
  3976
'store stripbytecounts at: ' print. outStream position printNewline.
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
  3977
"
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3978
    stripByteCountsPos := outStream position.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  3979
    stripByteCounts do:[:c |
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3980
        self writeShort:c
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  3981
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
  3982
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  3983
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  3984
writeStripOffsets
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
  3985
"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  3986
'stripOffsets: ' print. stripOffsets printNewline.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  3987
'store stripoffsets at: ' print. outStream position printNewline.
3
78aaa5408119 *** empty log message ***
claus
parents: 0
diff changeset
  3988
"
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  3989
    stripOffsetsPos := outStream position.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  3990
    stripOffsets do:[:o |
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  3991
        self writeLong:o
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  3992
    ]
3f9277473954 Initial revision
claus
parents:
diff changeset
  3993
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  3994
3f9277473954 Initial revision
claus
parents:
diff changeset
  3995
writeTag:tagType
3f9277473954 Initial revision
claus
parents:
diff changeset
  3996
    self writeTiffTag:tagType.
3f9277473954 Initial revision
claus
parents:
diff changeset
  3997
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  3998
3f9277473954 Initial revision
claus
parents:
diff changeset
  3999
writeTiffTag:tagType
3f9277473954 Initial revision
claus
parents:
diff changeset
  4000
    |value valueArray numberType count address|
3f9277473954 Initial revision
claus
parents:
diff changeset
  4001
3f9277473954 Initial revision
claus
parents:
diff changeset
  4002
    count := 1.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4003
    address := nil.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4004
    (tagType == 253) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4005
        "tiff class"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4006
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4007
    (tagType == 254) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4008
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4009
    (tagType == 255) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4010
        "SubfileType"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4011
        value := subFileType.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4012
        numberType := #long.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4013
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4014
    (tagType == 256) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4015
        "ImageWidth"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4016
        value := width.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4017
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4018
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4019
    (tagType == 257) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4020
        "ImageHeight"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4021
        value := height.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4022
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4023
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4024
    (tagType == 258) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4025
        "bitspersample"
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4026
        address := bitsPerSamplePos.
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4027
        numberType := #short.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4028
        count := bitsPerSample size.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4029
        valueArray := bitsPerSample
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4030
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4031
    (tagType == 259) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4032
        "compression"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4033
        value := compression.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4034
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4035
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4036
    (tagType == 262) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4037
        "photometric"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4038
        (photometric == #whiteIs0) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4039
            value := 0
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4040
        ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4041
            (photometric == #blackIs0) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4042
                value := 1
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4043
            ] ifFalse:[
4011
0dfddf756e27 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  4044
                ((photometric == #rgb) or:[(photometric == #rgba)]) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4045
                    value := 2
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4046
                ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4047
                    (photometric == #palette) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4048
                        value := 3
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4049
                    ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4050
                        (photometric == #transparency) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4051
                            value := 4
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4052
                        ] ifFalse:[
4011
0dfddf756e27 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  4053
                            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
  4054
                        ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4055
                    ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4056
                ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4057
            ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4058
        ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4059
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4060
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4061
    (tagType == 263) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4062
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4063
    (tagType == 264) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4064
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4065
    (tagType == 265) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4066
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4067
    (tagType == 266) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4068
        "fillOrder"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4069
        (fillOrder == #msb) ifTrue:[
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4070
            value := FILLORDER_MSB2LSB
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4071
        ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4072
            (fillOrder == #lsb) ifTrue:[
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4073
                value := FILLORDER_LSB2MSB
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4074
            ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4075
                self error:'bad fillOrder' mayProceed:true
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4076
            ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4077
        ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4078
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4079
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4080
    (tagType == 269) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4081
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4082
    (tagType == 270) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4083
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4084
    (tagType == 271) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4085
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4086
    (tagType == 272) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4087
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4088
    (tagType == 273) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4089
        "stripoffsets"
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4090
        address := stripOffsetsPos.
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4091
        numberType := #long.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4092
        count := stripOffsets size.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4093
        valueArray := stripOffsets
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4094
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4095
    (tagType == 274) ifTrue:[
3f9277473954 Initial revision
claus
parents:
diff changeset
  4096
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4097
    (tagType == 277) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4098
        "samplesPerPixel"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4099
        value := samplesPerPixel.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4100
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4101
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4102
    (tagType == 278) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4103
        "rowsperstrip"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4104
        value := rowsPerStrip.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4105
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4106
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4107
    (tagType == 279) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4108
        "stripbytecount"
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4109
        address := stripByteCountsPos.
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4110
        numberType := #short.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4111
        count := stripByteCounts size.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4112
        valueArray := stripByteCounts
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4113
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4114
    (tagType == 280) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4115
        "min sample value"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4116
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4117
    (tagType == 281) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4118
        "max sample value"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4119
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4120
    (tagType == 282) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4121
        "x resolution"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4122
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4123
    (tagType == 283) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4124
        "y resolution"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4125
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4126
    (tagType == 284) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4127
        "planarconfig"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4128
        value := planarConfiguration.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4129
        numberType := #short.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4130
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4131
    (tagType == 285) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4132
        "pageName"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4133
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4134
    (tagType == 286) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4135
        "xPosition"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4136
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4137
    (tagType == 287) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4138
        "yPosition"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4139
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4140
    (tagType == 288) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4141
        "freeOffsets"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4142
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4143
    (tagType == 289) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4144
        "freeByteCounts"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4145
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4146
    (tagType == 290) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4147
        "grayResponceUnit"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4148
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4149
    (tagType == 291) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4150
        "grayResponceCurve"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4151
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4152
    (tagType == 292) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4153
        "group3options"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4154
        value := group3options.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4155
        numberType := #long.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4156
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4157
    (tagType == 293) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4158
        "group4options"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4159
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4160
    (tagType == 296) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4161
        "resolutionunit"
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4162
        ^ self
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4163
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4164
    (tagType == 297) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4165
        "pageNumber"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4166
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4167
    (tagType == 300) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4168
        "colorResponceUnit"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4169
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4170
    (tagType == 301) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4171
        "colorResponceCurve"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4172
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4173
    (tagType == 306) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4174
        "dateTime"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4175
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4176
    (tagType == 315) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4177
        "artist"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4178
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4179
    (tagType == 317) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4180
        "predictor"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4181
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4182
    (tagType == 320) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4183
        "colormap"
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4184
        address := colorMapPos.
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4185
        numberType := #short.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4186
        count := 256 "(colorMap at:1) size" * 3.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4187
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4188
3f9277473954 Initial revision
claus
parents:
diff changeset
  4189
    (value isNil and:[address isNil]) ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4190
        self error:'unhandled tag' mayProceed:true.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4191
        ^ self
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4192
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4193
14
20638e830834 *** empty log message ***
claus
parents: 11
diff changeset
  4194
"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4195
'tag:' print. tagType print. ' typ:' print. numberType print.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4196
' len:' print. count print.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4197
' val:' print. value printNewline.  
14
20638e830834 *** empty log message ***
claus
parents: 11
diff changeset
  4198
"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4199
3f9277473954 Initial revision
claus
parents:
diff changeset
  4200
    self writeShort:tagType.
3f9277473954 Initial revision
claus
parents:
diff changeset
  4201
    numberType == #short ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4202
        self writeShort:3.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4203
        self writeLong:count.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4204
    ] ifFalse:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4205
        numberType == #long ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4206
            self writeShort:4.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4207
            self writeLong:count.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4208
        ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4209
            numberType == #byte ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4210
                self writeShort:1.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4211
                self writeLong:count.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4212
            ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4213
                self error:'bad numbertype'
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4214
            ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4215
        ]
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4216
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4217
    address notNil ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4218
        (numberType == #long and:[count == 1]) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4219
            self writeLong:(valueArray at:1).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4220
            ^ self
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4221
        ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4222
        (numberType == #short and:[count <= 2]) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4223
            self writeShort:(valueArray at:1).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4224
            count == 2 ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4225
                self writeShort:(valueArray at:2).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4226
            ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4227
                self writeShort:0
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4228
            ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4229
            ^ self
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4230
        ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4231
        (numberType == #byte and:[count <= 4]) ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4232
            outStream nextPut:(valueArray at:1).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4233
            count > 1 ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4234
                outStream nextPut:(valueArray at:2).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4235
                count > 2 ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4236
                    outStream nextPut:(valueArray at:3).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4237
                    count > 3 ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4238
                        outStream nextPut:(valueArray at:4).
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4239
                    ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4240
                        outStream nextPut:0
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4241
                    ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4242
                ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4243
                    outStream nextPut:0
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4244
                ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4245
            ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4246
                outStream nextPut:0
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4247
            ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4248
            ^ self
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4249
        ].
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4250
        self writeLong:address.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4251
        ^ self
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4252
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4253
    numberType == #short ifTrue:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4254
        self writeShort:value.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4255
        self writeShort:0
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4256
    ] ifFalse:[
1215
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4257
        numberType == #long ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4258
            self writeLong:value
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4259
        ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4260
            numberType == #byte ifTrue:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4261
                outStream nextPut:value.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4262
                outStream nextPut:0.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4263
                outStream nextPut:0.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4264
                outStream nextPut:0.
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4265
            ] ifFalse:[
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4266
                self error:'bad numbertype'
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4267
            ]
e40392a58092 error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents: 1078
diff changeset
  4268
        ]
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4269
    ].
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4270
4011
0dfddf756e27 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4000
diff changeset
  4271
    "Modified: / 13-09-2017 / 10:08:52 / cg"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4272
!
3f9277473954 Initial revision
claus
parents:
diff changeset
  4273
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4274
writeUncompressedBits
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4275
    "write bits as one or multiple strips"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4276
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4277
    |offs bytesPerRow nBytes
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4278
     h "{ Class: SmallInteger }"|
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4279
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4280
    nBytes := data size.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4281
    nBytes < 16rFFFF ifTrue:[
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4282
        stripOffsets := Array with:(outStream position).
1703
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4283
        stripByteCounts := Array with:nBytes.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4284
        outStream nextPutBytes:nBytes from:data.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4285
        rowsPerStrip := height
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4286
    ] ifFalse:[
1703
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4287
        stripOffsets := Array basicNew:height.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4288
        bytesPerRow := nBytes // height.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4289
        stripByteCounts := (Array basicNew:height) atAllPut:bytesPerRow.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4290
1703
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4291
        offs := 1.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4292
        h := height.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4293
        1 to:h do:[:row |
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4294
            stripOffsets at:row put:(outStream position).
1703
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4295
            outStream nextPutBytes:bytesPerRow from:data startingAt:offs.
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4296
            offs := offs + bytesPerRow
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4297
        ].
5a08db3f0013 prep for 0-based stream position
Claus Gittinger <cg@exept.de>
parents: 1702
diff changeset
  4298
        rowsPerStrip := 1
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4299
    ].
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4300
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4301
    'stripOffsets: ' print. stripOffsets printNewline.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4302
    'stripByteCounts: ' print. stripByteCounts printNewline.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4303
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4304
! !
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4305
1805
93f557cbe600 category changes
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
  4306
!TIFFReader methodsFor:'reading'!
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4307
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4308
fromStream:aStream
192
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4309
    "read a stream containing a TIFF image.
3899
fd43372bf11d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3777
diff changeset
  4310
     Leave image description in instance variables.
fd43372bf11d #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3777
diff changeset
  4311
     (i.e. to get the image, ask with image)."
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4312
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4313
    |char1 char2 version offset msb
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4314
     bytesPerRow img moreIfds atEnd|
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4315
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4316
    inStream := aStream.
331
304f9c439efa allow reading from ByteArray-readStreams
Claus Gittinger <cg@exept.de>
parents: 329
diff changeset
  4317
    aStream binary.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4318
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4319
    char1 := aStream next.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4320
    char2 := aStream next.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4321
    
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4322
    "/ first two chars are either II (intel byte order) 
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4323
    "/ or MM (motorola byte orrder)
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4324
    (char1 ~~ char2) ifTrue:[
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  4325
        ^ self fileFormatError:'not a tiff file'.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4326
    ].
1953
90f3c42ef3c1 Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents: 1846
diff changeset
  4327
    (char1 == $I codePoint) ifTrue:[
192
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4328
        byteOrder := #lsb.
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4329
        msb := false.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4330
    ] ifFalse:[
1953
90f3c42ef3c1 Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents: 1846
diff changeset
  4331
        (char1 == $M codePoint) ifTrue:[
192
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4332
            byteOrder := #msb.
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4333
            msb := true.
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4334
        ] ifFalse:[
814
6240dfc2fd3b use common fileFormatError reporter
Claus Gittinger <cg@exept.de>
parents: 744
diff changeset
  4335
            ^ self fileFormatError:'not a tiff file'.
192
947cc10f86dc commentary
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  4336
        ]
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4337
    ].
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4338
    
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4339
    version := aStream nextUnsignedInt16MSB:msb.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4340
    (version == 42) ifTrue:[
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4341
        isBigTiff := false.
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4342
    ] ifFalse:[
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4343
       (version == 43) ifTrue:[
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4344
            |byteSizeOfOffsets always0|
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4345
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4346
            "/ 43 is the proposed bigtiff format
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4347
            isBigTiff := true.
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4348
            byteSizeOfOffsets := aStream nextUnsignedInt16MSB:msb.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4349
            byteSizeOfOffsets == 8 ifFalse:[
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4350
                ^ self fileFormatError:'version of bigtiff-file not supported'.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4351
            ].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4352
            always0 := aStream nextUnsignedInt16MSB:msb.
3975
1315fd14851b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3974
diff changeset
  4353
            always0 == 0 ifFalse:[
3974
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4354
                ^ self fileFormatError:'version of bigtiff-file not supported'.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4355
            ].
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4356
        ] ifFalse:[    
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4357
            ^ self fileFormatError:'version of tiff-file not supported'.
b4f7c8442dd8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3957
diff changeset
  4358
        ].
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4359
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4360
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4361
    imageSequence := ImageSequence new.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4362
    isDNGImage := false.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4363
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4364
    isBigTiff ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4365
        offset := aStream nextUnsignedInt32MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4366
    ] ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4367
        offset := aStream nextUnsignedInt64MSB:msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4368
    ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4369
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4370
    [ offset ~~ 0 ] whileTrue:[    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4371
        Verbose == true ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4372
            Logger info:'------------------ reading image #%1 ------------------' with:imageSequence size+1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4373
        ].    
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4374
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4375
        "/ no more images, if tagData immediately follows (i.e. position == offset)
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4376
        atEnd := (aStream position == offset).
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4377
        atEnd := false.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4378
        
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4379
        aStream position:offset.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4380
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4381
        "setup default values"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4382
        metaData := TIFFMetaData new.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4383
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4384
        compression := 1. "none"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4385
        fillOrder := #msb.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4386
        planarConfiguration := PLANARCONFIG_CONTIG.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4387
        photometric := nil.
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4388
        bitsPerSample := nil.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4389
        samplesPerPixel := 1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4390
        width := height := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4391
        stripOffsets := stripByteCounts := rowsPerStrip := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4392
        "resolutionUnit := 2."
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4393
        predictor := 1.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4394
        group3options := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4395
        orientation := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4396
        subFileType := subIfds := nil.
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4397
        sampleFormat := SAMPLEFORMAT_UINT.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4398
        minSampleValue := maxSampleValue := nil.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4399
        tileWidth := tileLength := tileOffsets := tileByteCounts := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4400
        
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4401
        self readTagsFrom:aStream.
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4402
        
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4403
        "/ read the next offset now,
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4404
        "/ 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
  4405
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4406
        (stripOffsets at:1) == aStream position ifTrue:[
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4407
            offset := 0
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4408
        ] ifFalse:[
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4409
            isBigTiff ifFalse:[
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4410
                offset := aStream nextUnsignedInt32MSB:msb.
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4411
            ] ifTrue:[
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4412
                offset := aStream nextUnsignedInt64MSB:msb.
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4413
            ].    
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4414
        ].
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4415
        
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4416
        "check for required tags"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4417
        width isNil ifTrue:[ ^ self fileFormatError:'missing width tag' ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4418
        height isNil ifTrue:[ ^ self fileFormatError:'missing length tag' ].
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4419
        bitsPerSample isNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4420
            bitsPerSample := Array new:samplesPerPixel withAll:1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4421
        ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4422
        
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4423
        photometric isNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4424
            "/ try to repair
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4425
            bitsPerSample sum == 1 ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4426
                photometric := #whiteIs0.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4427
            ] ifFalse:[    
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4428
                ^ self fileFormatError:'missing photometric tag' 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4429
            ].
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4430
        ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4431
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4432
        "given all the information, read the bits"
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4433
        tileWidth notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4434
            tileOffsets := tileOffsets ? stripOffsets.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4435
            tileByteCounts := tileByteCounts ? stripByteCounts.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4436
            (tileOffsets notNil 
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4437
                and:[tileLength notNil
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4438
                and:[tileByteCounts notNil ]]
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4439
            ) ifFalse:[    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4440
                ^ self fileFormatError:'missing stripOffsets (or tileOffsets)'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4441
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4442
            self reportDimension.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4443
            self readTiledTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4444
        ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4445
            stripByteCounts isNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4446
                stripOffsets size == 1 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4447
                    stripByteCounts := Array with:(self bitsPerPixel // 8) * width * height
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4448
                ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4449
                    ^ self fileFormatError:'missing stripByteCounts'.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4450
                ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4451
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4452
            rowsPerStrip isNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4453
                rowsPerStrip := height
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4454
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4455
            self reportDimension.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4456
            self readTiffImageData.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4457
        ].
3693
0b4a3090f2a8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3610
diff changeset
  4458
    
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4459
        orientation notNil ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4460
            orientation == #unsupported ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4461
                'TIFFReader [warning]: unsupported orientation' errorPrintCR
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4462
            ] ifFalse:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4463
                orientation == #vFlip ifTrue:[
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4464
                    |tmp offset1 offset2|
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4465
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4466
                    "/ reverse rows to top-to bottom 
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4467
                    "/ (oops - depends on side-effecting the data array)
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4468
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4469
                    bytesPerRow := self bytesPerRow.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4470
                    tmp := ByteArray new:bytesPerRow.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4471
                    offset1 := 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4472
                    offset2 := (height-1)*bytesPerRow + 1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4473
                    0 to:((height-1)//2) do:[:row |
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4474
                        tmp replaceFrom:1 to:bytesPerRow with:data startingAt:offset1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4475
                        data replaceFrom:offset1 to:(offset1+bytesPerRow-1) with:data startingAt:offset2.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4476
                        data replaceFrom:offset2 to:(offset2+bytesPerRow-1) with:tmp startingAt:1.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4477
                        offset1 := offset1 + bytesPerRow.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4478
                        offset2 := offset2 - bytesPerRow.
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4479
                    ].
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4480
                ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4481
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4482
        ].
3986
a71704884650 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3985
diff changeset
  4483
        
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4484
        "/ fixup photoetric
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4485
        photometric == #rgb ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4486
            samplesPerPixel == 4 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4487
                photometric := #rgba
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4488
            ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4489
        ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4490
        
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4491
        img := self makeImage.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4492
        img imageSequence:imageSequence.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4493
        imageSequence add:(ImageFrame new image:img).
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4494
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4495
        offset == 0 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4496
            moreIfds isNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4497
                subIfds notNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4498
                    (isDNGImage not or:[loadFullResolutionImage == true]) ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4499
                        moreIfds := OrderedCollection withAll:subIfds.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4500
                        subIfds := nil.
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4501
                    ] ifFalse:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4502
                        Verbose == true ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4503
                            Logger info:'skip high resolution images (use loadFullResolutionImage is false)'
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4504
                        ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4505
                    ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4506
                ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4507
            ].
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4508
            moreIfds notEmptyOrNil ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4509
                offset := moreIfds removeFirst
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4510
            ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4511
        ].    
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4512
    ].
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4513
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4514
    imageSequence size > 1 ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4515
        Verbose == true ifTrue:[
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4516
            Logger info:'read %1 images' with:imageSequence size
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4517
        ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4518
    ].    
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4519
    ^ self
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4520
4015
7f7b255c15c2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4011
diff changeset
  4521
    "Modified: / 17-09-2017 / 13:06:10 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4522
! !
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4523
1805
93f557cbe600 category changes
Claus Gittinger <cg@exept.de>
parents: 1785
diff changeset
  4524
!TIFFReader methodsFor:'writing'!
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4525
1571
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4526
save:image onStream:aStream
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4527
    "save image as (uncompressed) TIFF file on aFileName"
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4528
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4529
    |pos1 pos indicator|
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4530
1078
fc33e172bbbc raise informationLostSignal before attemting to write the file
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
  4531
    image mask notNil ifTrue:[
fc33e172bbbc raise informationLostSignal before attemting to write the file
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
  4532
        Image informationLostQuerySignal
fc33e172bbbc raise informationLostSignal before attemting to write the file
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
  4533
            raiseWith:image
fc33e172bbbc raise informationLostSignal before attemting to write the file
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
  4534
            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
  4535
    ].
fc33e172bbbc raise informationLostSignal before attemting to write the file
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
  4536
1571
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4537
    outStream := aStream.
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4538
    outStream binary.
461
bacef118f54a more signals to be raised if anything happens during
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
  4539
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4540
    "save as msb"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4541
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4542
    byteOrder := #msb.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4543
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4544
    byteOrder := #lsb.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4545
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4546
    fillOrder := #msb.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4547
    width := image width.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4548
    height := image height.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4549
    photometric := image photometric.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4550
    samplesPerPixel := image samplesPerPixel.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4551
    bitsPerSample := image bitsPerSample.
1785
16917d309b46 oops - position incompatibility fixed
Claus Gittinger <cg@exept.de>
parents: 1762
diff changeset
  4552
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4553
    colorMap := image colorMap.
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4554
    planarConfiguration := PLANARCONFIG_CONTIG.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4555
    compression := 1.   "none"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4556
    data := image bits.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4557
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4558
    currentOffset := 0.
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
    (byteOrder == #msb) ifTrue:[
1953
90f3c42ef3c1 Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents: 1846
diff changeset
  4561
        indicator := $M codePoint.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4562
    ] ifFalse:[
1953
90f3c42ef3c1 Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents: 1846
diff changeset
  4563
        indicator := $I codePoint.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4564
    ].
1571
cffaf89a0c6e New: #save:onStream
Stefan Vogel <sv@exept.de>
parents: 1230
diff changeset
  4565
    outStream nextPut:indicator; nextPut:indicator.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4566
    currentOffset := currentOffset + 2.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4567
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4568
    self writeShort:42.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4569
    currentOffset := currentOffset + 2.
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4570
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4571
    pos1 := outStream position.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4572
    self writeLong:0.           "start of tags - filled in later"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4573
    currentOffset := currentOffset + 4.
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4574
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4575
    "output strips"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4576
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4577
    self writeUncompressedBits. "this outputs bits as strips, sets stripOffsets and stripByteCounts"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4578
    self writeStripOffsets.     "this outputs strip offsets, sets stripOffsetsPos"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4579
    self writeStripByteCounts.  "this outputs strip bytecounts, sets stripByteCountPos"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4580
    self writeBitsPerSample.    "this outputs bitsPerSample, sets bitsPerSamplePos"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4581
    photometric == #palette ifTrue:[
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4582
        self writeColorMap      "this outputs colorMap, sets colorMapPos"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4583
    ].
3f9277473954 Initial revision
claus
parents:
diff changeset
  4584
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4585
    pos := outStream position.        "backpatch tag offset"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4586
    outStream position:pos1.
1704
1526c7b84920 code rewritten to be independent of stream zero-base
Claus Gittinger <cg@exept.de>
parents: 1703
diff changeset
  4587
    self writeLong:pos.                     "fill in tag offset"
3211
6d43ccc9adc4 class: TIFFReader
Stefan Vogel <sv@exept.de>
parents: 3112
diff changeset
  4588
    outStream position:pos.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4589
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4590
('patch tag offset at: ', (pos1 printStringRadix:16) , ' to ',
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4591
                         (pos printStringRadix:16)) printNewline.
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4592
"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4593
    "output tag data"
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4594
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4595
    photometric == #palette ifTrue:[
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4596
        self writeShort:11.  "11 tags"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4597
    ] ifFalse:[
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4598
        self writeShort:10.  "10 tags"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4599
    ].
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4600
    self writeTag:256.               "image width"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4601
    self writeTag:257.               "image height"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4602
    self writeTag:258.               "bits per sample"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4603
    self writeTag:259.               "compression"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4604
    self writeTag:262.               "photometric"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4605
    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
  4606
    self writeTag:277.               "samplesPerPixel"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4607
    self writeTag:278.               "rowsPerStrip"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4608
    self writeTag:279.               "strip byte counts"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4609
    self writeTag:284.               "planarconfig"
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4610
    photometric == #palette ifTrue:[
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4611
        self writeTag:320            "colorMap"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4612
    ].
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4613
    self writeLong:0.                "end of tags mark"
3984
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4614
e533a09c2c1d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3980
diff changeset
  4615
    "Modified: / 27-08-2017 / 13:36:35 / cg"
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4616
! !
30
9638bc775850 *** empty log message ***
claus
parents: 28
diff changeset
  4617
357
4bcb93f5892e newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
  4618
!TIFFReader class methodsFor:'documentation'!
30
9638bc775850 *** empty log message ***
claus
parents: 28
diff changeset
  4619
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4620
version
3552
ef88cdf452d1 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 3382
diff changeset
  4621
    ^ '$Header$'
3976
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  4622
!
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  4623
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  4624
version_CVS
5eda7dd4846b #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3975
diff changeset
  4625
    ^ '$Header$'
0
3f9277473954 Initial revision
claus
parents:
diff changeset
  4626
! !
1702
75a595a70c86 stream position is going to be 0-based soon
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
  4627
3112
d6fbee4954ca class: TIFFReader
Claus Gittinger <cg@exept.de>
parents: 1953
diff changeset
  4628
135
ff507d9a242b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 117
diff changeset
  4629
TIFFReader initialize!