r19878 by craig - #11994: Query GraphicsMagick for its supported file formats. We might need to exclude some either by format option from GM, or manually

scribus-commit scribus-commit at lists.scribus.net
Tue Feb 24 22:11:21 UTC 2015


Author: craig
Date: Tue Feb 24 22:11:21 2015
New Revision: 19878

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19878
Log:
#11994: Query GraphicsMagick for its supported file formats. We might need to exclude some either by format option from GM, or manually

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/scimage.cpp
    trunk/Scribus/scribus/util_formats.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19878&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Tue Feb 24 22:11:21 2015
@@ -948,6 +948,7 @@
 
 void PageItem::moveBy(const double dX, const double dY, bool drawingOnly)
 {
+	//qDebug()<<"pageitem::moveby"<<dX<<dY;;
 	if (dX==0.0 && dY==0.0)
 		return;
 	invalid = true;
@@ -10584,15 +10585,17 @@
 void PageItem::moveWelded(double dX, double dY, int weld)
 {
 	WeldingInfo wInf = weldList.at(weld);
-	PageItem *pIt = wInf.weldItem;
-	pIt->setXPos(pIt->xPos() + dX);
-	pIt->setYPos(pIt->yPos() + dY);
-	pIt->update();
-	pIt->moveWelded(dX, dY, this);
+	PageItem *item
+			= wInf.weldItem;
+	item->setXPos(item->xPos() + dX);
+	item->setYPos(item->yPos() + dY);
+	item->update();
+	item->moveWelded(dX, dY, this);
 }
 
 void PageItem::moveWelded(double dX, double dY, PageItem* except)
 {
+	//qDebug()<<"PageItem::moveWelded"<<dX<<dY;
 	if ((dX == 0) && (dY == 0))
 		return;
 	//do not save undo for auto-welded notes frames

Modified: trunk/Scribus/scribus/scimage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19878&path=/trunk/Scribus/scribus/scimage.cpp
==============================================================================
--- trunk/Scribus/scribus/scimage.cpp (original)
+++ trunk/Scribus/scribus/scimage.cpp Tue Feb 24 22:11:21 2015
@@ -2023,7 +2023,7 @@
 	else if (fmtImg.contains(ext))
 		pDataLoader.reset( new ScImgDataLoader_QT() );
 	else
-		pDataLoader .reset( new ScImgDataLoader_GMagick() );
+		pDataLoader.reset( new ScImgDataLoader_GMagick() );
 #else
 	else
 		pDataLoader.reset( new ScImgDataLoader_QT() );

Modified: trunk/Scribus/scribus/util_formats.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19878&path=/trunk/Scribus/scribus/util_formats.cpp
==============================================================================
--- trunk/Scribus/scribus/util_formats.cpp (original)
+++ trunk/Scribus/scribus/util_formats.cpp Tue Feb 24 22:11:21 2015
@@ -5,12 +5,19 @@
 for which a new license (GPL+exception) is in place.
 */
 
+#include <QDebug>
 #include <QImageReader>
 #include <QMapIterator>
 #include <QObject>
 
 #include "commonstrings.h"
 #include "util_formats.h"
+
+#ifdef GMAGICK_FOUND
+#include <magick/api.h>
+#include <magick/magick.h>
+#include <magick/symbols.h>
+#endif
 
 FormatsManager* FormatsManager::_instance = 0;
 
@@ -36,7 +43,23 @@
 	m_fmts.insert(FormatsManager::BMP,  QStringList() << "bmp");
 	m_fmts.insert(FormatsManager::ORA,  QStringList() << "ora");
 #ifdef GMAGICK_FOUND
-	m_fmts.insert(FormatsManager::GMAGICK, QStringList() << "xbm" << "tga" << "ptif" << "ppm" << "pnm" << "pgm" << "pcds" << "pcd" << "pbm" << "mng" << "ico" << "gif" << "fax" << "dpx" << "bmp" << "xcf");
+	QStringList gmagickformats;
+	InitializeMagick(0);
+	ExceptionInfo exception;
+	MagickInfo **magick_array;
+	magick_array=GetMagickInfoArray(&exception);
+	if (!magick_array)
+		return;
+	for (int i=0; magick_array[i] != 0; i++)
+	{
+		if (magick_array[i]->stealth)
+			continue;
+		gmagickformats<<QString(magick_array[i]->name).toLower();
+	}
+	MagickFreeMemory(magick_array);
+	//qDebug()<<gmagickformats;
+	m_fmts.insert(FormatsManager::GMAGICK, gmagickformats);
+	//QStringList() << "xbm" << "tga" << "ptif" << "ppm" << "pnm" << "pgm" << "pcds" << "pcd" << "pbm" << "mng" << "ico" << "gif" << "fax" << "dpx" << "bmp" << "xcf");
 #endif
 	m_fmts.insert(FormatsManager::UNICONV, QStringList() << "cdt" << "ccx" << "cmx" << "aff" << "sk" << "sk1" << "plt" << "dxf" << "dst" << "pes" << "exp" << "pcs");
 	m_fmts.insert(FormatsManager::PCT,  QStringList() << "pct" << "pic" << "pict");




More information about the scribus-commit mailing list