28 dbgFile <<
"Reading resource block";
30 error =
"Could not read resource block: no bytes left.";
36 if (b.size() != 4 || QString(b) !=
"8BIM") {
37 error = QString(
"Could not read resource block signature. Got %1.").arg(QString(b));
42 error =
"Could not read resource block identifier";
51 error =
"Could not read name of resource block";
58 error = QString(
"Could not read datasize for resource block with name %1 of type %2").arg(
name).arg(
identifier);
72 error = QString(
"Could not read data for resource block with name %1 of type %2").arg(
name).arg(
identifier);
253 error = QString(
"Cannot write an invalid Resource Block");
278 buf.open(QBuffer::WriteOnly);
286 if (io.write(ba.constData(), ba.size()) != ba.size()) {
287 error = QString(
"Could not write complete resource");
301 error = QString(
"Needed %1 bytes, got %2 bytes of data").arg(
dataSize).arg(
data.length());
309 dbgFile <<
"Reading RESN_INFO_1005";
312 QDataStream ds(data);
313 ds.setByteOrder(QDataStream::BigEndian);
332 dbgFile <<
"Writing RESN_INFO_1005";
358 dbgFile <<
"Reading ICC_PROFILE_1039";
367 dbgFile <<
"Writing ICC_PROFILE_1039";
368 if (
icc.size() == 0) {
369 error =
"ICC_PROFILE_1039: Trying to save an empty profile";
374 buf.write(
icc.constData(),
icc.size());
A data extension mechanism for Krita.
static QString idToString(PSDResourceID id)
virtual bool createBlock(QByteArray &)
virtual bool interpretBlock(QByteArray)
void startBlock(QBuffer &buf, PSDImageResourceSection::PSDResourceID id, quint32 size)
PSDInterpretedResource * resource
bool write(QIODevice &io) const
QString displayText() const override
displayText: override this to return an interpreted version of the annotation
std::enable_if_t< std::is_arithmetic< T >::value, bool > psdread(QIODevice &io, T &v)
bool psdwrite_pascalstring(QIODevice &io, const QString &s)
bool psdread_pascalstring(QIODevice &io, QString &s, qint64 padding)
std::enable_if_t< std::is_arithmetic< T >::value, bool > psdwrite(QIODevice &io, T v)
bool createBlock(QByteArray &data) override
bool interpretBlock(QByteArray data) override
bool createBlock(QByteArray &data) override
bool interpretBlock(QByteArray data) override