diff --git a/receiver/JFJochReceiver.cpp b/receiver/JFJochReceiver.cpp index d6f24935..56d2f5b3 100644 --- a/receiver/JFJochReceiver.cpp +++ b/receiver/JFJochReceiver.cpp @@ -504,13 +504,14 @@ void JFJochReceiver::GetStatistics(JFJochProtoBuf::ReceiverOutput &ret) const { ret.set_compressed_size(compressed_size); ret.set_max_image_number_sent(max_image_number_sent); - if (experiment.GetImageNum() > 0) { + if ((experiment.GetImageNum() > 0) && (compressed_size > 0)) { ret.set_compressed_ratio( static_cast (images_sent * experiment.GetPixelDepth() * experiment.GetModulesNum() * RAW_MODULE_SIZE) / static_cast (compressed_size)); - } + } else + ret.set_compressed_ratio(0); if (!max_delay.empty()) ret.set_max_receive_delay(*std::max_element(max_delay.begin(), max_delay.end()));