using
System;
using
System.Collections.Generic;
using
System.Collections;
using
System.Text;
namespace
EXIF
{
///
<summary>
///
summary description for translation.
///
</summary>
public
class
translation : Hashtable
{
///
<summary>
///
///
</summary>
public
translation()
{
this
.Add(
0x8769
,
"
exif ifd
"
);
this
.Add(
0x8825
,
"
gps ifd
"
);
this
.Add(
0xfe
,
"
new subfile type
"
);
this
.Add(
0xff
,
"
subfile type
"
);
this
.Add(
0x100
,
"
image width
"
);
this
.Add(
0x101
,
"
image height
"
);
this
.Add(
0x102
,
"
bits per sample
"
);
this
.Add(
0x103
,
"
compression
"
);
this
.Add(
0x106
,
"
photometric interp
"
);
this
.Add(
0x107
,
"
thresh holding
"
);
this
.Add(
0x108
,
"
cell width
"
);
this
.Add(
0x109
,
"
cell height
"
);
this
.Add(
0x10a
,
"
fill order
"
);
this
.Add(
0x10d
,
"
document name
"
);
this
.Add(
0x10e
,
"
image description
"
);
this
.Add(
0x10f
,
"
equip make
"
);
this
.Add(
0x110
,
"
equip model
"
);
this
.Add(
0x111
,
"
strip offsets
"
);
this
.Add(
0x112
,
"
orientation
"
);
this
.Add(
0x115
,
"
samples perpixel
"
);
this
.Add(
0x116
,
"
rows per strip
"
);
this
.Add(
0x117
,
"
strip bytes count
"
);
this
.Add(
0x118
,
"
min sample value
"
);
this
.Add(
0x119
,
"
max sample value
"
);
this
.Add(
0x11a
,
"
x resolution
"
);
this
.Add(
0x11b
,
"
y resolution
"
);
this
.Add(
0x11c
,
"
planar config
"
);
this
.Add(
0x11d
,
"
page name
"
);
this
.Add(
0x11e
,
"
x position
"
);
this
.Add(
0x11f
,
"
y position
"
);
this
.Add(
0x120
,
"
free offset
"
);
this
.Add(
0x121
,
"
free byte counts
"
);
this
.Add(
0x122
,
"
gray response unit
"
);
this
.Add(
0x123
,
"
gray response curve
"
);
this
.Add(
0x124
,
"
t4 option
"
);
this
.Add(
0x125
,
"
t6 option
"
);
this
.Add(
0x128
,
"
resolution unit
"
);
this
.Add(
0x129
,
"
page number
"
);
this
.Add(
0x12d
,
"
transfer funcition
"
);
this
.Add(
0x131
,
"
software used
"
);
this
.Add(
0x132
,
"
date time
"
);
this
.Add(
0x13b
,
"
artist
"
);
this
.Add(
0x13c
,
"
host computer
"
);
this
.Add(
0x13d
,
"
predictor
"
);
this
.Add(
0x13e
,
"
white point
"
);
this
.Add(
0x13f
,
"
primary chromaticities
"
);
this
.Add(
0x140
,
"
colormap
"
);
this
.Add(
0x141
,
"
halftone hints
"
);
this
.Add(
0x142
,
"
tile width
"
);
this
.Add(
0x143
,
"
tile length
"
);
this
.Add(
0x144
,
"
tile offset
"
);
this
.Add(
0x145
,
"
tile bytecounts
"
);
this
.Add(
0x14c
,
"
inkset
"
);
this
.Add(
0x14d
,
"
ink names
"
);
this
.Add(
0x14e
,
"
number of inks
"
);
this
.Add(
0x150
,
"
dot range
"
);
this
.Add(
0x151
,
"
target printer
"
);
this
.Add(
0x152
,
"
extra samples
"
);
this
.Add(
0x153
,
"
sample format
"
);
this
.Add(
0x154
,
"
s min sample value
"
);
this
.Add(
0x155
,
"
s max sample value
"
);
this
.Add(
0x156
,
"
transfer range
"
);
this
.Add(
0x200
,
"
jpeg proc
"
);
this
.Add(
0x201
,
"
jpeg interformat
"
);
this
.Add(
0x202
,
"
jpeg interlength
"
);
this
.Add(
0x203
,
"
jpeg restartinterval
"
);
this
.Add(
0x205
,
"
jpeg losslesspredictors
"
);
this
.Add(
0x206
,
"
jpeg pointtransforms
"
);
this
.Add(
0x207
,
"
jpeg qtables
"
);
this
.Add(
0x208
,
"
jpeg dctables
"
);
this
.Add(
0x209
,
"
jpeg actables
"
);
this
.Add(
0x211
,
"
ycbcr coefficients
"
);
this
.Add(
0x212
,
"
ycbcr subsampling
"
);
this
.Add(
0x213
,
"
ycbcr positioning
"
);
this
.Add(
0x214
,
"
ref black white
"
);
this
.Add(
0x8773
,
"
icc profile
"
);
this
.Add(
0x301
,
"
gamma
"
);
this
.Add(
0x302
,
"
icc profile descriptor
"
);
this
.Add(
0x303
,
"
srgb renderingintent
"
);
this
.Add(
0x320
,
"
image title
"
);
this
.Add(
0x8298
,
"
copyright
"
);
this
.Add(
0x5001
,
"
resolution x unit
"
);
this
.Add(
0x5002
,
"
resolution y unit
"
);
this
.Add(
0x5003
,
"
resolution x lengthunit
"
);
this
.Add(
0x5004
,
"
resolution y lengthunit
"
);
this
.Add(
0x5005
,
"
print flags
"
);
this
.Add(
0x5006
,
"
print flags version
"
);
this
.Add(
0x5007
,
"
print flags crop
"
);
this
.Add(
0x5008
,
"
print flags bleed width
"
);
this
.Add(
0x5009
,
"
print flags bleed width scale
"
);
this
.Add(
0x500a
,
"
halftone lpi
"
);
this
.Add(
0x500b
,
"
halftone lpiunit
"
);
this
.Add(
0x500c
,
"
halftone degree
"
);
this
.Add(
0x500d
,
"
halftone shape
"
);
this
.Add(
0x500e
,
"
halftone misc
"
);
this
.Add(
0x500f
,
"
halftone screen
"
);
this
.Add(
0x5010
,
"
jpeg quality
"
);
this
.Add(
0x5011
,
"
grid size
"
);
this
.Add(
0x5012
,
"
thumbnail format
"
);
this
.Add(
0x5013
,
"
thumbnail width
"
);
this
.Add(
0x5014
,
"
thumbnail height
"
);
this
.Add(
0x5015
,
"
thumbnail colordepth
"
);
this
.Add(
0x5016
,
"
thumbnail planes
"
);
this
.Add(
0x5017
,
"
thumbnail rawbytes
"
);
this
.Add(
0x5018
,
"
thumbnail size
"
);
this
.Add(
0x5019
,
"
thumbnail compressedsize
"
);
this
.Add(
0x501a
,
"
color transfer function
"
);
this
.Add(
0x501b
,
"
thumbnail data
"
);
this
.Add(
0x5020
,
"
thumbnail imagewidth
"
);
this
.Add(
0x502
,
"
thumbnail imageheight
"
);
this
.Add(
0x5022
,
"
thumbnail bitspersample
"
);
this
.Add(
0x5023
,
"
thumbnail compression
"
);
this
.Add(
0x5024
,
"
thumbnail photometricinterp
"
);
this
.Add(
0x5025
,
"
thumbnail imagedescription
"
);
this
.Add(
0x5026
,
"
thumbnail equipmake
"
);
this
.Add(
0x5027
,
"
thumbnail equipmodel
"
);
this
.Add(
0x5028
,
"
thumbnail stripoffsets
"
);
this
.Add(
0x5029
,
"
thumbnail orientation
"
);
this
.Add(
0x502a
,
"
thumbnail samplesperpixel
"
);
this
.Add(
0x502b
,
"
thumbnail rowsperstrip
"
);
this
.Add(
0x502c
,
"
thumbnail stripbytescount
"
);
this
.Add(
0x502d
,
"
thumbnail resolutionx
"
);
this
.Add(
0x502e
,
"
thumbnail resolutiony
"
);
this
.Add(
0x502f
,
"
thumbnail planarconfig
"
);
this
.Add(
0x5030
,
"
thumbnail resolutionunit
"
);
this
.Add(
0x5031
,
"
thumbnail transferfunction
"
);
this
.Add(
0x5032
,
"
thumbnail softwareused
"
);
this
.Add(
0x5033
,
"
thumbnail datetime
"
);
this
.Add(
0x5034
,
"
thumbnail artist
"
);
this
.Add(
0x5035
,
"
thumbnail whitepoint
"
);
this
.Add(
0x5036
,
"
thumbnail primarychromaticities
"
);
this
.Add(
0x5037
,
"
thumbnail ycbcrcoefficients
"
);
this
.Add(
0x5038
,
"
thumbnail ycbcrsubsampling
"
);
this
.Add(
0x5039
,
"
thumbnail ycbcrpositioning
"
);
this
.Add(
0x503a
,
"
thumbnail refblackwhite
"
);
this
.Add(
0x503b
,
"
thumbnail copyright
"
);
this
.Add(
0x5090
,
"
luminance table
"
);
this
.Add(
0x5091
,
"
chrominance table
"
);
this
.Add(
0x5100
,
"
frame delay
"
);
this
.Add(
0x5101
,
"
loop count
"
);
this
.Add(
0x5110
,
"
pixel unit
"
);
this
.Add(
0x5111
,
"
pixel perunit x
"
);
this
.Add(
0x5112
,
"
pixel perunit y
"
);
this
.Add(
0x5113
,
"
palette histogram
"
);
this
.Add(
0x829a
,
"
exposure time
"
);
this
.Add(
0x829d
,
"
f-number
"
);
this
.Add(
0x8822
,
"
exposure prog
"
);
this
.Add(
0x8824
,
"
spectral sense
"
);
this
.Add(
0x8827
,
"
iso speed
"
);
this
.Add(
0x8828
,
"
oecf
"
);
this
.Add(
0x9000
,
"
ver
"
);
this
.Add(
0x9003
,
"
dtorig
"
);
this
.Add(
0x9004
,
"
dtdigitized
"
);
this
.Add(
0x9101
,
"
compconfig
"
);
this
.Add(
0x9102
,
"
compbpp
"
);
this
.Add(
0x9201
,
"
shutter speed
"
);
this
.Add(
0x9202
,
"
aperture
"
);
this
.Add(
0x9203
,
"
brightness
"
);
this
.Add(
0x9204
,
"
exposure bias
"
);
this
.Add(
0x9205
,
"
maxaperture
"
);
this
.Add(
0x9206
,
"
subjectdist
"
);
this
.Add(
0x9207
,
"
metering mode
"
);
this
.Add(
0x9208
,
"
lightsource
"
);
this
.Add(
0x9209
,
"
flash
"
);
this
.Add(
0x920a
,
"
focallength
"
);
this
.Add(
0x927c
,
"
maker note
"
);
this
.Add(
0x9286
,
"
user comment
"
);
this
.Add(
0x9290
,
"
dtsubsec
"
);
this
.Add(
0x9291
,
"
dtorigss
"
);
this
.Add(
0x9292
,
"
dtdigss
"
);
this
.Add(
0xa000
,
"
fpxver
"
);
this
.Add(
0xa001
,
"
colorspace
"
);
this
.Add(
0xa002
,
"
pixxdim
"
);
this
.Add(
0xa003
,
"
pixydim
"
);
this
.Add(
0xa004
,
"
relatedwav
"
);
this
.Add(
0xa005
,
"
interop
"
);
this
.Add(
0xa20b
,
"
flashenergy
"
);
this
.Add(
0xa20c
,
"
spatialfr
"
);
this
.Add(
0xa20e
,
"
focalxres
"
);
this
.Add(
0xa20f
,
"
focalyres
"
);
this
.Add(
0xa210
,
"
focalresunit
"
);
this
.Add(
0xa214
,
"
subject loc
"
);
this
.Add(
0xa215
,
"
exposure index
"
);
this
.Add(
0xa217
,
"
sensing method
"
);
this
.Add(
0xa300
,
"
filesource
"
);
this
.Add(
0xa301
,
"
scenetype
"
);
this
.Add(
0xa302
,
"
cfapattern
"
);
this
.Add(
0x0
,
"
gps ver
"
);
this
.Add(
0x1
,
"
gps latituderef
"
);
this
.Add(
0x2
,
"
gps latitude
"
);
this
.Add(
0x3
,
"
gps longituderef
"
);
this
.Add(
0x4
,
"
gps longitude
"
);
this
.Add(
0x5
,
"
gps altituderef
"
);
this
.Add(
0x6
,
"
gps altitude
"
);
this
.Add(
0x7
,
"
gps gpstime
"
);
this
.Add(
0x8
,
"
gps gpssatellites
"
);
this
.Add(
0x9
,
"
gps gpsstatus
"
);
this
.Add(
0xa
,
"
gps gpsmeasuremode
"
);
this
.Add(
0xb
,
"
gps gpsdop
"
);
this
.Add(
0xc
,
"
gps speedref
"
);
this
.Add(
0xd
,
"
gps speed
"
);
this
.Add(
0xe
,
"
gps trackref
"
);
this
.Add(
0xf
,
"
gps track
"
);
this
.Add(
0x10
,
"
gps imgdirref
"
);
this
.Add(
0x11
,
"
gps imgdir
"
);
this
.Add(
0x12
,
"
gps mapdatum
"
);
this
.Add(
0x13
,
"
gps destlatref
"
);
this
.Add(
0x14
,
"
gps destlat
"
);
this
.Add(
0x15
,
"
gps destlongref
"
);
this
.Add(
0x16
,
"
gps destlong
"
);
this
.Add(
0x17
,
"
gps destbearref
"
);
this
.Add(
0x18
,
"
gps destbear
"
);
this
.Add(
0x19
,
"
gps destdistref
"
);
this
.Add(
0x1a
,
"
gps destdist
"
);
}
}
///
<summary>
///
private class
///
</summary>
internal
class
Rational
{
private
int
n;
private
int
d;
public
Rational(
int
n,
int
d)
{
this
.n
=
n;
this
.d
=
d;
simplify(
ref
this
.n,
ref
this
.d);
}
public
Rational(
uint
n,
uint
d)
{
this
.n
=
Convert.ToInt32(n);
this
.d
=
Convert.ToInt32(d);
simplify(
ref
this
.n,
ref
this
.d);
}
public
Rational()
{
this
.n
=
this
.d
=
0
;
}
public
string
ToString(
string
sp)
{
if
(sp
==
null
) sp
=
"
/
"
;
return
n.ToString()
+
sp
+
d.ToString();
}
public
double
ToDouble()
{
if
(d
==
0
)
return
0.0
;
return
Math.Round(Convert.ToDouble(n)
/
Convert.ToDouble(d),
2
);
}
private
void
simplify(
ref
int
a,
ref
int
b)
{
if
(a
==
0
||
b
==
0
)
return
;
int
gcd
=
euclid(a, b);
a
/=
gcd;
b
/=
gcd;
}
private
int
euclid(
int
a,
int
b)
{
if
(b
==
0
)
return
a;
else
return
euclid(b, a
%
b);
}
}
}