Index: src/lib/canvas/evas_object_image.c
===================================================================
--- src/lib/canvas/evas_object_image.c	(revision 61089)
+++ src/lib/canvas/evas_object_image.c	(working copy)
@@ -1864,7 +1864,144 @@ evas_object_image_content_hint_get(const Evas_Obje
    return o->content_hint;
 }
 
+// animated feature
+EAPI Eina_Bool
+evas_object_image_animated_get(const Evas_Object *obj)
+{
+   Evas_Object_Image *o;
+
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return EINA_FALSE;
+   MAGIC_CHECK_END();
+   o = (Evas_Object_Image *)(obj->object_data);
+   MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
+   return EINA_FALSE;
+   MAGIC_CHECK_END();
+
+   if (obj->layer->evas->engine.func->image_animated_get)
+     return obj->layer->evas->engine.func->image_animated_get(obj->layer->evas->engine.data.output, o->engine_data);
+   return EINA_FALSE;
+}
+
+EAPI int
+evas_object_image_animated_frame_count_get(const Evas_Object *obj)
+{
+   Evas_Object_Image *o;
+
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return -1;
+   MAGIC_CHECK_END();
+   o = (Evas_Object_Image *)(obj->object_data);
+   MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
+   return -1;
+   MAGIC_CHECK_END();
+
+   if (!evas_object_image_animated_get(obj)) return -1;
+   if (obj->layer->evas->engine.func->image_animated_frame_count_get)
+     return obj->layer->evas->engine.func->image_animated_frame_count_get(obj->layer->evas->engine.data.output, o->engine_data);
+   return -1;
+}
+
+EAPI Evas_Image_Animated_Loop_Hint
+evas_object_image_animated_loop_type_get(const Evas_Object *obj)
+{
+   Evas_Object_Image *o;
+
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return EVAS_IMAGE_ANIMATED_HINT_NONE;
+   MAGIC_CHECK_END();
+   o = (Evas_Object_Image *)(obj->object_data);
+   MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
+   return EVAS_IMAGE_ANIMATED_HINT_NONE;
+   MAGIC_CHECK_END();
+
+   if (!evas_object_image_animated_get(obj)) return EVAS_IMAGE_ANIMATED_HINT_NONE;
+
+   if (obj->layer->evas->engine.func->image_animated_loop_type_get)
+     return obj->layer->evas->engine.func->image_animated_loop_type_get(obj->layer->evas->engine.data.output, o->engine_data);
+   return EVAS_IMAGE_ANIMATED_HINT_NONE;
+}
+
+EAPI int
+evas_object_image_animated_loop_count_get(const Evas_Object *obj)
+{
+   Evas_Object_Image *o;
+
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return -1;
+   MAGIC_CHECK_END();
+   o = (Evas_Object_Image *)(obj->object_data);
+   MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
+   return -1;
+   MAGIC_CHECK_END();
+   
+   if (!evas_object_image_animated_get(obj)) return -1;
+
+   if (obj->layer->evas->engine.func->image_animated_loop_count_get)
+     return obj->layer->evas->engine.func->image_animated_loop_count_get(obj->layer->evas->engine.data.output, o->engine_data);
+   return -1;
+}
+
+EAPI double
+evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int frame_num)
+{
+   Evas_Object_Image *o;
+   int frame_count = 0;
+
+   if (start_frame < 1) return -1;
+   if (frame_num < 0) return -1;
+
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return -1;
+   MAGIC_CHECK_END();
+   o = (Evas_Object_Image *)(obj->object_data);
+   MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
+   return -1;
+   MAGIC_CHECK_END();
+
+   if (!evas_object_image_animated_get(obj)) return -1;
+
+   if (!obj->layer->evas->engine.func->image_animated_frame_count_get) return -1;
+
+   frame_count = obj->layer->evas->engine.func->image_animated_frame_count_get(obj->layer->evas->engine.data.output, o->engine_data);
+
+   if ((start_frame + frame_num) > frame_count) return -1;
+   if (obj->layer->evas->engine.func->image_animated_frame_duration_get)
+     return obj->layer->evas->engine.func->image_animated_frame_duration_get(obj->layer->evas->engine.data.output, o->engine_data, start_frame, frame_num);
+   return -1;
+}
+
 EAPI void
+evas_object_image_animated_frame_set(Evas_Object *obj, int frame_index)
+{
+   Evas_Object_Image *o;
+   int frame_count = 0;
+   Eina_Bool animated = EINA_FALSE;
+   char frame_index_char[4];
+
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return;
+   MAGIC_CHECK_END();
+   o = (Evas_Object_Image *)(obj->object_data);
+   MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
+   return;
+   MAGIC_CHECK_END();
+   
+   if (!evas_object_image_animated_get(obj)) return;
+
+   if (!o->cur.file) return;
+   //We maybe need to modify this code after making new cache system for animated image.
+
+   frame_count = evas_object_image_animated_frame_count_get(obj);
+
+   //We limit the size of max index to 9999
+   if ((frame_count > 10000-1) || (frame_count < 0) || (frame_index >  frame_count))
+     return;
+   snprintf(frame_index_char, 4, "%i",frame_index);
+   evas_object_image_file_set(obj, o->cur.file, frame_index_char);
+}
+
+EAPI void
 evas_image_cache_flush(Evas *e)
 {
    MAGIC_CHECK(e, Evas, MAGIC_EVAS);
Index: src/lib/engines/common/evas_image_load.c
===================================================================
--- src/lib/engines/common/evas_image_load.c	(revision 61089)
+++ src/lib/engines/common/evas_image_load.c	(working copy)
@@ -331,8 +331,6 @@ evas_common_load_rgba_image_data_from_file(Image_E
 
    if (!ie->info.module) return EVAS_LOAD_ERROR_GENERIC;
 
-//   printf("load data [%p] %s %s\n", ie, ie->file, ie->key);
-           
    evas_image_load_func = ie->info.loader;
    evas_module_use((Evas_Module*) ie->info.module);
    if (!evas_image_load_func->file_data(ie, ie->file, ie->key, &ret))
@@ -346,6 +344,20 @@ evas_common_load_rgba_image_data_from_file(Image_E
    return EVAS_LOAD_ERROR_NONE;
 }
 
+EAPI double
+evas_common_get_rgba_image_frame_duration_from_file(Image_Entry *ie, const int start, const int frame_num)
+{
+   Evas_Image_Load_Func *evas_image_load_func = NULL;
+
+   if (!ie->info.module) return -1;
+
+   evas_image_load_func = ie->info.loader;
+   evas_module_use((Evas_Module*) ie->info.module);
+   if (evas_image_load_func->get_frame_duration)
+     return evas_image_load_func->get_frame_duration(ie, ie->file, start, frame_num);
+   return -1;
+}
+
 EAPI Eina_Bool
 evas_common_extension_can_load_get(const char *file)
 {
Index: src/lib/engines/common/evas_image.h
===================================================================
--- src/lib/engines/common/evas_image.h	(revision 61089)
+++ src/lib/engines/common/evas_image.h	(working copy)
@@ -54,6 +54,7 @@ EAPI void
 
 EAPI int evas_common_load_rgba_image_module_from_file (Image_Entry *im);
 EAPI int evas_common_load_rgba_image_data_from_file   (Image_Entry *im);
+EAPI double evas_common_get_rgba_image_frame_duration_from_file(Image_Entry *im, int start_frame, int frame_num);
 
 void _evas_common_rgba_image_post_surface(Image_Entry *ie);
 
Index: src/lib/include/evas_common.h
===================================================================
--- src/lib/include/evas_common.h	(revision 61089)
+++ src/lib/include/evas_common.h	(working copy)
@@ -511,6 +511,7 @@ struct _Image_Entry_Flags
    Eina_Bool delete_me    : 1;
    Eina_Bool pending      : 1;
 #endif
+   Eina_Bool animated     :1;
 };
 
 struct _Evas_Cache_Target
@@ -593,6 +594,9 @@ struct _Image_Entry
    int                    connect_num;
    int                    channel;
    int                    load_error;
+   int                    frame_count;
+   Evas_Image_Animated_Loop_Hint loop_hint;
+   int                    loop_count;
 };
 
 struct _Engine_Image_Entry
Index: src/lib/include/evas_private.h
===================================================================
--- src/lib/include/evas_private.h	(revision 61089)
+++ src/lib/include/evas_private.h	(working copy)
@@ -751,6 +751,13 @@ struct _Evas_Func
    void *(*gl_api_get)                   (void *data);
    int  (*image_load_error_get)          (void *data, void *image);
    int  (*font_run_end_get)              (void *data, Evas_Font_Set *font, Evas_Font_Instance **script_fi, Evas_Font_Instance **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len);
+
+  /* animated feature */
+   Eina_Bool (*image_animated_get)       (void *data, void *image);
+   int (*image_animated_frame_count_get) (void *data, void *image);
+   Evas_Image_Animated_Loop_Hint  (*image_animated_loop_type_get) (void *data, void *image);
+   int (*image_animated_loop_count_get) (void *data, void *image);
+   double (*image_animated_frame_duration_get) (void *data, void *image, int start_frame, int frame_num);
 };
 
 struct _Evas_Image_Load_Func
@@ -758,6 +765,7 @@ struct _Evas_Image_Load_Func
   Eina_Bool threadable;
   Eina_Bool (*file_head) (Image_Entry *ie, const char *file, const char *key, int *error);
   Eina_Bool (*file_data) (Image_Entry *ie, const char *file, const char *key, int *error);
+  double (*get_frame_duration) (Image_Entry *ie, const char *file, const int start, const int frame_num);
 };
 
 struct _Evas_Image_Save_Func
Index: src/lib/Evas.h
===================================================================
--- src/lib/Evas.h	(revision 61089)
+++ src/lib/Evas.h	(working copy)
@@ -700,6 +700,13 @@ typedef enum _Evas_Image_Scale_Hint
    EVAS_IMAGE_SCALE_HINT_STATIC = 2
 } Evas_Image_Scale_Hint;
 
+typedef enum _Evas_Image_Animated_Loop_Hint
+{
+   EVAS_IMAGE_ANIMATED_HINT_NONE = 0,
+   EVAS_IMAGE_ANIMATED_HINT_SEQUENTIAL = 1,
+   EVAS_IMAGE_ANIMATED_HINT_REVERSE = 2
+} Evas_Image_Animated_Loop_Hint;
+
 typedef enum _Evas_Engine_Render_Mode
 {
    EVAS_RENDER_MODE_BLOCKING = 0,
@@ -6361,6 +6368,13 @@ EAPI Eina_Bool evas_object_image_extension_can_loa
 /**
  * @}
  */
+// animated feature
+EAPI Eina_Bool evas_object_image_animated_get(const Evas_Object *obj);
+EAPI int evas_object_image_animated_frame_num_get(const Evas_Object *obj);
+EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(const Evas_Object *obj);
+EAPI int evas_object_image_animated_loop_count_get(const Evas_Object *obj);
+EAPI double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num); //return time duration
+EAPI void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num);
 
 /**
  * @defgroup Evas_Object_Text Text Object Functions
Index: src/modules/engines/software_generic/evas_engine.c
===================================================================
--- src/modules/engines/software_generic/evas_engine.c	(revision 61089)
+++ src/modules/engines/software_generic/evas_engine.c	(working copy)
@@ -651,6 +651,60 @@ eng_image_scale_hint_get(void *data __UNUSED__, vo
    return im->scale_hint;
 }
 
+static Eina_Bool
+eng_image_animated_get  (void *data __UNUSED__, void *image)
+{
+   Image_Entry *im;
+
+   if (!image) return EINA_FALSE;
+   im = image;
+   return im->flags.animated;
+}
+
+static int
+eng_image_animated_frame_count_get (void *data __UNUSED__, void *image)
+{
+   Image_Entry *im;
+
+   if (!image) return -1;
+   im = image;
+   if (!im->flags.animated) return -1;
+   return im->frame_count;
+}
+
+static Evas_Image_Animated_Loop_Hint
+eng_image_animated_loop_type_get (void *data __UNUSED__, void *image)
+{
+   Image_Entry *im;
+
+   if (!image) return EVAS_IMAGE_ANIMATED_HINT_NONE;
+   im = image;
+   if (!im->flags.animated) return EVAS_IMAGE_ANIMATED_HINT_NONE;
+   return im->loop_hint;
+}
+
+static int
+eng_image_animated_loop_count_get (void *data __UNUSED__, void *image)
+{
+   Image_Entry *im;
+
+   if (!image) return -1;
+   im = image;
+   if (!im->flags.animated) return -1;
+   return im->loop_count;
+}
+
+static double
+eng_image_animated_frame_duration_get (void *data __UNUSED__, void *image, int start_frame, int frame_num)
+{
+   Image_Entry *im;
+
+   if (!image) return -1;
+   im = image;
+   if (!im->flags.animated) return -1;
+   return evas_common_get_rgba_image_frame_duration_from_file(im, start_frame, frame_num);
+}
+
 static void
 eng_image_cache_flush(void *data __UNUSED__)
 {
@@ -1097,7 +1151,12 @@ static Evas_Func func =
      NULL, // FIXME: need software mesa for gl rendering <- gl_native_surface_get
      NULL, // FIXME: need software mesa for gl rendering <- gl_api_get
      eng_image_load_error_get,
-     eng_font_run_font_end_get
+     eng_font_run_font_end_get,
+     eng_image_animated_get,
+     eng_image_animated_frame_count_get,
+     eng_image_animated_loop_type_get,
+     eng_image_animated_loop_count_get,
+     eng_image_animated_frame_duration_get
    /* FUTURE software generic calls go here */
 };
 
Index: src/modules/loaders/bmp/evas_image_load_bmp.c
===================================================================
--- src/modules/loaders/bmp/evas_image_load_bmp.c	(revision 61089)
+++ src/modules/loaders/bmp/evas_image_load_bmp.c	(working copy)
@@ -18,7 +18,8 @@ static Evas_Image_Load_Func evas_image_load_bmp_fu
 {
   EINA_TRUE,
   evas_image_load_file_head_bmp,
-  evas_image_load_file_data_bmp
+  evas_image_load_file_data_bmp,
+  NULL
 };
 
 static int
Index: src/modules/loaders/edb/evas_image_load_edb.c
===================================================================
--- src/modules/loaders/edb/evas_image_load_edb.c	(revision 61089)
+++ src/modules/loaders/edb/evas_image_load_edb.c	(working copy)
@@ -15,7 +15,8 @@ static Evas_Image_Load_Func evas_image_load_edb_fu
 {
   EINA_TRUE,
   evas_image_load_file_head_edb,
-  evas_image_load_file_data_edb
+  evas_image_load_file_data_edb,
+  NULL
 };
 
 static Eina_Bool
Index: src/modules/loaders/gif/evas_image_load_gif.c
===================================================================
--- src/modules/loaders/gif/evas_image_load_gif.c	(revision 61089)
+++ src/modules/loaders/gif/evas_image_load_gif.c	(working copy)
@@ -10,14 +10,18 @@
 
 static Eina_Bool evas_image_load_file_head_gif(Image_Entry *ie, const char *file, const char *key, int *error) EINA_ARG_NONNULL(1, 2, 4);
 static Eina_Bool evas_image_load_file_data_gif(Image_Entry *ie, const char *file, const char *key, int *error) EINA_ARG_NONNULL(1, 2, 4);
+static double evas_image_get_frame_duration_gif(Image_Entry *ie, const char *file, int start_frame, int frame_num);
 
 static Evas_Image_Load_Func evas_image_load_gif_func =
 {
   EINA_TRUE,
   evas_image_load_file_head_gif,
-  evas_image_load_file_data_gif
+  evas_image_load_file_data_gif,
+  evas_image_get_frame_duration_gif
 };
+#define byte_to_uint(a,b)         (((b)<<8)|(a))
 
+#define FRAME_MAX 1024
 static Eina_Bool
 evas_image_load_file_head_gif(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error)
 {
@@ -29,6 +33,11 @@ evas_image_load_file_head_gif(Image_Entry *ie, con
    int                 h;
    int                 alpha;
 
+   // for animated image
+   int      frame_count = 0;
+   int loop_count = -1;
+   Evas_Image_Animated_Loop_Hint loop_hint = EVAS_IMAGE_ANIMATED_HINT_NONE;
+
    done = 0;
    w = 0;
    h = 0;
@@ -41,16 +50,16 @@ evas_image_load_file_head_gif(Image_Entry *ie, con
 #endif
    if (fd < 0)
      {
-	*error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
-	return EINA_FALSE;
+        *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
+        return EINA_FALSE;
      }
 
    gif = DGifOpenFileHandle(fd);
    if (!gif)
      {
         close(fd);
-	*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
-	return EINA_FALSE;
+        *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+        return EINA_FALSE;
      }
 
    do
@@ -60,26 +69,40 @@ evas_image_load_file_head_gif(Image_Entry *ie, con
              /* PrintGifError(); */
              rec = TERMINATE_RECORD_TYPE;
           }
-        if ((rec == IMAGE_DESC_RECORD_TYPE) && (!done))
+        if (rec == IMAGE_DESC_RECORD_TYPE)
           {
+             int img_code;
+             GifByteType *img;
+
              if (DGifGetImageDesc(gif) == GIF_ERROR)
                {
                   /* PrintGifError(); */
                   rec = TERMINATE_RECORD_TYPE;
                }
+             frame_count++;
              w = gif->Image.Width;
              h = gif->Image.Height;
-	     if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) ||
+             if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) ||
                  IMG_TOO_BIG(w, h))
-	       {
-		  DGifCloseFile(gif);
-		  if (IMG_TOO_BIG(w, h))
-		    *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
-		  else
-		    *error = EVAS_LOAD_ERROR_GENERIC;
-		  return EINA_FALSE;
-	       }
-	     done = 1;
+               {
+                  DGifCloseFile(gif);
+                  if (IMG_TOO_BIG(w, h))
+                    *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+                  else
+                    *error = EVAS_LOAD_ERROR_GENERIC;
+                  return EINA_FALSE;
+               }
+             /* we have to count frame, so use DGifGetCode and skip decoding */
+             if (DGifGetCode(gif, &img_code, &img) == GIF_ERROR)
+               {
+                  /* PrintGifError(); */
+                  rec = TERMINATE_RECORD_TYPE;
+               }
+             while (img)
+               {
+                  img = NULL;
+                  DGifGetExtensionNext(gif, &img);
+               }
           }
         else if (rec == EXTENSION_RECORD_TYPE)
           {
@@ -90,10 +113,26 @@ evas_image_load_file_head_gif(Image_Entry *ie, con
              DGifGetExtension(gif, &ext_code, &ext);
              while (ext)
                {
-                  if ((ext_code == 0xf9) && (ext[1] & 1) && (alpha < 0))
+                  if(ext_code == 0xf9) /* Graphic Control Extension */
                     {
-                       alpha = (int)ext[4];
+                       if ((ext[1] & 1) && (alpha < 0)) alpha = (int)ext[4];
+                         //frame_time[frame_num] = byte_to_uint (ext[2], ext[3]); //get each frame time 
                     }
+                  else if(ext_code == 0xff)/* application extension */
+                    {
+                       if (!strncmp ((char*)(&ext[1]), "NETSCAPE2.0", 11) || !strncmp ((char*)(&ext[1]), "ANIMEXTS1.0", 11))
+                         {
+                            ext=NULL;
+                            DGifGetExtensionNext(gif, &ext);
+
+                            if (ext[1] == 0x01)
+                            {
+                               loop_count = ext[2] + (ext[3] << 8);
+                               if (loop_count > 0) loop_count++;
+                            }
+                         }
+                    }
+
                   ext = NULL;
                   DGifGetExtensionNext(gif, &ext);
                }
@@ -104,6 +143,15 @@ evas_image_load_file_head_gif(Image_Entry *ie, con
    ie->w = w;
    ie->h = h;
 
+   if (frame_count > 1)
+     {
+        ie->flags.animated = 1;
+        ie->loop_count = loop_count;
+        ie->loop_hint = EVAS_IMAGE_ANIMATED_HINT_SEQUENTIAL;
+        ie->frame_count = frame_count;
+     }
+
+
    DGifCloseFile(gif);
    *error = EVAS_LOAD_ERROR_NONE;
    return EINA_TRUE;
@@ -134,6 +182,8 @@ evas_image_load_file_data_gif(Image_Entry *ie, con
    int                 r;
    int                 g;
    int                 b;
+   int                 current_frame;
+   int                 final_frame;
 
    rows = NULL;
    per = 0.0;
@@ -143,7 +193,23 @@ evas_image_load_file_data_gif(Image_Entry *ie, con
    w = 0;
    h = 0;
    alpha = -1;
+   current_frame = 0;
+   final_frame = 0;
+   if (key)
+     {
+        final_frame = atoi(key);
+        if (final_frame == 0)
+          final_frame = 1;
+     }
+   else
+     final_frame = 1; //if there is no key , 1 is default frame number
 
+   if ((final_frame <1) || (final_frame > FRAME_MAX))
+     {
+        *error = EVAS_LOAD_ERROR_GENERIC;
+        return EINA_FALSE;
+     }
+
 #ifndef __EMX__
    fd = open(file, O_RDONLY);
 #else
@@ -151,16 +217,16 @@ evas_image_load_file_data_gif(Image_Entry *ie, con
 #endif
    if (fd < 0)
      {
-	*error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
-	return EINA_FALSE;
+        *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST;
+        return EINA_FALSE;
      }
 
    gif = DGifOpenFileHandle(fd);
    if (!gif)
      {
         close(fd);
-	*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
-	return EINA_FALSE;
+        *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+        return EINA_FALSE;
      }
    do
      {
@@ -171,59 +237,79 @@ evas_image_load_file_data_gif(Image_Entry *ie, con
           }
         if ((rec == IMAGE_DESC_RECORD_TYPE) && (!done))
           {
+             int img_code;
+             GifByteType *img;
              if (DGifGetImageDesc(gif) == GIF_ERROR)
                {
                   /* PrintGifError(); */
                   rec = TERMINATE_RECORD_TYPE;
                }
+
+             current_frame++;
              w = gif->Image.Width;
              h = gif->Image.Height;
-             rows = malloc(h * sizeof(GifRowType *));
-             if (!rows)
+
+             if (current_frame == final_frame)
                {
-                  DGifCloseFile(gif);
-                  return 0;
-               }
-             for (i = 0; i < h; i++)
-               {
-                  rows[i] = NULL;
-               }
-             for (i = 0; i < h; i++)
-               {
-                  rows[i] = malloc(w * sizeof(GifPixelType));
-                  if (!rows[i])
+                  rows = malloc(h * sizeof(GifRowType *));
+                  if (!rows)
                     {
                        DGifCloseFile(gif);
-                       for (i = 0; i < h; i++)
+                       return 0;
+                    }
+                  for (i = 0; i < h; i++)
+                    {
+                       rows[i] = NULL;
+                    }
+                  for (i = 0; i < h; i++)
+                    {
+                       rows[i] = malloc(w * sizeof(GifPixelType));
+                       if (!rows[i])
                          {
-                            if (rows[i])
+                            DGifCloseFile(gif);
+                            for (i = 0; i < h; i++)
                               {
-                                 free(rows[i]);
+                                 if (rows[i])
+                                   {
+                                      free(rows[i]);
+                                   }
                               }
-                         }
-                       free(rows);
-		       *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
-		       return EINA_FALSE;
-                    }
+                            free(rows);
+                            *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+                            return EINA_FALSE;
+                          }
+                      }
+                    if (gif->Image.Interlace)
+                      {
+                         for (i = 0; i < 4; i++)
+                           {
+                              for (j = intoffset[i]; j < h; j += intjump[i])
+                                {
+                                   DGifGetLine(gif, rows[j], w);
+                                }
+                           }
+                      }
+                    else
+                      {
+                         for (i = 0; i < h; i++)
+                           {
+                              DGifGetLine(gif, rows[i], w);
+                           }
+                      }
+                    done = 1;
                }
-             if (gif->Image.Interlace)
+             else
                {
-                  for (i = 0; i < 4; i++)
+                  if(DGifGetCode(gif, &img_code, &img) == GIF_ERROR)
                     {
-                       for (j = intoffset[i]; j < h; j += intjump[i])
-                         {
-                            DGifGetLine(gif, rows[j], w);
-                         }
+                       rec = TERMINATE_RECORD_TYPE;
                     }
-               }
-             else
-               {
-                  for (i = 0; i < h; i++)
+                  while (img)
                     {
-                       DGifGetLine(gif, rows[i], w);
+                       img = NULL;
+                       DGifGetExtensionNext(gif, &img);
                     }
-               }
-             done = 1;
+                }
           }
         else if (rec == EXTENSION_RECORD_TYPE)
           {
@@ -254,8 +340,8 @@ evas_image_load_file_data_gif(Image_Entry *ie, con
             free(rows[i]);
           }
         free(rows);
-	*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
-	return EINA_FALSE;
+        *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+        return EINA_FALSE;
      }
 
    bg = gif->SBackGroundColor;
@@ -308,6 +394,103 @@ evas_image_load_file_data_gif(Image_Entry *ie, con
    return EINA_TRUE;
 }
 
+static double
+evas_image_get_frame_duration_gif(Image_Entry *ie, const char *file, const int start_frame, const int frame_num)
+{
+   int                 fd;
+   GifFileType        *gif;
+   GifRecordType       rec;
+   int                 done;
+
+   // for animated image
+   int      current_frame = 1;
+   int     remain_frames = frame_num;
+   double duration = 0;
+   int     frame_count = 0;
+
+   frame_count = ie->frame_count;
+
+   if (!ie->flags.animated) return -1;
+   if ((start_frame + frame_num) > frame_count) return -1;
+   if (frame_num < 0) return -1;
+
+   done = 0;
+
+#ifndef __EMX__
+   fd = open(file, O_RDONLY);
+#else
+   fd = open(file, O_RDONLY | O_BINARY);
+#endif
+   if (fd < 0)
+     {
+        return -1;
+     }
+
+   gif = DGifOpenFileHandle(fd);
+   if (!gif)
+     {
+        close(fd);
+        return -1;
+     }
+
+   do
+     {
+        if (DGifGetRecordType(gif, &rec) == GIF_ERROR)
+          {
+             rec = TERMINATE_RECORD_TYPE;
+          }
+        if (rec == IMAGE_DESC_RECORD_TYPE)
+          {
+             int img_code;
+             GifByteType *img;
+
+             if (DGifGetImageDesc(gif) == GIF_ERROR)
+               {
+                  /* PrintGifError(); */
+                  rec = TERMINATE_RECORD_TYPE;
+               }
+             current_frame++;
+             /* we have to count frame, so use DGifGetCode and skip decoding */
+             if (DGifGetCode(gif, &img_code, &img) == GIF_ERROR)
+               {
+                  /* PrintGifError(); */
+                  rec = TERMINATE_RECORD_TYPE;
+               }
+             while (img)
+               {
+                  img = NULL;
+                  DGifGetExtensionNext(gif, &img);
+               }
+          }
+        else if (rec == EXTENSION_RECORD_TYPE)
+          {
+             int                 ext_code;
+             GifByteType        *ext;
+
+             ext = NULL;
+             DGifGetExtension(gif, &ext_code, &ext);
+             while (ext)
+               {
+                  if(ext_code == 0xf9) /* Graphic Control Extension */
+                    {
+                       if ((current_frame  >= start_frame) && (current_frame <= frame_count))
+                         {
+                            int frame_duration = 0;
+                            if (remain_frames < 0) break;
+                            frame_duration = byte_to_uint (ext[2], ext[3]);
+                            duration += (double)frame_duration/100;
+                            remain_frames --;
+                         }
+                    }
+                  ext = NULL;
+                  DGifGetExtensionNext(gif, &ext);
+               }
+          }
+   } while (rec != TERMINATE_RECORD_TYPE);
+
+   DGifCloseFile(gif);
+   return duration;
+}
 static int
 module_open(Evas_Module *em)
 {
Index: src/modules/loaders/ico/evas_image_load_ico.c
===================================================================
--- src/modules/loaders/ico/evas_image_load_ico.c	(revision 61089)
+++ src/modules/loaders/ico/evas_image_load_ico.c	(working copy)
@@ -18,7 +18,8 @@ static Evas_Image_Load_Func evas_image_load_ico_fu
 {
   EINA_TRUE,
   evas_image_load_file_head_ico,
-  evas_image_load_file_data_ico
+  evas_image_load_file_data_ico,
+  NULL
 };
 
 static int
Index: src/modules/loaders/jpeg/evas_image_load_jpeg.c
===================================================================
--- src/modules/loaders/jpeg/evas_image_load_jpeg.c	(revision 61089)
+++ src/modules/loaders/jpeg/evas_image_load_jpeg.c	(working copy)
@@ -45,7 +45,8 @@ static Evas_Image_Load_Func evas_image_load_jpeg_f
 {
   EINA_TRUE,
   evas_image_load_file_head_jpeg,
-  evas_image_load_file_data_jpeg
+  evas_image_load_file_data_jpeg,
+  NULL
 };
 
 
Index: src/modules/loaders/pmaps/evas_image_load_pmaps.c
===================================================================
--- src/modules/loaders/pmaps/evas_image_load_pmaps.c	(revision 61089)
+++ src/modules/loaders/pmaps/evas_image_load_pmaps.c	(working copy)
@@ -18,7 +18,8 @@ static Eina_Bool evas_image_load_file_data_pmaps(I
 Evas_Image_Load_Func evas_image_load_pmaps_func = {
    EINA_TRUE,
    evas_image_load_file_head_pmaps,
-   evas_image_load_file_data_pmaps
+   evas_image_load_file_data_pmaps,
+NULL
 };
 
 /* The buffer to load pmaps images */
Index: src/modules/loaders/png/evas_image_load_png.c
===================================================================
--- src/modules/loaders/png/evas_image_load_png.c	(revision 61089)
+++ src/modules/loaders/png/evas_image_load_png.c	(working copy)
@@ -34,7 +34,8 @@ static Evas_Image_Load_Func evas_image_load_png_fu
 {
   EINA_TRUE,
   evas_image_load_file_head_png,
-  evas_image_load_file_data_png
+  evas_image_load_file_data_png,
+  NULL
 };
 
 static Eina_Bool
Index: src/modules/loaders/tga/evas_image_load_tga.c
===================================================================
--- src/modules/loaders/tga/evas_image_load_tga.c	(revision 61089)
+++ src/modules/loaders/tga/evas_image_load_tga.c	(working copy)
@@ -61,7 +61,8 @@ static Evas_Image_Load_Func evas_image_load_tga_fu
 {
   EINA_TRUE,
   evas_image_load_file_head_tga,
-  evas_image_load_file_data_tga
+  evas_image_load_file_data_tga,
+  NULL
 };
 
 static Eina_Bool
Index: src/modules/loaders/tiff/evas_image_load_tiff.c
===================================================================
--- src/modules/loaders/tiff/evas_image_load_tiff.c	(revision 61089)
+++ src/modules/loaders/tiff/evas_image_load_tiff.c	(working copy)
@@ -33,7 +33,8 @@ static Evas_Image_Load_Func evas_image_load_tiff_f
 {
   EINA_TRUE,
   evas_image_load_file_head_tiff,
-  evas_image_load_file_data_tiff
+  evas_image_load_file_data_tiff,
+  NULL
 };
 
 typedef struct TIFFRGBAImage_Extra TIFFRGBAImage_Extra;
Index: src/modules/loaders/wbmp/evas_image_load_wbmp.c
===================================================================
--- src/modules/loaders/wbmp/evas_image_load_wbmp.c	(revision 61089)
+++ src/modules/loaders/wbmp/evas_image_load_wbmp.c	(working copy)
@@ -18,7 +18,8 @@ static Evas_Image_Load_Func evas_image_load_wbmp_f
 {
    EINA_TRUE,
    evas_image_load_file_head_wbmp,
-   evas_image_load_file_data_wbmp
+   evas_image_load_file_data_wbmp,
+  NULL
 };
 
 
Index: src/modules/loaders/xpm/evas_image_load_xpm.c
===================================================================
--- src/modules/loaders/xpm/evas_image_load_xpm.c	(revision 61089)
+++ src/modules/loaders/xpm/evas_image_load_xpm.c	(working copy)
@@ -23,7 +23,8 @@ static Evas_Image_Load_Func evas_image_load_xpm_fu
 {
   EINA_FALSE,
   evas_image_load_file_head_xpm,
-  evas_image_load_file_data_xpm
+  evas_image_load_file_data_xpm,
+  NULL
 };
 
 // TODO: REWRITE THIS WITH THREAD SAFE VERSION NOT USING THIS HANDLE!!!!
