Single Page TIff - Rotate Oddness

Discussions about image processing and document imaging.
Post Reply
random1
Posts: 9
Joined: Wed Jul 07, 2021 3:55 pm

Single Page TIff - Rotate Oddness

Post by random1 » 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.

Hugo
Posts: 174
Joined: Tue Dec 18, 2018 10:09 am

Re: Single Page TIff - Rotate Oddness

Post by Hugo » Thu Mar 17, 2022 6:03 pm

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:
https://www.gdpicture.com/download-gdpicture/


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:
https://orpalis.zendesk.com/hc/en-us/requests/new

Regards,
Hugo Cudd
Technical Support

random1
Posts: 9
Joined: Wed Jul 07, 2021 3:55 pm

Re: Single Page TIff - Rotate Oddness

Post by random1 » Mon Mar 21, 2022 5:57 pm

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.

Hugo
Posts: 174
Joined: Tue Dec 18, 2018 10:09 am

Re: Single Page TIff - Rotate Oddness

Post by Hugo » Thu May 12, 2022 12:20 pm

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?

Regards,
Hugo Cudd
Technical Support

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest