Check resolution validity when changed by plug-ins too

This commit is contained in:
Nick Lamb /GIMP
2000-01-10 04:39:18 +00:00
parent c363d0a8b3
commit 5fff85a9f3
2 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,7 @@
Mon Jan 10 06:10:00 GMT 2000 Nick Lamb <njl195@zepler.org.uk>
* app/gimage_cmds.c: Check resolution validity here too.
Mon Jan 10 02:10:15 GMT 2000 Nick Lamb <njl195@zepler.org.uk>
* PLUGIN_MAINTAINERS: Put me down for CEL, PCX, TIF and PNG

View File

@ -32,6 +32,8 @@
#include "layer.h"
#include "layer_pvt.h"
#include "libgimp/gimplimits.h"
static ProcRecord image_list_proc;
static ProcRecord image_new_proc;
static ProcRecord image_resize_proc;
@ -3321,15 +3323,25 @@ static Argument *
image_set_resolution_invoker (Argument *args)
{
gboolean success = TRUE;
gdouble xresolution, yresolution;
GimpImage *gimage;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
success = FALSE;
gimage->xresolution = args[1].value.pdb_float;
xresolution = args[1].value.pdb_float;
yresolution = args[2].value.pdb_float;
gimage->yresolution = args[2].value.pdb_float;
if (xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
success = FALSE;
if (success)
{
gimage->xresolution = args[1].value.pdb_float;
gimage->yresolution = args[2].value.pdb_float;
}
return procedural_db_return_args (&image_set_resolution_proc, success);
}