Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiled multi-page tiff corrupted? #129

Open
giacomomarchioro opened this issue Sep 6, 2021 · 0 comments
Open

Tiled multi-page tiff corrupted? #129

giacomomarchioro opened this issue Sep 6, 2021 · 0 comments

Comments

@giacomomarchioro
Copy link

Hello,
thanks for this interesting package.
After installing it using pip install git+https://github.com/pearu/pylibtiff in macOS Catilina 10.15.7 (Python 3.8.3 [Clang 10.0.0 ] :: Anaconda, Inc. on darwin) using this test data:

import skimage
import matplotlib.pyplot as plt
import numpy as np
test = skimage.data.astronaut()
plt.imshow(test)

# we dstack many test images togheter to create our test data
data = skimage.data.astronaut()
for i in range(4):
    data = np.dstack([data,data])

I have tried to generate a tiled multi-page tif

from libtiff import TIFF
imagename = "libtiff_astro.tif"
# to open a tiff file for writing:
tif = TIFF.open("/Users/univr/Documents/iipsrv/images/%s"%imagename, mode='w')
# to write a image to tiff file
tif.write_tiles(data,tile_width=256,tile_height=256,compression=None,write_rgb=None)

However, this results in a corrupted file. Can you please give me some hints on how to solve it?
Thanks a lot.
Giacomo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant