evas image loaders - silence noisy warnings that are just not needed
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 15 Aug 2014 03:45:01 +0000 (12:45 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 15 Aug 2014 03:45:01 +0000 (12:45 +0900)
several loaders make too much noise when a file fails to load - almost
all of this is because the file isnt actually an image format file at
all, and an ap is just asking evas to try do a load to see if it is a
loadable image at all. this results in noisy strerr output that simply
shouldnt be there. so silence for loaders. @fix

src/modules/evas/loaders/dds/evas_image_load_dds.c
src/modules/evas/loaders/jp2k/evas_image_load_jp2k.c
src/modules/evas/loaders/xpm/evas_image_load_xpm.c

index fb151ab..69c9219 100644 (file)
@@ -157,8 +157,7 @@ _dword_read(const char **m)
    return val;
 }
 
-#define FAIL() do { fprintf(stderr, "DDS: ERROR at %s:%d\n", \
-   __FUNCTION__, __LINE__); goto on_error; } while (0)
+#define FAIL() do { /*fprintf(stderr, "DDS: ERROR at %s:%d\n", __FUNCTION__, __LINE__);*/ goto on_error; } while (0)
 
 static Eina_Bool
 evas_image_load_file_head_dds(void *loader_data,
index 28200ce..ececb6d 100644 (file)
@@ -37,21 +37,21 @@ struct _Evas_Loader_Internal
 };
 
 static void
-_jp2k_error_cb(const char *msg, void *data EINA_UNUSED)
+_jp2k_error_cb(const char *msg EINA_UNUSED, void *data EINA_UNUSED)
 {
-   ERR("OpenJPEG internal error: '%s'.", msg);
+//   ERR("OpenJPEG internal error: '%s'.", msg);
 }
 
 static void
-_jp2k_warning_cb(const char *msg, void *data EINA_UNUSED)
+_jp2k_warning_cb(const char *msg EINA_UNUSED, void *data EINA_UNUSED)
 {
-   WRN("OpenJPEG internal warning: '%s'.", msg);
+//   WRN("OpenJPEG internal warning: '%s'.", msg);
 }
 
 static void
-_jp2k_info_cb(const char *msg, void *data EINA_UNUSED)
+_jp2k_info_cb(const char *msg EINA_UNUSED, void *data EINA_UNUSED)
 {
-   INF("OpenJPEG internal information: '%s'.", msg);
+//   INF("OpenJPEG internal information: '%s'.", msg);
 }
 
 static Eina_Bool
index 4a2ab2b..cf9b9df 100644 (file)
@@ -168,7 +168,7 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
    *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
    if (length < 9)
      {
-        ERR("XPM ERROR: file size, %zd, is to small", length);
+//        ERR("XPM ERROR: file size, %zd, is to small", length);
         goto on_error;
      }
 
@@ -234,39 +234,39 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
                     {
                        /* Header */
                        if (sscanf(line, "%i %i %i %i", &w, &h, &ncolors, &cpp) != 4)
-                        {
-                           ERR("XPM ERROR: XPM file malformed header");
-                           *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
+                         {
+//                            ERR("XPM ERROR: XPM file malformed header");
+                            *error = EVAS_LOAD_ERROR_CORRUPT_FILE;
                             goto on_error;
-                        }
+                         }
                        if ((ncolors > 32766) || (ncolors < 1))
                          {
                             ERR("XPM ERROR: XPM files with colors > 32766 or < 1 not supported");
-                           *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+                            *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
                             goto on_error;
                          }
                        if ((cpp > 5) || (cpp < 1))
                          {
-                           ERR("XPM ERROR: XPM files with characters per pixel > 5 or < 1not supported");
-                           *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+                            ERR("XPM ERROR: XPM files with characters per pixel > 5 or < 1not supported");
+                            *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
                             goto on_error;
                          }
                        if ((w > IMG_MAX_SIZE) || (w < 1))
                          {
-                           ERR("XPM ERROR: Image width > IMG_MAX_SIZE or < 1 pixels for file");
-                           *error = EVAS_LOAD_ERROR_GENERIC;
+                            ERR("XPM ERROR: Image width > IMG_MAX_SIZE or < 1 pixels for file");
+                            *error = EVAS_LOAD_ERROR_GENERIC;
                             goto on_error;
                          }
                        if ((h > IMG_MAX_SIZE) || (h < 1))
                          {
-                           ERR("XPM ERROR: Image height > IMG_MAX_SIZE or < 1 pixels for file");
-                           *error = EVAS_LOAD_ERROR_GENERIC;
+                            ERR("XPM ERROR: Image height > IMG_MAX_SIZE or < 1 pixels for file");
+                            *error = EVAS_LOAD_ERROR_GENERIC;
                             goto on_error;
                          }
                        if (IMG_TOO_BIG(w, h))
                          {
                             ERR("XPM ERROR: Image just too big to ever allocate");
-                           *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+                            *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
                             goto on_error;
                          }
 
@@ -275,7 +275,7 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
                             cmap = malloc(sizeof(CMap) * ncolors);
                             if (!cmap)
                               {
-                               *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+                                 *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
                                 goto on_error;
                               }
                          }