File indexing completed on 2024-12-22 04:15:51

0001 /*
0002  *  SPDX-FileCopyrightText: 2009 Boudewijn Rempt <boud@valdyas.org>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 #include "psd_import.h"
0007 
0008 #include <kpluginfactory.h>
0009 #include <QFileInfo>
0010 
0011 #include <KisDocument.h>
0012 #include <kis_image.h>
0013 
0014 #include "psd_loader.h"
0015 
0016 K_PLUGIN_FACTORY_WITH_JSON(ImportFactory, "krita_psd_import.json", registerPlugin<psdImport>();)
0017 
0018 psdImport::psdImport(QObject *parent, const QVariantList &) : KisImportExportFilter(parent)
0019 {
0020 }
0021 
0022 psdImport::~psdImport()
0023 {
0024 }
0025 
0026 KisImportExportErrorCode psdImport::convert(KisDocument *document, QIODevice *io,  KisPropertiesConfigurationSP /*configuration*/)
0027 {
0028     PSDLoader ib(document, importUserFeedBackInterface());
0029     KisImportExportErrorCode result = ib.buildImage(*io);
0030     if (result.isOk()) {
0031         document->setCurrentImage(ib.image());
0032     }
0033     return result;
0034 }
0035 
0036 #include <psd_import.moc>
0037