Single Page TIff - Rotate Oddness
Posted: Tue Mar 15, 2022 3:08 pm
Hi There.
I have a solution that loads TIFFs from ByteArrays from a DB.
I load the byte array into a image processor:
primaryDocument = objImaging.CreateGdPictureImageFromByteArray(objImageBytes
And then use the GD viewer to display:
gdViewer.DisplayFromGdPictureImage(primaryDocument)
All this works as expected. However, when I try to rotate a single page TIFF file the behavior is a little odd. My rotate code is pretty simple, select the page, then call the Rotate method
Dim rotateStatus As GdPictureStatus = objImaging.TiffSelectPage(primaryDocument, gdViewer.CurrentPage)
If rotateStatus = GdPictureStatus.OK Then
rotateStatus = objImaging.Rotate(primaryDocument, RotateFlipType.Rotate90FlipNone)
End If
The problem is that the TiffSelectPage returns an unsupported format.
If I put a debug statement in like so:
primaryDocument = objImaging.CreateGdPictureImageFromByteArray(objImageBytes)
Dim totalPages As Integer = objImaging.TiffGetPageCount(primaryDocument)
Dim currentPage As Integer = objImaging.TiffGetCurrentPage(primaryDocument)
I see an 18 page tiff has a page count of 18 and a current page of 1 as you would expect. A 1 page tiff has a page count of 0 and a currentPage of 0.
Does GD Picture handle one page TIFF differently ? Just wondering if I need to code for this ? I would expect a one page tiff to have a page count of 1 and a current page of 1.
I have a solution that loads TIFFs from ByteArrays from a DB.
I load the byte array into a image processor:
primaryDocument = objImaging.CreateGdPictureImageFromByteArray(objImageBytes
And then use the GD viewer to display:
gdViewer.DisplayFromGdPictureImage(primaryDocument)
All this works as expected. However, when I try to rotate a single page TIFF file the behavior is a little odd. My rotate code is pretty simple, select the page, then call the Rotate method
Dim rotateStatus As GdPictureStatus = objImaging.TiffSelectPage(primaryDocument, gdViewer.CurrentPage)
If rotateStatus = GdPictureStatus.OK Then
rotateStatus = objImaging.Rotate(primaryDocument, RotateFlipType.Rotate90FlipNone)
End If
The problem is that the TiffSelectPage returns an unsupported format.
If I put a debug statement in like so:
primaryDocument = objImaging.CreateGdPictureImageFromByteArray(objImageBytes)
Dim totalPages As Integer = objImaging.TiffGetPageCount(primaryDocument)
Dim currentPage As Integer = objImaging.TiffGetCurrentPage(primaryDocument)
I see an 18 page tiff has a page count of 18 and a current page of 1 as you would expect. A 1 page tiff has a page count of 0 and a currentPage of 0.
Does GD Picture handle one page TIFF differently ? Just wondering if I need to code for this ? I would expect a one page tiff to have a page count of 1 and a current page of 1.