1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#!/usr/bin/env python
# autopkgtest check: Try importing tiffile module
# Author: Sascha Steinbiss <satta@debian.org>
import tifffile
import os
import tempfile
print(tifffile.__version__)
tmpdir = tempfile.mkdtemp()
filename = "%s/foo.tiff" % (tmpdir)
os.system("convert -size 100x100 xc:white %s" % (filename))
with tifffile.TiffFile(filename) as tif:
images = tif.asarray()
for page in tif:
for tag in page.tags.values():
t = tag.name, tag.value
print(t)
os.unlink(filename)
os.removedirs(tmpdir)
|