Photoshop PSD import (Compositor 1.2.0, part one)

This commit is contained in:
雷电芽衣 committed 2026-09-27 04:41:08 -04:00
1 parent 3d56688ce4
commit 2cd0d1b86d
41 files changed
+3912 -31

No files matched your search

+13 -1
View File
@@ -1,4 +1,6 @@
#include "IO/ImageImporter.h"
#include "IO/PSD/PSDDocumentBuilder.h"
#include "IO/PSD/PSDReader.h"
#include "Logging.h"
#include "Rendering/RasterSnapshot.h"
#include <QColorSpace>
@@ -16,7 +18,7 @@ QString description(ImageImportError::Kind kind)
case ImageImportError::Kind::unreadable:
return QStringLiteral("The image could not be read. It may be damaged or unavailable.");
case ImageImportError::Kind::unsupported:
return QStringLiteral("Choose a JPEG, PNG, HEIC, or TIFF image.");
return QStringLiteral("Choose a JPEG, PNG, HEIC, TIFF, or Photoshop (PSD) file.");
case ImageImportError::Kind::tooLarge:
return QStringLiteral("This import exceeds the current 100-megapixel document budget or 30,000-pixel side limit.");
}
@@ -241,3 +243,13 @@ ImportedImage ImageImporter::decode(const QString &path, qint64 remainingPixels)
qCInfo(lcIO).noquote() << "imported" << path << image.width() << "x" << image.height();
return ImportedImage(image, thumbnail, name.isEmpty() ? QFileInfo(path).fileName() : name);
}
PSDDocument ImageImporter::loadPhotoshop(const QString &path, qint64 remainingPixels)
{
return PSDReader::read(path, remainingPixels);
}
std::map<QUuid, ImportedImage> ImageImporter::photoshopAssets(const PSDDocument &document)
{
return PSDDocumentBuilder::assets(document);
}