Page 1 of 1

Single Page TIff - Rotate Oddness

Posted: Tue Mar 15, 2022 3:08 pm
by random1
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:

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.

Re: Single Page TIff - Rotate Oddness

Posted: Thu Mar 17, 2022 6:03 pm
by Hugo
Hi there,

Thank you for contacting us.

Please first of all try doing this in our latest version as this may already be fixed in V14.1.156:

If your issue persists, I would need to be able to replicate this on my end.
Could you provide me with a code project and the input file so I can run this "as is" and replicate your issue please?
If these are private you can contact us here:

Hugo Cudd
Technical Support

Re: Single Page TIff - Rotate Oddness

Posted: Mon Mar 21, 2022 5:57 pm
by random1
Thanks Hugo. Unfortunately sharing the code isn't really an option. However it can be replicated via:

Dim testDoc As Integer = objImaging.CreateGdPictureImageFromFile("C:\Test\onepage.tif")
Dim testDocPageCount As Integer = objImaging.TiffGetPageCount(testDoc) 'Result is 0
Dim testDocCurrPage As Integer = objImaging.TiffGetCurrentPage(testDoc) 'Result is 0
Dim blnMulti As Boolean = objImaging.TiffIsMultiPage(testDoc) 'Result is false

I've had to add a multi check before rotating.

Re: Single Page TIff - Rotate Oddness

Posted: Thu May 12, 2022 12:20 pm
by Hugo
Hi there,

My apologies for the delay.

Have you perhaps contacted us in the link above? Have we solved your issue since or does it persist?
You mention sharing the code isn't an option. Would you be able to provide the input document at least in this case?

Hugo Cudd
Technical Support