X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fimagefile.cpp;h=623b4e32c265de5b75abdc46531bab1088b546ab;hp=eeda46d37d4300f4662d15ac2924fa88ebdaa311;hb=fb17e4a8130583e4d7a911fdaa70782561cd6a3e;hpb=e8462f7431582627e44906239077f1c696eefba1 diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index eeda46d..623b4e3 100644 --- a/libctsim/imagefile.cpp +++ b/libctsim/imagefile.cpp @@ -264,6 +264,7 @@ ImageFile::printStatistics (std::ostream& os) const if (isComplex()) os << "Real Component Statistics" << std::endl; + os << std::setprecision(7); os << " min: " << min << std::endl; os << " max: " << max << std::endl; os << " mean: " << mean << std::endl; @@ -1545,8 +1546,8 @@ ImageFile::readImagePNG (const char* const pszFile) if (!fp) return false; unsigned char header[8]; - fread (header, 1, 8, fp); - if (png_sig_cmp (header, 0, 8)) { + int n = fread (header, 1, 8, fp); + if (n != 8 || png_sig_cmp (header, 0, 8)) { fclose (fp); return false; }