mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Use constants for tag types
This commit is contained in:
parent
daa8b51339
commit
9e52fb0fe4
|
@ -423,7 +423,7 @@ class ImageFileDirectory_v2(MutableMapping):
|
|||
|
||||
ifd = ImageFileDirectory_v2()
|
||||
ifd[key] = 'Some Data'
|
||||
ifd.tagtype[key] = 2
|
||||
ifd.tagtype[key] = TiffTags.ASCII
|
||||
print(ifd[key])
|
||||
'Some Data'
|
||||
|
||||
|
@ -557,7 +557,7 @@ class ImageFileDirectory_v2(MutableMapping):
|
|||
if info.type:
|
||||
self.tagtype[tag] = info.type
|
||||
else:
|
||||
self.tagtype[tag] = 7
|
||||
self.tagtype[tag] = TiffTags.UNDEFINED
|
||||
if all(isinstance(v, IFDRational) for v in values):
|
||||
self.tagtype[tag] = TiffTags.RATIONAL
|
||||
elif all(isinstance(v, int) for v in values):
|
||||
|
@ -872,7 +872,7 @@ class ImageFileDirectory_v1(ImageFileDirectory_v2):
|
|||
|
||||
ifd = ImageFileDirectory_v1()
|
||||
ifd[key] = 'Some Data'
|
||||
ifd.tagtype[key] = 2
|
||||
ifd.tagtype[key] = TiffTags.ASCII
|
||||
print(ifd[key])
|
||||
('Some Data',)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user