on data load alloc surface only if dimensiosn match
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 May 2010 15:34:22 +0000 (15:34 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 May 2010 15:34:22 +0000 (15:34 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@49329 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/loaders/bmp/evas_image_load_bmp.c

index eea16d3..f55a4fd 100644 (file)
@@ -533,6 +533,11 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
        goto close_file;
      }
    
+   if ((w != ie->w) || (h != ie->h))
+     {
+       *error = EVAS_LOAD_ERROR_GENERIC;
+       goto close_file;
+     }
    evas_cache_image_surface_alloc(ie, w, h);
    surface = evas_cache_image_pixels(ie);
    if (!surface)
@@ -540,11 +545,6 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
        *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
        goto close_file;
      }
-   if ((w != ie->w) || (h != ie->h))
-     {
-       *error = EVAS_LOAD_ERROR_GENERIC;
-       goto close_file;
-     }
    
    if (bit_count < 16)
      {
@@ -1080,8 +1080,6 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
      }
    else
      goto close_file;
-     
-   if (hasa) ie->flags.alpha = 1;
    
    if (buffer) free(buffer);
    E_FCLOSE(f);