r22460 by jghali - #15235: Page thumbnail background is black in exported PDFs
scribus-commit
scribus-commit at lists.scribus.net
Fri Mar 30 17:43:26 UTC 2018
Author: jghali
Date: Fri Mar 30 17:43:26 2018
New Revision: 22460
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22460
Log:
#15235: Page thumbnail background is black in exported PDFs
Modified:
trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusstructs.h
trunk/Scribus/scribus/scribusview.cpp
Modified: trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22460&path=/trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp Fri Mar 30 17:43:26 2018
@@ -1480,14 +1480,17 @@
pdfOptions.UseProfiles2 = false;
}
}
+
QMap<int, QImage> thumbs;
+ PageToPixmapFlags pixmapFlags = Pixmap_DontReloadImages | Pixmap_DrawWhiteBackground;
for (uint ap = 0; ap < pageNs.size(); ++ap)
{
QImage thumb(10, 10, QImage::Format_ARGB32_Premultiplied );
if (pdfOptions.Thumbnails)
- thumb = ScCore->primaryMainWindow()->view->PageToPixmap(pageNs[ap]-1, 100);
+ thumb = ScCore->primaryMainWindow()->view->PageToPixmap(pageNs[ap]-1, 100, pixmapFlags);
thumbs.insert(pageNs[ap], thumb);
}
+
ReOrderText(ScCore->primaryMainWindow()->doc, ScCore->primaryMainWindow()->view);
MarginStruct optBleeds(pdfOptions.bleeds);
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22460&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Fri Mar 30 17:43:26 2018
@@ -7253,7 +7253,7 @@
if (doc->pdfOptions().Thumbnails)
{
// No need to load full res images for drawing small thumbnail
- PageToPixmapFlags flags = Pixmap_DontReloadImages;
+ PageToPixmapFlags flags = Pixmap_DontReloadImages | Pixmap_DrawWhiteBackground;
thumb = view->PageToPixmap(pageNs[i] - 1, 100, flags);
}
allThumbs.insert(pageNs[i], thumb);
Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22460&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h (original)
+++ trunk/Scribus/scribus/scribusstructs.h Fri Mar 30 17:43:26 2018
@@ -330,7 +330,8 @@
Pixmap_NoFlags = 0,
Pixmap_DrawFrame = 1 << 0,
Pixmap_DrawBackground = 1 << 1,
- Pixmap_DontReloadImages = 1 << 2,
+ Pixmap_DrawWhiteBackground = 1 << 2,
+ Pixmap_DontReloadImages = 1 << 3,
};
Q_DECLARE_FLAGS(PageToPixmapFlags, PageToPixmapFlag);
Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22460&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Fri Mar 30 17:43:26 2018
@@ -2782,6 +2782,8 @@
ScPainter *painter = new ScPainter(&im, im.width(), im.height(), 1.0, 0);
if (flags & Pixmap_DrawBackground)
painter->clear(Doc->paperColor());
+ else if (flags & Pixmap_DrawWhiteBackground)
+ painter->clear(QColor(255, 255, 255));
painter->translate(-clipx, -clipy);
painter->setFillMode(ScPainter::Solid);
if (flags & Pixmap_DrawFrame)
More information about the scribus-commit
mailing list