From: Jiyoun Park <jy0703.park@samsung.com>
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 23 Aug 2011 06:08:02 +0000 (06:08 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 23 Aug 2011 06:08:02 +0000 (06:08 +0000)
Sometimes, gif loader can miss some previous frame.
In that case, display can be dirty.
If frame N loaded without N-1 make these problem.
I fixed this problem.
And I modified wrong document.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@62712 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/Evas.h
src/modules/loaders/gif/evas_image_load_gif.c

index b779408..d62e49e 100644 (file)
@@ -7205,7 +7205,7 @@ EAPI Eina_Bool evas_object_image_extension_can_load_fast_get(const char *file);
  * @endcode
  * 
  * @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get() 
+ * @see evas_object_image_animated_frame_count_get() 
  * @see evas_object_image_animated_loop_type_get()
  * @see evas_object_image_animated_loop_count_get()
  * @see evas_object_image_animated_frame_duration_get()
@@ -7223,7 +7223,7 @@ EAPI Eina_Bool evas_object_image_animated_get(const Evas_Object *obj);
  * This returns total number of frames the image object supports (if animated)
  * 
  * @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get() 
+ * @see evas_object_image_animated_frame_count_get() 
  * @see evas_object_image_animated_loop_type_get()
  * @see evas_object_image_animated_loop_count_get()
  * @see evas_object_image_animated_frame_duration_get()
@@ -7248,7 +7248,7 @@ EAPI int evas_object_image_animated_frame_count_get(const Evas_Object *obj);
  * The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.
  *
  * @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get() 
+ * @see evas_object_image_animated_frame_count_get() 
  * @see evas_object_image_animated_loop_type_get()
  * @see evas_object_image_animated_loop_count_get()
  * @see evas_object_image_animated_frame_duration_get()
@@ -7271,7 +7271,7 @@ EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(cons
  * the number of times it loops).
  *
  * @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get() 
+ * @see evas_object_image_animated_frame_count_get() 
  * @see evas_object_image_animated_loop_type_get()
  * @see evas_object_image_animated_loop_count_get()
  * @see evas_object_image_animated_frame_duration_get()
@@ -7295,7 +7295,7 @@ EAPI int evas_object_image_animated_loop_count_get(const Evas_Object *obj);
  * frame2's duration
  *
  * @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get() 
+ * @see evas_object_image_animated_frame_count_get() 
  * @see evas_object_image_animated_loop_type_get()
  * @see evas_object_image_animated_loop_count_get()
  * @see evas_object_image_animated_frame_duration_get()
@@ -7314,7 +7314,7 @@ EAPI double evas_object_image_animated_frame_duration_get(const Evas_Object *obj
  * frame.
  *
  * @see evas_object_image_animated_get()
- * @see evas_object_image_animated_frame_num_get() 
+ * @see evas_object_image_animated_frame_count_get() 
  * @see evas_object_image_animated_loop_type_get()
  * @see evas_object_image_animated_loop_count_get()
  * @see evas_object_image_animated_frame_duration_get()
index c3b757a..3433dba 100644 (file)
@@ -294,15 +294,32 @@ _evas_image_load_frame_image_data(Image_Entry *ie, GifFileType *gif, Image_Entry
         DATA32            *ptr_src;
         Image_Entry_Frame *new_frame = NULL;
         int                cur_frame = frame->index;
+        int                start_frame = 1;
+        int                j = 0;
 
-        if (!_find_close_frame(ie, cur_frame,  &new_frame))
+        if (_find_close_frame(ie, cur_frame, &new_frame))
+          start_frame = new_frame->index + 1;
+
+        if ((start_frame < 1) || (start_frame > cur_frame))
+          {
+             *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
+             goto error;
+          }
+        /* load previous frame of cur_frame */
+        for (j = start_frame; j < cur_frame ; j++)
           {
-             if (!evas_image_load_specific_frame(ie, ie->file, cur_frame-1, error))
+             if (!evas_image_load_specific_frame(ie, ie->file, j, error))
                {
                   *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
                   goto error;
                }
           }
+
+        if (!_find_frame(ie, cur_frame - 1, &new_frame))
+          {
+             *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
+             goto error;
+          }
         else
           {
              ptr_src = new_frame->data;