app: improve error message loading pattern that is too large

As noted in issue #6032 the error message when trying to open a pattern
file with dimension larger than supported could be a little clearer.

We do this by adding the maximum allowed dimensions to the error message.
This commit is contained in:
Jacob Boerema 2021-08-09 18:08:33 -04:00
parent f130fe1917
commit 317b5d9cff
1 changed files with 5 additions and 4 deletions

View File

@ -96,10 +96,11 @@ gimp_pattern_load (GimpContext *context,
(G_MAXSIZE / header.width / header.height / header.bytes < 1))
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Invalid header data in '%s': width=%lu, height=%lu, "
"bytes=%lu"), gimp_file_get_utf8_name (file),
(gulong) header.width,
(gulong) header.height,
_("Invalid header data in '%s': width=%lu (maximum %lu), "
"height=%lu (maximum %lu), bytes=%lu"),
gimp_file_get_utf8_name (file),
(gulong) header.width, (gulong) GIMP_PATTERN_MAX_SIZE,
(gulong) header.height, (gulong) GIMP_PATTERN_MAX_SIZE,
(gulong) header.bytes);
goto error;
}