ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder
ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 IETIFFHandler.GetPagesCount return 0 in 64 bits
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jfernandez

Spain
6 Posts

Posted - Nov 08 2019 :  06:15:40  Show Profile  Reply
Hi, i'm having some problems with the 64 bits version.
The next code return zero pages at load a TIFF document


 Private Function pGetPagesCount(ByRef Image As MemoryStream, Format As IEFileFormats) As Integer
        Dim Pages As Integer
        Dim IEM As IEImageList = Nothing
        Dim IETifH As IETIFFHandler = Nothing  
        Try
            Select Case Format
                Case IEFileFormats.TIFF
                    IETifH = New IETIFFHandler
                    IETifH.Read(Image)
                    Pages = IETifH.GetPagesCount
                    IETifH.FreeData()
                Case IEFileFormats.GIF
                    IEM = New IEImageList
                    IEM.LoadImages(Image, Format)
                    Pages = IEM.ImageCount
                    IEM.Clear()
                Case Else
                    Pages = 1
            End Select
        Catch ex As Exception
            Throw New Exception("GetPagesCount: " & ex.Message)
        Finally
            If IEM IsNot Nothing Then
                IEM.Dispose()
                IEM = Nothing
            End If
            If IETifH IsNot Nothing Then IETifH = Nothing
        End Try
        Image.Seek(0, SeekOrigin.Begin)
        Return Pages

    End Function


Can you help me?

Thanks in advance

xequte

4852 Posts

Posted - Nov 08 2019 :  21:17:21  Show Profile  Reply
Hi

This works fine when I test it in 8.7.5, 32 and 64bit.

procedure Tfmain.BtnTestClick(Sender: TObject);
var
  IETifH : TIETIFFHandler;
begin
  IETifH := TIETIFFHandler.Create;
  IETifH.ReadFile( 'D:\Testing_Multimedia\TIFF\multipage-DP1076975.tif' );
  ShowMessage( IntToStr( IETifH.GetPagesCount ));
  IETifH.Free;
end;


Please email me the TIFF file.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: