+int getGifDisposalMethod(GifFileType * gft, int framenum)
+{
+ int i;
+ ExtensionBlock* ext = gft->SavedImages[0].ExtensionBlocks;
+
+ for (i=0; i < gft->SavedImages[framenum].ExtensionBlockCount; i++, ext++)
+ if (ext->Function == GRAPHICS_EXT_FUNC_CODE)
+ return ((ext->Bytes[0] & 0x1C) >> 2);
+
+ return -1;
+}
+
+U16 getGifLoopCount(GifFileType * gft) {
+ int i;
+ char sig[11];
+ ExtensionBlock* ext = gft->SavedImages[0].ExtensionBlocks;
+
+ // info: http://members.aol.com/royalef/gifabout.htm#net-extension
+ for (i=0; i < gft->SavedImages[0].ExtensionBlockCount; i++, ext++)
+ if (ext->Function == APPLICATION_EXT_FUNC_CODE) {
+// fprintf(stderr, "extension size: %d\n", ext->ByteCount);
+ memcpy(sig, &ext->Bytes[0], 11);
+// if(memcmp(sig, "NETSCAPE2.0", 11) == 0)
+// fprintf(stderr, "NETSCAPE2.0\n");
+// fprintf(stderr, "data: %d %d\n", ext->Bytes[13], ext->Bytes[14]);
+ }
+
+ return 0;
+}
+
+U16 getGifDelayTime(GifFileType * gft, int framenum)
+{
+ int i;
+ ExtensionBlock* ext = gft->SavedImages[framenum].ExtensionBlocks;
+
+ for (i=0; i < gft->SavedImages[framenum].ExtensionBlockCount; i++, ext++)
+ if (ext->Function == GRAPHICS_EXT_FUNC_CODE)
+ return GET16(&ext->Bytes[1]);
+
+ return 0;
+}
+
+int getTransparentColor(GifFileType * gft, int framenum)