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

wrong data type? #12

Closed
LoveDaisy opened this issue Aug 4, 2017 · 4 comments
Closed

wrong data type? #12

LoveDaisy opened this issue Aug 4, 2017 · 4 comments

Comments

@LoveDaisy
Copy link

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?

@Moustikitos
Copy link
Owner

Hi,

It is a first one. What is the provenance of thetiff File (camera model, ...)

Thanks

@LoveDaisy
Copy link
Author

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.

@Moustikitos
Copy link
Owner

Moustikitos commented Aug 6, 2017

thanks for the details.
Will check thecode on the type tag attribution

@Moustikitos
Copy link
Owner

Fixed with last commit

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

2 participants