mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-21 20:12:30 +00:00
A few minor bugfixes I recently discovered in the xpm saver.
This commit is contained in:
parent
1d7001aaf6
commit
41fb8c1906
|
@ -1,3 +1,8 @@
|
|||
Wed Dec 17 13:24:48 1997 Scott Goehring <scott@poverty.bloomington.in.us>
|
||||
|
||||
* plug-ins/xpm/xpm.c (run): Added access to the alpha cutoff via
|
||||
the PDB. Added a missing break in the run_mode switch.
|
||||
|
||||
Tue Dec 16 16:55:04 PST 1997 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* app/convert.c: no more crashes with indexed conversion and no
|
||||
|
|
|
@ -57,9 +57,6 @@ static void run (char *name,
|
|||
int *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
|
||||
static void
|
||||
dump(XImage *xx, char *yy);
|
||||
|
||||
static gint32
|
||||
load_image (char *filename);
|
||||
|
||||
|
@ -147,6 +144,8 @@ query ()
|
|||
{ PARAM_DRAWABLE, "drawable", "Drawable to save" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to save the image in" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to save the image in" },
|
||||
{ PARAM_FLOAT, "alpha_threshold", "Alpha cutoff threshold" }
|
||||
|
||||
};
|
||||
static int nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
|
@ -229,15 +228,16 @@ run (char *name,
|
|||
|
||||
case RUN_NONINTERACTIVE:
|
||||
/* Make sure all the arguments are there! */
|
||||
if (nparams != 4)
|
||||
if (nparams != 5)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
xpmvals.threshold = param[4].data.d_float;
|
||||
xpmvals.threshold = param[5].data.d_float;
|
||||
}
|
||||
if (status == STATUS_SUCCESS &&
|
||||
(xpmvals.threshold < 0.0 || xpmvals.threshold > 1.0))
|
||||
status = STATUS_CALLING_ERROR;
|
||||
break;
|
||||
|
||||
case RUN_WITH_LAST_VALS:
|
||||
/* Possibly retrieve data */
|
||||
|
@ -655,17 +655,6 @@ save_image_2 (GDrawable *drawable,
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
dump(XImage *xx, char *yy)
|
||||
{
|
||||
printf("\n%s\n", yy);
|
||||
printf("%d %d %d\n", xx->width, xx->height, xx->depth);
|
||||
printf("%x %x %x\n", xx->red_mask, xx->green_mask, xx->blue_mask);
|
||||
printf("%d %d %d\n", xx->format, xx->byte_order, xx->bitmap_bit_order);
|
||||
printf("%d %d\n", xx->bitmap_unit, xx->bitmap_pad);
|
||||
printf("%d %d\n", xx->bytes_per_line, xx->bits_per_pixel);
|
||||
}
|
||||
|
||||
|
||||
static gint
|
||||
save_dialog ()
|
||||
|
|
|
@ -57,9 +57,6 @@ static void run (char *name,
|
|||
int *nreturn_vals,
|
||||
GParam **return_vals);
|
||||
|
||||
static void
|
||||
dump(XImage *xx, char *yy);
|
||||
|
||||
static gint32
|
||||
load_image (char *filename);
|
||||
|
||||
|
@ -147,6 +144,8 @@ query ()
|
|||
{ PARAM_DRAWABLE, "drawable", "Drawable to save" },
|
||||
{ PARAM_STRING, "filename", "The name of the file to save the image in" },
|
||||
{ PARAM_STRING, "raw_filename", "The name of the file to save the image in" },
|
||||
{ PARAM_FLOAT, "alpha_threshold", "Alpha cutoff threshold" }
|
||||
|
||||
};
|
||||
static int nsave_args = sizeof (save_args) / sizeof (save_args[0]);
|
||||
|
||||
|
@ -229,15 +228,16 @@ run (char *name,
|
|||
|
||||
case RUN_NONINTERACTIVE:
|
||||
/* Make sure all the arguments are there! */
|
||||
if (nparams != 4)
|
||||
if (nparams != 5)
|
||||
status = STATUS_CALLING_ERROR;
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
xpmvals.threshold = param[4].data.d_float;
|
||||
xpmvals.threshold = param[5].data.d_float;
|
||||
}
|
||||
if (status == STATUS_SUCCESS &&
|
||||
(xpmvals.threshold < 0.0 || xpmvals.threshold > 1.0))
|
||||
status = STATUS_CALLING_ERROR;
|
||||
break;
|
||||
|
||||
case RUN_WITH_LAST_VALS:
|
||||
/* Possibly retrieve data */
|
||||
|
@ -655,17 +655,6 @@ save_image_2 (GDrawable *drawable,
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
dump(XImage *xx, char *yy)
|
||||
{
|
||||
printf("\n%s\n", yy);
|
||||
printf("%d %d %d\n", xx->width, xx->height, xx->depth);
|
||||
printf("%x %x %x\n", xx->red_mask, xx->green_mask, xx->blue_mask);
|
||||
printf("%d %d %d\n", xx->format, xx->byte_order, xx->bitmap_bit_order);
|
||||
printf("%d %d\n", xx->bitmap_unit, xx->bitmap_pad);
|
||||
printf("%d %d\n", xx->bytes_per_line, xx->bits_per_pixel);
|
||||
}
|
||||
|
||||
|
||||
static gint
|
||||
save_dialog ()
|
||||
|
|
Loading…
Reference in a new issue