Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 5977 → Rev 5978

/branches/Version133x/Scribus/scribus/scimage.h
107,7 → 107,7
 
// Load an image into this ScImage instance
// TODO: document params, split into smaller functions
bool LoadPicture(const QString & fn, const QString & Prof, int rend, bool useEmbedded, bool useProf, int requestType, int gsRes, bool *realCMYK = 0);
bool LoadPicture(const QString & fn, const QString & Prof, int rend, bool useEmbedded, bool useProf, int requestType, int gsRes, bool *realCMYK = 0, bool showMsg = false);
 
struct PSDLayer
{
/branches/Version133x/Scribus/scribus/scribusdoc.cpp
2467,12 → 2467,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)
{
2479,7 → 2479,7
if ((ScMW->fileWatcher->files().contains(pageItem->Pfile) != 0) && (pageItem->PicAvail))
ScMW->fileWatcher->removeFile(pageItem->Pfile);
}
if(!pageItem->loadImage(fn, reload))
if(!pageItem->loadImage(fn, reload, -1, showMsg))
return false;
if (!reload)
ScMW->fileWatcher->addFile(pageItem->Pfile);
/branches/Version133x/Scribus/scribus/pageitem.h
906,7 → 906,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/Version133x/Scribus/scribus/pageitem.cpp
3347,7 → 3347,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;
3363,7 → 3363,7
if (gsResolution==-1) //If it wasn't supplied, get it from PrefsManager.
gsRes=PrefsManager::instance()->gsResolution();
bool dummy;
if (!pixm.LoadPicture(filename, IProfile, IRender, UseEmbedded, true, 2, gsRes, &dummy))
if (!pixm.LoadPicture(filename, IProfile, IRender, UseEmbedded, true, 2, gsRes, &dummy, showMsg))
{
Pfile = fi.absFilePath();
PicAvail = false;
/branches/Version133x/Scribus/scribus/scribusdoc.h
416,7 → 416,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
424,7 → 424,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/Version133x/Scribus/scribus/scimage.cpp
6,6 → 6,7
*/
#include "scimage.h"
#include "scribus.h"
#include "scribusapp.h"
#include <qtextstream.h>
#include <cassert>
#ifdef HAVE_CMS
3376,7 → 3377,8
 
bool ScImage::LoadPicture(const QString & fn, const QString & Prof,
int rend, bool useEmbedded, bool useProf,
int requestType, int gsRes, bool *realCMYK)
int 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
3403,6 → 3405,7
double x, y, b, h;
bool found = false;
int retg = -1;
QString message;
QString tmpFile = QDir::convertSeparators(QDir::homeDirPath()+"/.scribus/sc.png");
QString picFile = QDir::convertSeparators(fn);
if (ext == "pdf")
3593,8 → 3596,7
{
xres = yres = 72.0;
QFileInfo qfi(fn);
QCString fname = qfi.fileName().local8Bit();
qWarning("Warning: %s may be corrupted", fname.data());
message = QObject::tr("%1 may be corrupted : missing resolution tags").arg(qfi.fileName());
}
 
if (!create(widtht,heightt,32))
3891,8 → 3893,7
{
xres = yres = 72.0;
QFileInfo qfi(fn);
QCString fname = qfi.fileName().local8Bit();
qWarning("Warning: %s may be corrupted", fname.data());
message = QObject::tr("%1 may be corrupted : missing resolution tags").arg(qfi.fileName());
}
imgInfo.xres = qRound(xres);
imgInfo.yres = qRound(yres);
3964,8 → 3965,7
{
xres = yres = 72.0;
QFileInfo qfi(fn);
QCString fname = qfi.fileName().local8Bit();
qWarning("Warning: %s may be corrupted", fname.data());
message = QObject::tr("%1 may be corrupted : missing resolution tags").arg(qfi.fileName());
}
imgInfo.xres = qRound(xres);
imgInfo.yres = qRound(yres);
4303,5 → 4303,11
setDotsPerMeterY (QMAX(2834, (int) (yres / 0.0254)));
imgInfo.xres = QMAX(72, qRound(xres));
imgInfo.yres = QMAX(72, qRound(yres)); */
if (ScQApp->usingGUI() && !message.isEmpty() && showMsg)
{
QMessageBox::warning(ScMW, CommonStrings::trWarning, message, 1, 0, 0);
}
else if (!message.isEmpty())
qWarning( message.local8Bit().data() );
return true;
}
/branches/Version133x/Scribus/scribus/scribus.cpp
1180,7 → 1180,7
}
}
 
bool ScribusMainWindow::eventFilter( QObject */*o*/, QEvent *e )
bool ScribusMainWindow::eventFilter( QObject* /*o*/, QEvent *e )
{
bool retVal;
if ( e->type() == QEvent::KeyPress ) {
3719,7 → 3719,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();