engrave: Fix condition as average[] is initialized based on num_channels

This commit is contained in:
Mukund Sivaraman 2011-10-13 10:20:34 +05:30
parent 35a62be10a
commit c4be5b1a4f
1 changed files with 3 additions and 1 deletions

View File

@ -522,6 +522,8 @@ engrave_sub (gint height,
gint count;
gint i;
g_return_if_fail ((num_channels == 1) || (num_channels == 3));
/*
Since there's so many nested FOR's,
put a few of them here...
@ -555,7 +557,7 @@ engrave_sub (gint height,
for (i = 0; i < num_channels; i++)
average[i] /= count;
if (bpp < 3)
if (num_channels == 1)
inten = average[0] / 254.0 * height;
else
inten = GIMP_RGB_LUMINANCE (average[0],