318{
319 QFileInfo originalInfo(
m_d->
path);
321 bool successfullyLoaded = false;
322
327
329 m_d->
doc->setFileBatchMode(
true);
330
331 if (
m_d->
path.toLower().endsWith(
"ora") ||
m_d->
path.toLower().endsWith(
"kra")) {
333 if (store && !store->bad()) {
334 if (store->open(QString("mergedimage.png"))) {
335 QByteArray bytes = store->read(store->size());
336 store->close();
337 QImage mergedImage;
338 mergedImage.loadFromData(bytes);
339 Q_ASSERT(!mergedImage.isNull());
341
342 constexpr double DOTS_PER_METER_TO_DOTS_PER_INCH = 0.00035285815102328864;
343 double xres = mergedImage.dotsPerMeterX() * DOTS_PER_METER_TO_DOTS_PER_INCH;
344 double yres = mergedImage.dotsPerMeterY() * DOTS_PER_METER_TO_DOTS_PER_INCH;
345
351 m_d->
doc->setCurrentImage(image);
352 successfullyLoaded = true;
353 }
354 else {
355 qWarning() << "delayedLoadStart: Could not open mergedimage.png";
356 }
357 }
358 else {
359 qWarning() << "delayedLoadStart: Store was bad";
360 }
361 }
362 else {
365
366 if (successfullyLoaded) {
367
369 m_d->
doc->image()->waitForDone();
370 }
371 }
372 } else {
373 dbgKrita <<
"File was modified externally. Restarting.";
380 }
381
384
385 if (!successfullyLoaded) {
386
390 }
391 else {
393 }
394 }
395 else {
400 m_d->
doc->image()->xRes(),
401 m_d->
doc->image()->yRes(),
402 m_d->
doc->image()->size());
403 }
404
406}
const quint8 OPACITY_OPAQUE_U8
KisGroupLayerSP rootLayer() const
void initialRefreshGraph()
void setResolution(double xres, double yres)
void convertFromQImage(const QImage &image, const KoColorProfile *profile, qint32 offsetX=0, qint32 offsetY=0)
void makeCloneFrom(KisPaintDeviceSP src, const QRect &rect)
static KisPart * instance()
void loadingFinished(KisPaintDeviceSP paintDevice, qreal xRes, qreal yRes, const QSize &size)
static KoStore * createStore(const QString &fileName, Mode mode, const QByteArray &appIdentification=QByteArray(), Backend backend=Auto, bool writeMimetype=true)
void forceAllDelayedNodesUpdate(KisNodeSP root)
bool addNode(KisNodeSP node, KisNodeSP parent=KisNodeSP(), KisNodeAdditionFlags flags=KisNodeAdditionFlag::None)
KisPaintDeviceSP paintDevice
QDateTime initialFileTimeStamp
QScopedPointer< KisDocument > doc
static KoColorSpaceRegistry * instance()
const KoColorSpace * rgb8(const QString &profileName=QString())