plug-ins: replace a few occurrences of g_message with g_set_error in psp reader.

This commit is contained in:
Jacob Boerema 2020-09-05 22:41:59 -04:00
parent fcaf582de9
commit 0a8f5b99f5
1 changed files with 8 additions and 4 deletions

View File

@ -939,7 +939,8 @@ read_general_image_attribute_block (FILE *f,
if (init_len < 38 || total_len < 38)
{
g_message ("Invalid general image attribute chunk size");
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Invalid general image attribute chunk size."));
return -1;
}
@ -960,7 +961,8 @@ read_general_image_attribute_block (FILE *f,
|| (psp_ver_major >= 4 && fread (graphics_content, 4, 1, f) < 1)
|| try_fseek (f, chunk_start + init_len, SEEK_SET, error) < 0)
{
g_message ("Error reading general image attribute block");
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Error reading general image attribute block."));
return -1;
}
ia->width = GUINT32_FROM_LE (ia->width);
@ -974,14 +976,16 @@ read_general_image_attribute_block (FILE *f,
ia->compression = GUINT16_FROM_LE (ia->compression);
if (ia->compression > PSP_COMP_LZ77)
{
g_message ("Unknown compression type %d", ia->compression);
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Unknown compression type %d"), ia->compression);
return -1;
}
ia->depth = GUINT16_FROM_LE (ia->depth);
if (ia->depth != 24)
{
g_message ("Unsupported bit depth %d", ia->depth);
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
_("Unsupported bit depth %d"), ia->depth);
return -1;
}