r17754 by jghali - #11028: Qt image reader backend labels all images as RGB

scribus-commit scribus-commit at lists.scribus.net
Sat Aug 11 10:40:23 UTC 2012


Author: jghali
Date: Sat Aug 11 10:40:23 2012
New Revision: 17754

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17754
Log:
#11028: Qt image reader backend labels all images as RGB

Modified:
    branches/Version14x/Scribus/scribus/scimgdataloader_qt.cpp

Modified: branches/Version14x/Scribus/scribus/scimgdataloader_qt.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17754&path=/branches/Version14x/Scribus/scribus/scimgdataloader_qt.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scimgdataloader_qt.cpp (original)
+++ branches/Version14x/Scribus/scribus/scimgdataloader_qt.cpp Sat Aug 11 10:40:23 2012
@@ -42,10 +42,12 @@
 		float xres = m_image.dotsPerMeterX() * 0.0254;
 		float yres = m_image.dotsPerMeterY() * 0.0254;
 		int resInf = m_imageInfoRecord.lowResType;
+		m_imageInfoRecord.colorspace = ColorSpaceRGB;
+		if (m_image.isGrayscale() || m_image.depth() == 1)
+			m_imageInfoRecord.colorspace = ColorSpaceGray;
 		m_image = m_image.convertToFormat(QImage::Format_ARGB32);
 		m_image.setDotsPerMeterX (qMax(2834, (int) (xres / 0.0254)));
 		m_image.setDotsPerMeterY (qMax(2834, (int) (yres / 0.0254)));
-		m_imageInfoRecord.colorspace = ColorSpaceRGB;
 		m_imageInfoRecord.xres = qMax(72, qRound(xres));
 		m_imageInfoRecord.yres = qMax(72, qRound(yres));
 		m_imageInfoRecord.lowResType = resInf;




More information about the scribus-commit mailing list