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
Issue with saving #14
Comments
Hi, I'l having a look to this issue right now. Thank for the report. |
Hi, I just did a test with your Tif >>> t = Tyf.open("test/issue #14.tif")
<IFD tag RowsPerStrip:None>: EncodingException('4294967295 not in range [0:256[')
>>> t.save("output.tif")
<IFD tag StripOffsets:27706>: EncodingException('27593 not in range [0:256[')
|
Ok, I had a better look to my code : StripOffset is either a Thanks. |
Sorry haven't got a chance testing this. Will test and report back. |
Hi, Thanks, |
Hi there,
I am guessing this is a recurrence of previous issues.
This is a simple code:
import numpy as np
import Tyf
import tifffile as tiff
filename="Test.tif"
outputname="output.tif"
img = tiff.imread(filename)
exif_info = Tyf.open(filename)
tiff.imsave(outputname, img)
exif_info.save(outputname)
And I got following error:
Traceback (most recent call last):
File "J:/notebook/simple_test_exif.py", line 12, in
exif_info.save(outputname)
File "C:\Users\sean_\AppData\Local\Programs\Python\Python37\lib\site-packages\Tyf_init_.py", line 352, in save
next_ifd = to_buffer(i, fileobj, next_ifd, byteorder)
File "C:\Users\sean_\AppData\Local\Programs\Python\Python37\lib\site-packages\Tyf_init_.py", line 252, in to_buffer
next_ifd_offset = dump(obj, fileobj, offset, byteorder)
File "C:\Users\sean_\AppData\Local\Programs\Python\Python37\lib\site-packages\Tyf_init_.py", line 250, in dump
dump(getattr(i, "%s"%tag), f, i.get(tag).value[0], b)
File "C:\Users\sean\AppData\Local\Programs\Python\Python37\lib\site-packages\Tyf_init_.py", line 251, in dump
return write_IFD(i,f,o,b)
File "C:\Users\sean\AppData\Local\Programs\Python\Python37\lib\site-packages\Tyf_init_.py", line 162, in write_IFD
pack(byteorder+fmt, fileobj, value)
File "C:\Users\sean\AppData\Local\Programs\Python\Python37\lib\site-packages\Tyf_init_.py", line 14, in
pack = lambda fmt, fileobj, value: fileobj.write(struct.pack(fmt, *value))
struct.error: ubyte format requires 0 <= number <= 255
I've also attached the zipped TIF file for your reference.
Could you please take a look?
Thanks,
Sean
test.zip
The text was updated successfully, but these errors were encountered: