2020.02.10 16:05 "[Tiff] How to make tiff rotation faster", by V. Krishna Karthik

2020.02.11 16:46 "Re: [Tiff] How to make tiff rotation faster", by Bob Friesenhahn

I received this private response from Richard Nolde, the author of tiffcrop. He tried to respond but perhaps his response is waiting for moderation:

"I don't have access to my main programming computer at the moment due to remodeling work, but I have a few comments even without looking at my code. It appears to me that tiffinfo indicates that the orientation tags and rows per strip values have been changed without necessarily transposing the data. If that is the case, it may be that Irfanview is simply reading the data a row at a time and writing it out with the new orientation. This would use minimal memory and avoid any paging as Bob has suggested. Tiffcrop originally read images by scan line but was changed to read by strips or tiles and requires two buffers equal to the size of the entire image which would certainly lead to a performance hit on systems with limited memory.  This was done to allow for reading images of arbitrary bit depths and planar configurations rather than only the most common types of tiff images. The memory allocated is determined by the number of strips or tiles and the size of each of those. There is no promotion to an intermediate memory structure of 4 bytes per pixel as the rotations are done with bit shifts for each byte accessed in the original image.

One thing to check would be how long it takes to load the image after it has been rotated by Irfanview and a second copy rotated by tiffcrop. This should be done using several different viewer programs, preferably after a reboot between the rotation and the viewing. If Irfanview is not really rotating the image, then it will likely take longer to present the image on the screen than it would for the version produced by tiffcrop. If the poster wishes to provide access to one of his images, I can check out this next week once I have my computer room in working order. The poster cold also provide the complete output of Tiffdump for both versions of the rotated file and the original.

Richard Nolde, tiffcrop author
"

--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt