Commit 5fff85a9 authored by Nick Lamb /GIMP's avatar Nick Lamb /GIMP
Browse files

Check resolution validity when changed by plug-ins too

parent c363d0a8
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
......
......@@ -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;
if (xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
success = FALSE;
gimage->yresolution = args[2].value.pdb_float;
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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment