Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 18202 → Rev 18203

/trunk/Scribus/scribus/pageitem_osgframe.cpp
108,12 → 108,15
}
else
{
tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_osg_XXXXXX.png");
tempImageFile->open();
QString imgName = getLongPathName(tempImageFile->fileName());
tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_osg_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString imgName = getLongPathName(tempFile->fileName());
tempFile->close();
image.save(imgName, "PNG");
m_Doc->loadPict(imgName, this);
delete tempFile;
isTempFile = true;
}
setImageScalingMode(false, true);
}
/trunk/Scribus/scribus/scribusdoc.cpp
5796,10 → 5796,10
if ((ScCore->fileWatcher->files().contains(pageItem->Pfile) != 0) && (pageItem->PictureIsAvailable))
{
ScCore->fileWatcher->removeFile(pageItem->Pfile);
if (pageItem->tempImageFile != NULL)
delete pageItem->tempImageFile;
pageItem->tempImageFile = NULL;
QFile::remove(pageItem->Pfile);
pageItem->Pfile = "";
pageItem->isInlineImage = false;
pageItem->isTempFile = false;
}
}
if(!pageItem->loadImage(fn, reload, -1, showMsg))
/trunk/Scribus/scribus/pageitem.h
1378,7 → 1378,7
 
/** Inline Image */
bool isInlineImage;
QTemporaryFile *tempImageFile;
bool isTempFile;
//items welding (item follows while item moves which they are connected with)
struct weldingInfo
{
/trunk/Scribus/scribus/pageitem.cpp
347,18 → 347,21
{
QFileInfo inlFi(Pfile);
QString ext = inlFi.suffix();
tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + ext);
tempImageFile->open();
QString fileName = getLongPathName(tempImageFile->fileName());
tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + ext);
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
copyFile(Pfile, fileName);
Pfile = fileName;
delete tempFile;
isInlineImage = true;
isTempFile = true;
}
else
{
tempImageFile = NULL;
isInlineImage = false;
isTempFile = false;
}
Parent = NULL;
unWeld();
822,14 → 825,14
)
pageItemAttributes.append(*objAttrIt);
}
tempImageFile = NULL;
isInlineImage = false;
isTempFile = false;
}
 
PageItem::~PageItem()
{
if (tempImageFile != NULL)
delete tempImageFile;
if ((isTempFile) && (!Pfile.isEmpty()))
QFile::remove(Pfile);
//remove marks
 
if (isTextFrame())
10220,10 → 10223,11
inlineImageData.append(data);
if (inlineImageData.size() > 0)
{
tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineExt);
tempImageFile->open();
QString fileName = getLongPathName(tempImageFile->fileName());
tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineExt);
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
inlineImageData = qUncompress(QByteArray::fromBase64(inlineImageData));
QFile outFil(fileName);
if (outFil.open(QIODevice::WriteOnly))
10231,7 → 10235,9
outFil.write(inlineImageData);
outFil.close();
isInlineImage = true;
isTempFile = true;
Pfile = fileName;
delete tempFile;
}
}
}
10240,24 → 10246,28
{
QFileInfo fi(Pfile);
QString ext = fi.suffix();
tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + ext);
tempImageFile->open();
QString fileName = getLongPathName(tempImageFile->fileName());
tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + ext);
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
isInlineImage = true;
isTempFile = true;
copyFile(Pfile, fileName);
Pfile = fileName;
delete tempFile;
}
 
void PageItem::makeImageExternal(QString path)
{
if ((tempImageFile) && (isInlineImage) && (!path.isEmpty()))
if ((isTempFile) && (isInlineImage) && (!path.isEmpty()))
{
QString oldF = Pfile;
copyFile(Pfile, path);
Pfile = path;
QFile::remove(oldF);
isInlineImage = false;
delete tempImageFile;
tempImageFile = NULL;
isTempFile = false;
}
}
 
/trunk/Scribus/scribus/pageitem_imageframe.cpp
246,9 → 246,9
setFillTransparency(0.0);
setLineTransparency(0.0);
imageClip.resize(0);
if (tempImageFile != NULL)
delete tempImageFile;
tempImageFile = NULL;
if ((isTempFile) && (!Pfile.isEmpty()))
QFile::remove(Pfile);
isTempFile = false;
isInlineImage = false;
// emit UpdtObj(Doc->currentPage->pageNr(), ItemNr);
}
/trunk/Scribus/scribus/scribus.cpp
4482,11 → 4482,14
currItem->IRender = doc->cmsSettings().DefaultIntentImages;
qApp->setOverrideCursor( QCursor(Qt::WaitCursor) );
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
currItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX.png");
currItem->tempImageFile->open();
QString fileName = getLongPathName(currItem->tempImageFile->fileName());
currItem->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
currItem->isInlineImage = true;
currItem->isTempFile = true;
currItem->Pfile = fileName;
img.save(fileName, "PNG");
doc->loadPict(fileName, currItem, false, true);
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
4440,10 → 4440,11
{
if (inlineImageData.size() > 0)
{
currItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineImageExt);
currItem->tempImageFile->open();
QString fileName = getLongPathName(currItem->tempImageFile->fileName());
currItem->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineImageExt);
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
inlineImageData = qUncompress(QByteArray::fromBase64(inlineImageData));
QFile outFil(fileName);
if (outFil.open(QIODevice::WriteOnly))
4452,7 → 4453,9
outFil.close();
currItem->isInlineImage = true;
currItem->Pfile = fileName;
currItem->isTempFile = true;
}
delete tempFile;
}
}
else
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
2499,10 → 2499,11
{
if (inlineImageData.size() > 0)
{
currItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineImageExt);
currItem->tempImageFile->open();
QString fileName = getLongPathName(currItem->tempImageFile->fileName());
currItem->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_XXXXXX." + inlineImageExt);
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
inlineImageData = qUncompress(QByteArray::fromBase64(inlineImageData));
QFile outFil(fileName);
if (outFil.open(QIODevice::WriteOnly))
2511,7 → 2512,9
outFil.close();
currItem->isInlineImage = true;
currItem->Pfile = fileName;
currItem->isTempFile = true;
}
delete tempFile;
}
}
else
/trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
2279,15 → 2279,17
imgExt = "psd";
else if (imageType.contains("TIFF", Qt::CaseInsensitive))
imgExt = "tif";
item->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_idml_XXXXXX." + imgExt);
if (item->tempImageFile->open())
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_idml_XXXXXX." + imgExt);
tempFile->setAutoRemove(false);
if (tempFile->open())
{
QString fileName = getLongPathName(item->tempImageFile->fileName());
QString fileName = getLongPathName(tempFile->fileName());
if (!fileName.isEmpty())
{
item->tempImageFile->write(imageData);
item->tempImageFile->close();
tempFile->write(imageData);
tempFile->close();
item->isInlineImage = true;
item->isTempFile = true;
item->ScaleType = true;
item->AspectRatio = true;
m_Doc->loadPict(fileName, item);
2296,6 → 2298,7
item->setImageRotation(-roti);
}
}
delete tempFile;
}
else
{
/trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
1010,11 → 1010,13
image = image.convertToFormat(QImage::Format_ARGB32);
int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, baseX, baseY, image.width() * resX, image.height() * resY, 0, m_Doc->itemToolPrefs().imageFillColor, CommonStrings::None, true);
PageItem *ite = m_Doc->Items->at(z);
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
image.save(fileName, "PNG");
ite->moveBy(m_Doc->currentPage()->xOffset(), m_Doc->currentPage()->yOffset());
ite->moveBy(offsetX, offsetY);
1021,6 → 1023,7
finishItem(ite);
m_Doc->loadPict(fileName, ite);
ite->setImageScalingMode(false, false);
delete tempFile;
}
// qDebug() << "End of Pict";
return;
1846,11 → 1849,14
image.invertPixels();
int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, baseX + dstRect.left() * resX, baseY + dstRect.top() * resY, imgCols * resY, imgRows * resY, 0, m_Doc->itemToolPrefs().imageFillColor, m_Doc->itemToolPrefs().imageStrokeColor, true);
PageItem *ite = m_Doc->Items->at(z);
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
ite->isInlineImage = true;
ite->isTempFile = true;
image.save(fileName, "PNG");
ite->moveBy(baseX, baseY);
ite->moveBy(offsetX, offsetY);
2184,11 → 2190,14
ScPattern pat = ScPattern();
pat.setDoc(m_Doc);
PageItem* newItem = new PageItem_ImageFrame(m_Doc, 0, 0, 1, 1, 0, CommonStrings::None, CommonStrings::None);
newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
newItem->tempImageFile->open();
QString fileName = getLongPathName(newItem->tempImageFile->fileName());
newItem->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pct_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
newItem->isInlineImage = true;
newItem->isTempFile = true;
image.setDotsPerMeterY(2834);
image.setDotsPerMeterX(2834);
image.save(fileName, "PNG");
/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
1445,13 → 1445,16
ite->setWidthHeight(wh.x(),wh.y());
ite->setTextFlowMode(PageItem::TextFlowDisabled);
m_Doc->AdjustItemSize(ite);
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_ai_XXXXXX.pdf");
ite->tempImageFile->open();
ite->tempImageFile->write(fData);
QString imgName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_ai_XXXXXX.pdf");
tempFile->setAutoRemove(false);
tempFile->open();
tempFile->write(fData);
QString imgName = getLongPathName(tempFile->fileName());
tempFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
m_Doc->loadPict(imgName, ite);
delete tempFile;
if (ite->PictureIsAvailable)
ite->setImageXYScale(ite->width() / ite->pixm.width(), ite->height() / ite->pixm.height());
ite->setImageFlippedV(true);
3048,11 → 3051,14
uchar *p;
uint yCount = 0;
quint16 eTag = EXTRASAMPLE_UNASSALPHA;
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_ai_XXXXXX.tif");
ite->tempImageFile->open();
QString imgName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_ai_XXXXXX.tif");
tempFile->setAutoRemove(false);
tempFile->open();
QString imgName = getLongPathName(tempFile->fileName());
tempFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
delete tempFile;
TIFF* tif = TIFFOpen(imgName.toLocal8Bit().data(), "w");
if (tif)
{
/trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
1834,10 → 1834,13
ScPattern pat = ScPattern();
pat.setDoc(m_Doc);
PageItem* newItem = new PageItem_ImageFrame(m_Doc, 0, 0, 1, 1, 0, CommonStrings::None, CommonStrings::None);
newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
newItem->tempImageFile->open();
QString fileName = getLongPathName(newItem->tempImageFile->fileName());
newItem->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
newItem->isTempFile = true;
newItem->isInlineImage = true;
image.setDotsPerMeterY(2834);
image.setDotsPerMeterX(2834);
2597,10 → 2600,13
ScPattern pat = ScPattern();
pat.setDoc(m_Doc);
PageItem* newItem = new PageItem_ImageFrame(m_Doc, 0, 0, 1, 1, 0, CommonStrings::None, CommonStrings::None);
newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
newItem->tempImageFile->open();
QString fileName = getLongPathName(newItem->tempImageFile->fileName());
newItem->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
newItem->isTempFile = true;
newItem->isInlineImage = true;
image.setDotsPerMeterY(2834);
image.setDotsPerMeterX(2834);
2684,10 → 2690,13
QString imgNam = m_Doc->docPatterns[patternRef[bref]].items.at(0)->externalFile();
QImage image;
image.load(imgNam);
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
ite->isTempFile = true;
ite->isInlineImage = true;
image.save(fileName, "PNG");
m_Doc->loadPict(fileName, ite);
2748,10 → 2757,13
ScPattern pat = ScPattern();
pat.setDoc(m_Doc);
PageItem* newItem = new PageItem_ImageFrame(m_Doc, 0, 0, 1, 1, 0, CommonStrings::None, CommonStrings::None);
newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
newItem->tempImageFile->open();
QString fileName = getLongPathName(newItem->tempImageFile->fileName());
newItem->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_xar_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
newItem->isTempFile = true;
newItem->isInlineImage = true;
image.setDotsPerMeterY(2834);
image.setDotsPerMeterX(2834);
/trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
904,13 → 904,16
{
if (currentItem != NULL)
{
currentItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_drw_XXXXXX.png");
currentItem->tempImageFile->open();
QString fileName = getLongPathName(currentItem->tempImageFile->fileName());
currentItem->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_drw_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
currentItem->isInlineImage = true;
currentItem->isTempFile = true;
tmpImage.save(fileName, "PNG");
m_Doc->loadPict(fileName, currentItem);
delete tempFile;
currentItem->setImageScalingMode(false, false);
}
imageValid = false;
965,7 → 968,7
{
if (currentItem->asImageFrame())
{
QString fileName = getLongPathName(currentItem->tempImageFile->fileName());
QString fileName = currentItem->Pfile;
if (!fileName.isEmpty())
{
QVector<QRgb> colors;
1873,11 → 1876,14
ScPattern pat = ScPattern();
pat.setDoc(m_Doc);
PageItem* newItem = new PageItem_ImageFrame(m_Doc, 0, 0, 1, 1, 0, CommonStrings::None, CommonStrings::None);
newItem->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_drw_XXXXXX.png");
newItem->tempImageFile->open();
QString fileName = getLongPathName(newItem->tempImageFile->fileName());
newItem->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_drw_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
newItem->isInlineImage = true;
newItem->isTempFile = true;
image.setDotsPerMeterY(2834);
image.setDotsPerMeterX(2834);
image.save(fileName, "PNG");
/trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
395,10 → 395,13
double h = (bitmap.rect.y2 - bitmap.rect.y1) * 72.0;
int z = m_Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, bitmap.rect.x1 * 72 + baseX, bitmap.rect.y1 * 72 + baseY, w, h, 1, m_Doc->itemToolPrefs().imageFillColor, m_Doc->itemToolPrefs().imageStrokeColor, true);
PageItem *ite = m_Doc->Items->at(z);
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_wpg_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_wpg_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
ite->isTempFile = true;
ite->isInlineImage = true;
image.setDotsPerMeterX ((int) (hres / 0.0254));
image.setDotsPerMeterY ((int) (vres / 0.0254));
/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
1530,10 → 1530,13
ba.append(fname);
if (dataType.contains("base64"))
ba = QByteArray::fromBase64(ba);
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_svg_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_svg_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
delete tempFile;
ite->isTempFile = true;
ite->isInlineImage = true;
QImage img;
img.loadFromData(ba);
/trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
1562,15 → 1562,18
istr.skipRawData(1);
}
}
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_cgm_XXXXXX.png");
ite->tempImageFile->open();
QString fileName = getLongPathName(ite->tempImageFile->fileName());
ite->tempImageFile->close();
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_cgm_XXXXXX.png");
tempFile->setAutoRemove(false);
tempFile->open();
QString fileName = getLongPathName(tempFile->fileName());
tempFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
image.save(fileName, "PNG");
if ((image.width() < 20) || image.height() < 20)
ite->pixm.imgInfo.lowResType = 0;
m_Doc->loadPict(fileName, ite);
delete tempFile;
ite->setImageFlippedH(flipX);
ite->setImageFlippedV(flipY);
ite->setImageScalingMode(false, false);
2392,14 → 2395,16
m_Doc->AdjustItemSize(ite);
ite->OldB2 = ite->width();
ite->OldH2 = ite->height();
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_cgm_XXXXXX.png");
if (ite->tempImageFile->open())
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_cgm_XXXXXX.png");
tempFile->setAutoRemove(false);
if (tempFile->open())
{
QString fileName = getLongPathName(ite->tempImageFile->fileName());
QString fileName = getLongPathName(tempFile->fileName());
if (!fileName.isEmpty())
{
ite->tempImageFile->close();
tempFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
tmpImg.save(fileName, "PNG");
m_Doc->loadPict(fileName, ite);
ite->setImageScalingMode(false, true);
2430,6 → 2435,7
m_Doc->Items->removeAll(ite);
delete ite;
}
delete tempFile;
colorPrecision = t_colorPrecision;
// qDebug() << "PATTERN TABLE" << "Index" << index << "NX" << nx << "NY" << ny;
}
/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
2412,14 → 2412,16
ite->setFillShade(100);
ite->setLineShade(100);
ite->setFillEvenOdd(false);
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
if (ite->tempImageFile->open())
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
tempFile->setAutoRemove(false);
if (tempFile->open())
{
QString fileName = getLongPathName(ite->tempImageFile->fileName());
QString fileName = getLongPathName(tempFile->fileName());
if (!fileName.isEmpty())
{
ite->tempImageFile->close();
tempFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
res.save(fileName, "PNG");
m_doc->loadPict(fileName, ite);
ite->setImageScalingMode(false, true);
2437,6 → 2439,7
else
m_doc->Items->removeAll(ite);
imgStr->close();
delete tempFile;
delete imgStr;
delete image;
}
2536,14 → 2539,16
ite->setFillEvenOdd(false);
ite->setFillTransparency(1.0 - state->getFillOpacity());
ite->setFillBlendmode(getBlendMode(state));
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
if (ite->tempImageFile->open())
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
tempFile->setAutoRemove(false);
if (tempFile->open())
{
QString fileName = getLongPathName(ite->tempImageFile->fileName());
QString fileName = getLongPathName(tempFile->fileName());
if (!fileName.isEmpty())
{
ite->tempImageFile->close();
tempFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
res.save(fileName, "PNG");
m_doc->loadPict(fileName, ite);
ite->setImageScalingMode(false, true);
2560,6 → 2565,7
}
else
m_doc->Items->removeAll(ite);
delete tempFile;
delete imgStr;
delete[] buffer;
delete image;
2651,14 → 2657,16
ite->setFillEvenOdd(false);
ite->setFillTransparency(1.0 - state->getFillOpacity());
ite->setFillBlendmode(getBlendMode(state));
ite->tempImageFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
if (ite->tempImageFile->open())
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
tempFile->setAutoRemove(false);
if (tempFile->open())
{
QString fileName = getLongPathName(ite->tempImageFile->fileName());
QString fileName = getLongPathName(tempFile->fileName());
if (!fileName.isEmpty())
{
ite->tempImageFile->close();
tempFile->close();
ite->isInlineImage = true;
ite->isTempFile = true;
img.save(fileName, "PNG");
m_doc->loadPict(fileName, ite);
ite->setImageScalingMode(false, true);
2675,6 → 2683,7
}
else
m_doc->Items->removeAll(ite);
delete tempFile;
delete imgStr;
delete[] buffer;
delete image;