[pktools] 132/375: corrected min max for pkinfo -hist, thanks to Giuseppe for noticing
Bas Couwenberg
sebastic at xs4all.nl
Wed Dec 3 21:54:07 UTC 2014
This is an automated email from the git hooks/post-receive script.
sebastic-guest pushed a commit to branch upstream-master
in repository pktools.
commit d96657486d60586cb6b78f6989a2a83715667ce4
Author: Pieter Kempeneers <kempenep at gmail.com>
Date: Tue Oct 1 16:57:14 2013 +0200
corrected min max for pkinfo -hist, thanks to Giuseppe for noticing
---
ChangeLog | 2 +-
src/apps/pkmosaic.cc | 4 ++++
src/imageclasses/ImgReaderGdal.cc | 6 ++----
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d6d6bb8..c948569 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -121,7 +121,7 @@ version 2.4.2
- FileReaderAscii
corrected error for constructor with fieldseparator argument
- pkinfo
- bug fixed with -min and -max
+ bug fixed with -min and -max in hist (thanks to Giuseppe Amatuli for noticing)
- pkfilter
new methods for scrambling and shifting images
- pkstatogr
diff --git a/src/apps/pkmosaic.cc b/src/apps/pkmosaic.cc
index b25c606..7bb4966 100644
--- a/src/apps/pkmosaic.cc
+++ b/src/apps/pkmosaic.cc
@@ -121,6 +121,10 @@ int main(int argc, char *argv[])
while(invalid_opt.size()<validBand_opt.size())
invalid_opt.push_back(invalid_opt[0]);
+ while(minValue_opt.size()<validBand_opt.size())
+ minValue_opt.push_back(minValue_opt[0]);
+ while(maxValue_opt.size()<validBand_opt.size())
+ maxValue_opt.push_back(maxValue_opt[0]);
RESAMPLE theResample;
switch(resample_opt[0]){
case(BILINEAR):
diff --git a/src/imageclasses/ImgReaderGdal.cc b/src/imageclasses/ImgReaderGdal.cc
index fa46a30..c4ad030 100644
--- a/src/imageclasses/ImgReaderGdal.cc
+++ b/src/imageclasses/ImgReaderGdal.cc
@@ -451,12 +451,10 @@ unsigned long int ImgReaderGdal::getHistogram(std::vector<unsigned long int>& hi
getMinMax(minValue,maxValue,theBand);
if(min<max&&min>minValue)
minValue=min;
- else
- min=minValue;
if(min<max&&max<maxValue)
maxValue=max;
- else
- max=maxValue;
+ min=minValue;
+ max=maxValue;
if(nbin==0)
nbin=maxValue-minValue+1;
assert(nbin>0);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git
More information about the Pkg-grass-devel
mailing list