Commit 2c9a2505 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

fixed checks for uncalculated histogram. Fixes bug #170570.

2005-03-16  Sven Neumann  <sven@gimp.org>

	* app/base/gimphistogram.c: fixed checks for uncalculated histogram.
	Fixes bug #170570.
parent c8ba3b11
2005-03-16 Sven Neumann <sven@gimp.org>
* app/base/gimphistogram.c: fixed checks for uncalculated histogram.
Fixes bug #170570.
2005-03-14 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/tools/gimpnewrectselecttool.c
......@@ -8,7 +13,8 @@
* app/paint-funcs/paint-funcs.c
* app/paint-funcs/paint-funcs-generic.h: fix bug #143315. When the
visibility of the Alpha channel is turned off, it should make alpha=255.
visibility of the Alpha channel is turned off, it should make
alpha=255.
2005-03-13 Manish Singh <yosh@gimp.org>
......
......@@ -140,7 +140,7 @@ gimp_histogram_get_maximum (GimpHistogram *histogram,
if (histogram->n_channels == 3 && channel == GIMP_HISTOGRAM_ALPHA)
channel = 1;
if (! histogram->values ||
if (! histogram->values[0] ||
(channel != GIMP_HISTOGRAM_RGB && channel >= histogram->n_channels))
return 0.0;
......@@ -171,7 +171,7 @@ gimp_histogram_get_value (GimpHistogram *histogram,
if (histogram->n_channels == 3 && channel == GIMP_HISTOGRAM_ALPHA)
channel = 1;
if (! histogram->values ||
if (! histogram->values[0] ||
bin < 0 || bin >= 256 ||
(channel == GIMP_HISTOGRAM_RGB && histogram->n_channels < 4) ||
(channel != GIMP_HISTOGRAM_RGB && channel >= histogram->n_channels))
......@@ -235,7 +235,7 @@ gimp_histogram_get_count (GimpHistogram *histogram,
gimp_histogram_get_count (histogram,
GIMP_HISTOGRAM_BLUE, start, end));
if (! histogram->values ||
if (! histogram->values[0] ||
start > end ||
channel >= histogram->n_channels)
return 0.0;
......@@ -265,7 +265,7 @@ gimp_histogram_get_mean (GimpHistogram *histogram,
if (histogram->n_channels == 3 && channel == GIMP_HISTOGRAM_ALPHA)
channel = 1;
if (! histogram->values ||
if (! histogram->values[0] ||
start > end ||
(channel == GIMP_HISTOGRAM_RGB && histogram->n_channels < 4) ||
(channel != GIMP_HISTOGRAM_RGB && channel >= histogram->n_channels))
......@@ -311,7 +311,7 @@ gimp_histogram_get_median (GimpHistogram *histogram,
if (histogram->n_channels == 3 && channel == GIMP_HISTOGRAM_ALPHA)
channel = 1;
if (! histogram->values ||
if (! histogram->values[0] ||
start > end ||
(channel == GIMP_HISTOGRAM_RGB && histogram->n_channels < 4) ||
(channel != GIMP_HISTOGRAM_RGB && channel >= histogram->n_channels))
......@@ -361,7 +361,7 @@ gimp_histogram_get_std_dev (GimpHistogram *histogram,
if (histogram->n_channels == 3 && channel == GIMP_HISTOGRAM_ALPHA)
channel = 1;
if (! histogram->values ||
if (! histogram->values[0] ||
start > end ||
(channel == GIMP_HISTOGRAM_RGB && histogram->n_channels < 4) ||
(channel != GIMP_HISTOGRAM_RGB && channel >= histogram->n_channels))
......
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