From 7ec54f936be0ac8d7fade4df133c4b1009e5782a Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Fri, 11 Oct 2013 18:32:25 -0400 Subject: [PATCH 1/1] gui: fix pixel info on flipped images Flipped images were still using the original image instead of flipping the coordinates, thus returning the wrong data. Let's just flip the y-axis to find the right location in the original image. --- gui/imageviewer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gui/imageviewer.cpp b/gui/imageviewer.cpp index eced83b..867fa61 100644 --- a/gui/imageviewer.cpp +++ b/gui/imageviewer.cpp @@ -151,6 +151,11 @@ void ImageViewer::showPixel(int x, int y) QString label = tr("Pixel: "); + /* If the image is flipped, substitute y to match */ + if (flipCheckBox->isChecked()) { + y = m_convertedImage.height() - y - 1; + } + if (m_image->channelType == image::TYPE_UNORM8) { label += createPixelLabel(m_image, x, y); } else { -- 2.43.0