|Subject:||reading TIFF resolution does not work for pixel/cm|
I'm using PDF::API2 0.55 at the moment and want to read the TIFF resolution to paint the TIFF in its original size onto the PDF page. But I found out that the TIFF resolution is always interpreted as Pixel/Inch. The TIFF also has another TIFF-Tag to set the unit for resolutions. I have a TIFF with Pixel/cm set. The value read by PDF::API2 is then wrong. The attached test file 1x1cm.tif is generated with 400 pixel/inch which is 157 pixel/cm. Solution: Also read TIFF tag 296. If it has value 3, then the ResolutionUnit is Pixel/cm. After reading all TIFF Tags then correct the xRes and yRes values to have them as Pixel/Inch again.