/branches/Version13x/Scribus/scribus/scimgdataloader.h |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#ifndef SCIMGDATALOADER_H |
#define SCIMGDATALOADER_H |
20,6 → 26,14 |
QByteArray m_embeddedProfile; |
int m_profileComponents; |
typedef enum { |
noMsg = 0, |
warningMsg = 1, |
errorMsg = 2 |
} MsgType; |
MsgType m_msgType; |
QString m_message; |
void swapRGBA(void); |
QString getPascalString(QDataStream & s); |
35,6 → 49,10 |
QByteArray& embeddedProfile(void) { return m_embeddedProfile; } |
ImageInfoRecord& imageInfoRecord(void) { return m_imageInfoRecord; } |
bool issuedErrorMsg(void) const { return (m_msgType == errorMsg); } |
bool issuedWarningMsg(void) const { return (m_msgType == warningMsg); } |
const QString& getMessage(void) const { return m_message; } |
virtual void initialize(void); |
virtual void preloadAlphaChannel(const QString& fn, int res) = 0; |
/branches/Version13x/Scribus/scribus/scimgdataloader.cpp |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#include "scimgdataloader.h" |
ScImgDataLoader::ScImgDataLoader(void) |
7,6 → 13,8 |
void ScImgDataLoader::initialize(void) |
{ |
m_msgType = noMsg; |
m_message.setLength(0); |
m_image = QImage(); |
m_imageInfoRecord.init(); |
m_embeddedProfile.resize(0); |
/branches/Version13x/Scribus/scribus/scimgdataloader_pdf.cpp |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#include <qfile.h> |
#include <qfileinfo.h> |
#include "gsutil.h" |
/branches/Version13x/Scribus/scribus/scimgdataloader_tiff.h |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#ifndef SCIMGDATALOADER_TIFF_H |
#define SCIMGDATALOADER_TIFF_H |
/branches/Version13x/Scribus/scribus/scimgdataloader_psd.cpp |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#include "scconfig.h" |
#include "scimgdataloader_psd.h" |
#include "util.h" |
/branches/Version13x/Scribus/scribus/pageitem.cpp |
---|
3110,7 → 3110,7 |
return transRect.contains(x, y); |
} |
bool PageItem::loadImage(const QString& filename, const bool reload, const int gsResolution) |
bool PageItem::loadImage(const QString& filename, const bool reload, const int gsResolution, bool showMsg) |
{ |
if (! asImageFrame()) |
return false; |
3127,7 → 3127,7 |
gsRes=PrefsManager::instance()->gsResolution(); |
bool dummy; |
CMSettings cms(m_Doc, IProfile, IRender); |
if (!pixm.LoadPicture(filename, cms, UseEmbedded, true, ScImage::RGBProof, gsRes, &dummy)) |
if (!pixm.LoadPicture(filename, cms, UseEmbedded, true, ScImage::RGBProof, gsRes, &dummy, showMsg)) |
{ |
Pfile = fi.absFilePath(); |
PicAvail = false; |
/branches/Version13x/Scribus/scribus/scimgdataloader_ps.h |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#ifndef SCIMGDATALOADER_PS_H |
#define SCIMGDATALOADER_PS_H |
/branches/Version13x/Scribus/scribus/scribus.cpp |
---|
3807,7 → 3807,7 |
currItem->IRender = doc->CMSSettings.DefaultIntentImages; |
qApp->setOverrideCursor( QCursor(Qt::WaitCursor) ); |
qApp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput); |
doc->LoadPict(fileName, currItem->ItemNr); |
doc->LoadPict(fileName, currItem->ItemNr, false, true); |
//view->AdjustPictScale(currItem, false); |
//false was ignored anyway |
currItem->AdjustPictScale(); |
/branches/Version13x/Scribus/scribus/scimage.h |
---|
112,7 → 112,7 |
// Load an image into this ScImage instance |
// TODO: document params, split into smaller functions |
bool LoadPicture(const QString & fn, const CMSettings& cmSettings, bool useEmbedded, bool useProf, RequestType requestType, int gsRes, bool *realCMYK = 0); |
bool LoadPicture(const QString & fn, const CMSettings& cmSettings, bool useEmbedded, bool useProf, RequestType requestType, int gsRes, bool *realCMYK = 0, bool showMsg = false); |
ImageInfoRecord imgInfo; |
/branches/Version13x/Scribus/scribus/scimgdataloader_ps.cpp |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#include <qfile.h> |
#include <qfileinfo.h> |
#include "gsutil.h" |
/branches/Version13x/Scribus/scribus/scimgdataloader_qt.h |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#ifndef SCIMGDATALOADER_QT_H |
#define SCIMGDATALOADER_QT_H |
/branches/Version13x/Scribus/scribus/scimgdataloader_jpeg.h |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#ifndef SCIMGDATALOADER_JPEG_H |
#define SCIMGDATALOADER_JPEG_H |
/branches/Version13x/Scribus/scribus/scimgdataloader_pdf.h |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#ifndef SCIMGDATALOADER_PDF_H |
#define SCIMGDATALOADER_PDF_H |
/branches/Version13x/Scribus/scribus/scribusdoc.cpp |
---|
2905,12 → 2905,12 |
automaticTextFrames=atf; |
} |
bool ScribusDoc::LoadPict(QString fn, int ItNr, bool reload) |
bool ScribusDoc::LoadPict(QString fn, int ItNr, bool reload, bool showMsg ) |
{ |
return loadPict(fn, Items->at(ItNr), reload); |
return loadPict(fn, Items->at(ItNr), reload, showMsg); |
} |
bool ScribusDoc::loadPict(QString fn, PageItem *pageItem, bool reload) |
bool ScribusDoc::loadPict(QString fn, PageItem *pageItem, bool reload, bool showMsg) |
{ |
if (!reload) |
{ |
2917,7 → 2917,7 |
if ((ScCore->fileWatcher->files().contains(pageItem->Pfile) != 0) && (pageItem->PicAvail)) |
ScCore->fileWatcher->removeFile(pageItem->Pfile); |
} |
if(!pageItem->loadImage(fn, reload)) |
if(!pageItem->loadImage(fn, reload, -1, showMsg)) |
return false; |
if (!reload) |
ScCore->fileWatcher->addFile(pageItem->Pfile); |
/branches/Version13x/Scribus/scribus/scimgdataloader_tiff.cpp |
---|
1,5 → 1,12 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#include <qfile.h> |
#include <qfileinfo.h> |
#include <qobject.h> |
#include "scconfig.h" |
#include "scimgdataloader_tiff.h" |
158,8 → 165,8 |
{ |
xres = yres = 72.0; |
QFileInfo qfi(fn); |
QCString fname = qfi.fileName().local8Bit(); |
qWarning("Warning: %s may be corrupted", fname.data()); |
m_message = QObject::tr("%1 may be corrupted : missing resolution tags").arg(qfi.fileName()); |
m_msgType = warningMsg; |
} |
if (!m_image.create(widtht,heightt,32)) |
/branches/Version13x/Scribus/scribus/scimgdataloader_qt.cpp |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#include <qfile.h> |
#include <qfileinfo.h> |
#include "scimgdataloader_qt.h" |
/branches/Version13x/Scribus/scribus/scimagestructs.cpp |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#include "scimagestructs.h" |
ExifValues::ExifValues(void) |
/branches/Version13x/Scribus/scribus/pageitem.h |
---|
813,7 → 813,7 |
* @brief Load an image into an image frame, moved from ScribusView |
* @return True if load succeeded |
*/ |
bool loadImage(const QString& filename, const bool reload, const int gsResolution=-1); |
bool loadImage(const QString& filename, const bool reload, const int gsResolution=-1, bool showMsg = false); |
/** |
/branches/Version13x/Scribus/scribus/scribusdoc.h |
---|
496,7 → 496,7 |
* @brief Load images into an image frame, moved from the view |
* @retval Return false on failure |
*/ |
bool LoadPict(QString fn, int ItNr, bool reload = false); |
bool LoadPict(QString fn, int ItNr, bool reload = false, bool showMsg = false); |
/** |
* |
* @param fn |
504,7 → 504,7 |
* @param reload |
* @return |
*/ |
bool loadPict(QString fn, PageItem *pageItem, bool reload = false); |
bool loadPict(QString fn, PageItem *pageItem, bool reload = false, bool showMsg = false); |
/** |
* \brief Handle image with color profiles |
* @param Pr profile |
/branches/Version13x/Scribus/scribus/scimage.cpp |
---|
15,6 → 15,7 |
#include "scimgdataloader_pdf.h" |
#include "scimgdataloader_qt.h" |
#include "scimgdataloader_tiff.h" |
#include <qmessagebox.h> |
#include <qtextstream.h> |
#include <memory> |
#include <cassert> |
1374,8 → 1375,8 |
} |
bool ScImage::LoadPicture(const QString & fn, const CMSettings& cmSettings, |
bool useEmbedded, bool useProf, |
RequestType requestType, int gsRes, bool *realCMYK) |
bool useEmbedded, bool useProf, RequestType requestType, |
int gsRes, bool *realCMYK, bool showMsg) |
{ |
// requestType - 0: CMYK, 1: RGB, 2: RGB Proof 3 : RawData, 4: Thumbnail |
// gsRes - is the resolution that ghostscript will render at |
1437,7 → 1438,18 |
pDataLoader->image() = QImage(); |
} |
else |
{ |
if (ScCore->usingGUI() && pDataLoader->issuedErrorMsg() && showMsg) |
{ |
QMessageBox::critical(ScCore->primaryMainWindow(), CommonStrings::trWarning, pDataLoader->getMessage(), 1, 0, 0); |
} |
else if (pDataLoader->issuedErrorMsg()) |
{ |
QString msg = pDataLoader->getMessage(); |
qWarning( msg.local8Bit().data() ); |
} |
return false; |
} |
if (isNull()) |
return ret; |
1627,5 → 1639,14 |
setDotsPerMeterY (QMAX(2834, (int) (yres / 0.0254))); |
imgInfo.xres = QMAX(72, qRound(xres)); |
imgInfo.yres = QMAX(72, qRound(yres)); */ |
if (ScCore->usingGUI() && pDataLoader->issuedWarningMsg() && showMsg) |
{ |
QMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, pDataLoader->getMessage(), 1, 0, 0); |
} |
else if (pDataLoader->issuedErrorMsg()) |
{ |
QString msg = pDataLoader->getMessage(); |
qWarning( msg.local8Bit().data() ); |
} |
return true; |
} |
/branches/Version13x/Scribus/scribus/scimgdataloader_jpeg.cpp |
---|
1,5 → 1,12 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#include <qfile.h> |
#include <qfileinfo.h> |
#include <qobject.h> |
#include <setjmp.h> |
#include "scconfig.h" |
#include "scimgdataloader_jpeg.h" |
161,8 → 168,8 |
{ |
xres = yres = 72.0; |
QFileInfo qfi(fn); |
QCString fname = qfi.fileName().local8Bit(); |
qWarning("Warning: %s may be corrupted", fname.data()); |
m_message = QObject::tr("%1 may be corrupted : missing resolution tags").arg(qfi.fileName()); |
m_msgType = warningMsg; |
} |
m_imageInfoRecord.xres = qRound(xres); |
m_imageInfoRecord.yres = qRound(yres); |
228,8 → 235,8 |
{ |
xres = yres = 72.0; |
QFileInfo qfi(fn); |
QCString fname = qfi.fileName().local8Bit(); |
qWarning("Warning: %s may be corrupted", fname.data()); |
m_message = QObject::tr("%1 may be corrupted : missing resolution tags").arg(qfi.fileName()); |
m_msgType = warningMsg; |
} |
m_imageInfoRecord.xres = qRound(xres); |
m_imageInfoRecord.yres = qRound(yres); |
/branches/Version13x/Scribus/scribus/scimgdataloader_psd.h |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#ifndef SCIMGDATALOADER_PSD_H |
#define SCIMGDATALOADER_PSD_H |
/branches/Version13x/Scribus/scribus/scimagestructs.h |
---|
1,3 → 1,9 |
/* |
For general Scribus (>=1.3.2) copyright and licensing information please refer |
to the COPYING file provided with the program. Following this notice may exist |
a copyright and/or license notice that predates the release of Scribus 1.3.2 |
for which a new license (GPL+exception) is in place. |
*/ |
#ifndef SCIMAGESTRUCTS_H |
#define SCIMAGESTRUCTS_H |