TiffFile resolution not correct

TiffFile resolution not correct

Forum member · Aug 5, 2009
When creating PDF files from some TIFF files, the resolution of the TIFF images is not being read correctly. This is affecting some, but not all TIFF images processed by the code below: TiffFile tiff = new TiffFile(file); foreach (TiffImageData x in tiff.Images) { Console.WriteLine("{0} by {1} pixels at {2} by {3} dpi: {4} by {5} in., ScaleX: {6}, ScaleY: {7}", x.Width, x.Height, x.HorizontalDpi, x.VerticalDpi, x.Width / x.HorizontalDpi, x.Height / x.VerticalDpi, x.ScaleX, x.ScaleY); } pdfDocument.Pages.Append(tiff.GetDocument().Pages); The horizontal and vertical dpi values shown are both 72, but the actual image I have is a 200 dpi image making the final size of the image about 2.7x larger than it should be. I have examined the TIFF tags on the image and compared them to one that is working correctly. The only significant difference I see is the TIFF images that are incorrect do not have a ResolutionUnit tag. According to the TIFF specification this should default to Inch. I have also sent a sample TIFF to support.

Re: TiffFile resolution not correct

Support · Aug 17, 2009
Hello, The reason the DPI is getting set to 72 is because the tiff image you sent over has no absolute unit of measurement. When thats not specified in the image, our product sets the DPI to 72 which is the default. The only way to get the 200 dpi resolution is by setting the scale in the Image constructor which is equal to .36. Thanks, ceTe Software Support Team