wrong data type?
LoveDaisy opened this issue · 4 comments
I'm testing a script to read and write a 16bit RGB-colored tiff file and find some error on data type. My test script is very simple like:
tif = Tyf.open(file_name)
tif.save(new_file_name)
and result in an error:
struct.error: ubyte format requires 0 <= number <= 255
After digging into the source file I find that data type of some tags might be wrong. For example in tags.py line 200, the ISOSpeedRatings
tag type is set as 1, while it is of type 3 when read from a tiff file (use function _read_IFD
in __init__.py
). Several data type mismatches has been found, including ExposureProgram
, MeteringMode
, Flash
, ColorSpace
, FocalPlaneResolutionUnit
, CustomRendered
, ExposureMode
, WhiteBalance
, SceneCaptureType
.
I'm not sure whether it is a problem of a special file format or of the OS platform, or anything else. Does anyone has met similar problems?
Hi,
It is a first one. What is the provenance of thetiff File (camera model, ...)
Thanks
My picture is taken originally by a Canon 6D Mark II camera, and use Adobe Camera Raw to decode the raw file and export as a 16bit RGB tiff file. All metadata are shown correct in Adobe Lightroom. I can email you the tiff file if necessary.
P.S. After I correct those mismatches in source file and run my script again, everything goes OK.
thanks for the details.
Will check thecode on the type tag attribution
Fixed with last commit