r14258 by fschmid - Fixed Bug #8549: "Postscript images backround rendered opaque in pdf's although displayed transparent on canvas"

scribus-commit scribus-commit at lists.scribus.net
Tue Nov 3 14:15:22 CET 2009


Revision: 14258
Author: fschmid
Date: 2009-11-03T08:06:26.024170Z
Commit message: Fixed Bug #8549: "Postscript images backround rendered opaque in pdf's although displayed transparent on canvas"

Changeset: 
M  /trunk/Scribus/scribus/scimgdataloader_ps.h
M  /trunk/Scribus/scribus/scimgdataloader_ps.cpp

Diffs:
Index: scribus/scimgdataloader_ps.cpp
===================================================================
--- scribus/scimgdataloader_ps.cpp	(revision 14257)
+++ scribus/scimgdataloader_ps.cpp	(revision 14258)
@@ -139,6 +139,7 @@
 	hasThumbnail = false;
 	inTrailer = false;
 	BBoxInTrailer = false;
+	isRotated = false;
 	int plateCount = 0;
 	uint startPos = 0;
 	FontListe.clear();
@@ -226,6 +227,11 @@
 					BBox = tmp.remove("%%BoundingBox");
 				}
 			}
+			if (tmp.startsWith("%%Orientation:"))
+			{
+				if (tmp.contains("Landscape"))
+					isRotated = true;
+			}
 			if (tmp.startsWith("%%CyanPlate:"))
 			{
 				colorPlates.insert("Cyan", tmp.remove("%%CyanPlate: "));
@@ -569,7 +575,7 @@
 			if (retg == 0)
 			{
 				m_image.load(tmpFile);
-				if (extensionIndicatesEPS(ext) && BBoxInTrailer)
+				if ((extensionIndicatesEPS(ext) && BBoxInTrailer) || (isRotated))
 				{
 					int ex = qRound(x * gsRes / 72.0);
 					int ey = qRound(m_image.height() - h);
@@ -577,7 +583,7 @@
 					int eh = qRound(h - y * gsRes / 72.0);
 					m_image = m_image.copy(ex, ey, ew, eh);
 				}
-				if (!ScCore->havePNGAlpha())
+				if ((!ScCore->havePNGAlpha()) || (isRotated))
 				{
 					int wi = m_image.width();
 					int hi = m_image.height();
@@ -1648,7 +1654,7 @@
 		if (retg == 0)
 		{
 			m_image.load(tmpFile);
-			if (extensionIndicatesEPS(ext) && BBoxInTrailer)
+			if ((extensionIndicatesEPS(ext) && BBoxInTrailer) || (isRotated))
 			{
 				int ex = qRound(x * gsRes / 72.0);
 				int ey = qRound(m_image.height() - h);
@@ -1656,7 +1662,7 @@
 				int eh = qRound(h - y * gsRes / 72.0);
 				m_image = m_image.copy(ex, ey, ew, eh);
 			}
-			if (!ScCore->havePNGAlpha())
+			if ((!ScCore->havePNGAlpha()) || (isRotated))
 			{
 				int wi = m_image.width();
 				int hi = m_image.height();
@@ -1682,6 +1688,10 @@
 
 			hasAlpha = true;
 			m_imageInfoRecord.actualPageNumber = page;
+			m_imageInfoRecord.type = ImageTypeEPS;
+			m_imageInfoRecord.colorspace = ColorSpaceRGB;
+			m_image.setDotsPerMeterX ((int) (xres / 0.0254));
+			m_image.setDotsPerMeterY ((int) (yres / 0.0254));
 			return true;
 		}
 		else
Index: scribus/scimgdataloader_ps.h
===================================================================
--- scribus/scimgdataloader_ps.h	(revision 14257)
+++ scribus/scimgdataloader_ps.h	(revision 14258)
@@ -44,6 +44,7 @@
 	bool hasThumbnail;
 	bool inTrailer;
 	bool BBoxInTrailer;
+	bool isRotated;
 	int psXSize;
 	int psYSize;
 	int psDepth;




More information about the scribus-commit mailing list