evas image loaders - silence noisy warnings that are just not needed
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
This commit is contained in:
parent
2098e8c856
commit
43a932ab3c
|
@ -157,8 +157,7 @@ _dword_read(const char **m)
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FAIL() do { fprintf(stderr, "DDS: ERROR at %s:%d\n", \
|
#define FAIL() do { /*fprintf(stderr, "DDS: ERROR at %s:%d\n", __FUNCTION__, __LINE__);*/ goto on_error; } while (0)
|
||||||
__FUNCTION__, __LINE__); goto on_error; } while (0)
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
evas_image_load_file_head_dds(void *loader_data,
|
evas_image_load_file_head_dds(void *loader_data,
|
||||||
|
|
|
@ -37,21 +37,21 @@ struct _Evas_Loader_Internal
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
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
|
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
|
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
|
static Eina_Bool
|
||||||
|
|
|
@ -168,7 +168,7 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
||||||
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
||||||
if (length < 9)
|
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;
|
goto on_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,39 +234,39 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
||||||
{
|
{
|
||||||
/* Header */
|
/* Header */
|
||||||
if (sscanf(line, "%i %i %i %i", &w, &h, &ncolors, &cpp) != 4)
|
if (sscanf(line, "%i %i %i %i", &w, &h, &ncolors, &cpp) != 4)
|
||||||
{
|
{
|
||||||
ERR("XPM ERROR: XPM file malformed header");
|
// ERR("XPM ERROR: XPM file malformed header");
|
||||||
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
||||||
goto on_error;
|
goto on_error;
|
||||||
}
|
}
|
||||||
if ((ncolors > 32766) || (ncolors < 1))
|
if ((ncolors > 32766) || (ncolors < 1))
|
||||||
{
|
{
|
||||||
ERR("XPM ERROR: XPM files with colors > 32766 or < 1 not supported");
|
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;
|
goto on_error;
|
||||||
}
|
}
|
||||||
if ((cpp > 5) || (cpp < 1))
|
if ((cpp > 5) || (cpp < 1))
|
||||||
{
|
{
|
||||||
ERR("XPM ERROR: XPM files with characters per pixel > 5 or < 1not supported");
|
ERR("XPM ERROR: XPM files with characters per pixel > 5 or < 1not supported");
|
||||||
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
|
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
|
||||||
goto on_error;
|
goto on_error;
|
||||||
}
|
}
|
||||||
if ((w > IMG_MAX_SIZE) || (w < 1))
|
if ((w > IMG_MAX_SIZE) || (w < 1))
|
||||||
{
|
{
|
||||||
ERR("XPM ERROR: Image width > IMG_MAX_SIZE or < 1 pixels for file");
|
ERR("XPM ERROR: Image width > IMG_MAX_SIZE or < 1 pixels for file");
|
||||||
*error = EVAS_LOAD_ERROR_GENERIC;
|
*error = EVAS_LOAD_ERROR_GENERIC;
|
||||||
goto on_error;
|
goto on_error;
|
||||||
}
|
}
|
||||||
if ((h > IMG_MAX_SIZE) || (h < 1))
|
if ((h > IMG_MAX_SIZE) || (h < 1))
|
||||||
{
|
{
|
||||||
ERR("XPM ERROR: Image height > IMG_MAX_SIZE or < 1 pixels for file");
|
ERR("XPM ERROR: Image height > IMG_MAX_SIZE or < 1 pixels for file");
|
||||||
*error = EVAS_LOAD_ERROR_GENERIC;
|
*error = EVAS_LOAD_ERROR_GENERIC;
|
||||||
goto on_error;
|
goto on_error;
|
||||||
}
|
}
|
||||||
if (IMG_TOO_BIG(w, h))
|
if (IMG_TOO_BIG(w, h))
|
||||||
{
|
{
|
||||||
ERR("XPM ERROR: Image just too big to ever allocate");
|
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;
|
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);
|
cmap = malloc(sizeof(CMap) * ncolors);
|
||||||
if (!cmap)
|
if (!cmap)
|
||||||
{
|
{
|
||||||
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
*error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
|
||||||
goto on_error;
|
goto on_error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue