r13902 by fschmid - Allow images with resolutions below 72 dpi.

scribus-commit scribus-commit at lists.scribus.net
Wed Aug 26 05:53:38 CEST 2009


Revision: 13902
Author: fschmid
Date: 2009-08-23T17:41:02.318081Z
Commit message: Allow images with resolutions below 72 dpi.

Changeset: 
M  /trunk/Scribus/scribus/scimgdataloader_qt.cpp

Diffs:
Index: scribus/scimgdataloader_qt.cpp
===================================================================
--- scribus/scimgdataloader_qt.cpp	(revision 13901)
+++ scribus/scimgdataloader_qt.cpp	(revision 13902)
@@ -41,13 +41,17 @@
 		m_imageInfoRecord.exifDataValid = false;
 		float xres = m_image.dotsPerMeterX() * 0.0254;
 		float yres = m_image.dotsPerMeterY() * 0.0254;
+		if( xres <= 1.0 || xres > 3000.0 )
+			xres = 72.0;
+		if( yres <= 1.0 || yres > 3000.0 )
+			yres = 72.0;
 		int resInf = m_imageInfoRecord.lowResType;
 		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_image.setDotsPerMeterX ((int) (xres / 0.0254));
+		m_image.setDotsPerMeterY ((int) (yres / 0.0254));
 		m_imageInfoRecord.colorspace = ColorSpaceRGB;
-		m_imageInfoRecord.xres = qMax(72, qRound(xres));
-		m_imageInfoRecord.yres = qMax(72, qRound(yres));
+		m_imageInfoRecord.xres = qRound(xres);
+		m_imageInfoRecord.yres = qRound(yres);
 		m_imageInfoRecord.lowResType = resInf;
 		m_imageInfoRecord.BBoxX = 0;
 		m_imageInfoRecord.BBoxH = m_image.height();




More information about the scribus-commit mailing list