Dmitry Timoshkov : windowscodecs: Reimplement TiffDecoder_GetFrameCount using TIFFNumberOfDirectories.

Alexandre Julliard julliard at winehq.org
Wed Jun 13 16:08:34 CDT 2012


Module: wine
Branch: master
Commit: 4f16c2f791afc902438322d1eae208bc5d4deefb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4f16c2f791afc902438322d1eae208bc5d4deefb

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Tue Jun 12 15:22:27 2012 +0900

windowscodecs: Reimplement TiffDecoder_GetFrameCount using TIFFNumberOfDirectories.

---

 dlls/windowscodecs/tiffformat.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c
index 1040fa6..66f65d1 100644
--- a/dlls/windowscodecs/tiffformat.c
+++ b/dlls/windowscodecs/tiffformat.c
@@ -58,7 +58,7 @@ static void *libtiff_handle;
 #define MAKE_FUNCPTR(f) static typeof(f) * p##f
 MAKE_FUNCPTR(TIFFClientOpen);
 MAKE_FUNCPTR(TIFFClose);
-MAKE_FUNCPTR(TIFFCurrentDirectory);
+MAKE_FUNCPTR(TIFFNumberOfDirectories);
 MAKE_FUNCPTR(TIFFGetField);
 MAKE_FUNCPTR(TIFFIsByteSwapped);
 MAKE_FUNCPTR(TIFFReadDirectory);
@@ -89,7 +89,7 @@ static void *load_libtiff(void)
     }
         LOAD_FUNCPTR(TIFFClientOpen);
         LOAD_FUNCPTR(TIFFClose);
-        LOAD_FUNCPTR(TIFFCurrentDirectory);
+        LOAD_FUNCPTR(TIFFNumberOfDirectories);
         LOAD_FUNCPTR(TIFFGetField);
         LOAD_FUNCPTR(TIFFIsByteSwapped);
         LOAD_FUNCPTR(TIFFReadDirectory);
@@ -662,8 +662,7 @@ static HRESULT WINAPI TiffDecoder_GetFrameCount(IWICBitmapDecoder *iface,
     }
 
     EnterCriticalSection(&This->lock);
-    while (pTIFFReadDirectory(This->tiff)) { }
-    *pCount = pTIFFCurrentDirectory(This->tiff)+1;
+    *pCount = pTIFFNumberOfDirectories(This->tiff);
     LeaveCriticalSection(&This->lock);
 
     TRACE("(%p) <-- %i\n", iface, *pCount);




More information about the wine-cvs mailing list