Closed Volfer closed 5 years ago
Made some fixes on the develop branch. The xResolution and yResolution are now set as rationals ("Two LONGs: the first represents the numerator of a fraction; the second, the denominator."). When you set the value as a single long, a denominator of 1 is added.
This test writes and reads the created tiff.
Good solution, thanks. Yesterday I've tried to set resolutions as a list of two long values (255, 1) and it worked, but some Image-soft also shows resolution as two values. And now everything is ok, the rational values exactly what is needed.
Version Information:
Expected Results:
Observed Results:
What happened instead?
Exception with no out tiff-file
How often does this occur?
Everytime if xResolution or yResolution is set.
Output:
Steps to Reproduce:
Step One
Step Two ...
Step Three newImage = new TIFFImage(); writeTiff(file, newImage);
Relevant Code:
Test Files:
Additional Information:
Any additional configuration, data, or information that might help with the issue?
I think, the Exception occurs because the type of x- and yResolution is long while "FileDirectory.setXResolution" translates it to List (in "createSingleLongList") and then "TiffWriter.writeValues" tries to cast them to long again ( "case LONG: writer.writeUnsignedInt( (Long)value )" )