[TexturePacker][gif] The Graphic Control Extension is optional.
authorMartijn Kaijser <mcm.kaijser@gmail.com>
Tue, 2 Feb 2016 17:25:51 +0000 (18:25 +0100)
committerMartijn Kaijser <mcm.kaijser@gmail.com>
Tue, 2 Feb 2016 17:25:51 +0000 (18:25 +0100)
project/BuildDependencies/scripts/0_package.list
tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp

index 4ce1934..fbb76ab 100644 (file)
@@ -49,5 +49,5 @@ python-2.7.8-win32.7z
 sqlite-3.8.6-win32-vc120.7z
 swig-2.0.7-win32-1.7z
 taglib-1.9.1-patched-win32-vc120.7z
-texturepacker-1.0.5-win32.7z
+texturepacker-1.0.6-win32.7z
 tinyxml-2.6.2_3-win32-vc120.7z
index d629844..500d117 100644 (file)
@@ -263,28 +263,19 @@ bool GifHelper::GcbToFrame(GifFrame &frame, unsigned int imgIdx)
   {
 #if GIFLIB_MAJOR == 5
     GraphicsControlBlock gcb;
-    if (!DGifSavedExtensionToGCB(m_gif, imgIdx, &gcb))
+    if (DGifSavedExtensionToGCB(m_gif, imgIdx, &gcb))
     {
-      fprintf(stderr, "Gif::GcbToFrame(): Could not read GraphicsControlBlock of frame %d in file %s\n",
-        imgIdx, m_filename.c_str()), GifErrorString(m_gif->Error);
-      return false;
+      // delay in ms
+      frame.m_delay = gcb.DelayTime * 10;
+      frame.m_disposal = gcb.DisposalMode;
+      transparent = gcb.TransparentColor;
     }
-    // delay in ms
-    frame.m_delay = gcb.DelayTime * 10;
-    frame.m_disposal = gcb.DisposalMode;
-    transparent = gcb.TransparentColor;
 #else
     ExtensionBlock* extb = m_gif->SavedImages[imgIdx].ExtensionBlocks;
     while (extb && extb->Function != GRAPHICS_EXT_FUNC_CODE)
       extb++;
 
-    if (!extb || extb->ByteCount != 4)
-    {
-      fprintf(stderr, "Gif::GcbToFrame() : Could not read GraphicsControlBlock of frame %d in file %s\n",
-        imgIdx, m_filename.c_str());
-      return false;
-    }
-    else
+    if (extb && extb->ByteCount == 4)
     {
       uint8_t low = static_cast<uint8_t>(extb->Bytes[1]);
       uint8_t high = static_cast<uint8_t>(extb->Bytes[2]);
@@ -297,7 +288,6 @@ bool GifHelper::GcbToFrame(GifFrame &frame, unsigned int imgIdx)
       else
         transparent = -1;
     }
-
 #endif
   }