Check resolution validity when changed by plug-ins too
This commit is contained in:
@ -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>
|
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
|
* PLUGIN_MAINTAINERS: Put me down for CEL, PCX, TIF and PNG
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
#include "layer.h"
|
#include "layer.h"
|
||||||
#include "layer_pvt.h"
|
#include "layer_pvt.h"
|
||||||
|
|
||||||
|
#include "libgimp/gimplimits.h"
|
||||||
|
|
||||||
static ProcRecord image_list_proc;
|
static ProcRecord image_list_proc;
|
||||||
static ProcRecord image_new_proc;
|
static ProcRecord image_new_proc;
|
||||||
static ProcRecord image_resize_proc;
|
static ProcRecord image_resize_proc;
|
||||||
@ -3321,15 +3323,25 @@ static Argument *
|
|||||||
image_set_resolution_invoker (Argument *args)
|
image_set_resolution_invoker (Argument *args)
|
||||||
{
|
{
|
||||||
gboolean success = TRUE;
|
gboolean success = TRUE;
|
||||||
|
gdouble xresolution, yresolution;
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
|
|
||||||
gimage = pdb_id_to_image (args[0].value.pdb_int);
|
gimage = pdb_id_to_image (args[0].value.pdb_int);
|
||||||
if (gimage == NULL)
|
if (gimage == NULL)
|
||||||
success = FALSE;
|
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);
|
return procedural_db_return_args (&image_set_resolution_proc, success);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user