Commit 6b025df8 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Make all PSD Resource Blocks KisAnnotations for round-tripping.

parent 645b37a3
......@@ -66,13 +66,15 @@ public:
m_description(description),
m_annotation(data) {}
virtual ~KisAnnotation() {}
/**
* gets a non-localized strin identifying the type of the
* gets a non-localized string identifying the type of the
* annotation.
* @return a non-localized string identifiying the type of the
* annotation
*/
QString & type() {
const QString & type() const {
return m_type;
}
......@@ -82,7 +84,7 @@ public:
* @return a localized string describing the type of the
* annotations for user interface purposes.
*/
QString & description() {
const QString & description() const {
return m_description;
}
......@@ -90,11 +92,18 @@ public:
* gets a binary blob representation of this annotation
* @return a binary blob representation of this annotation
*/
QByteArray & annotation() {
const QByteArray & annotation() const {
return m_annotation;
}
private:
/**
* @brief displayText: override this to return an interpreted version of the annotation
*/
virtual QString displayText() const {
return QString::fromUtf8(m_annotation);
}
protected:
QString m_type;
QString m_description;
......
......@@ -122,8 +122,8 @@ KisImageBuilder_Result PSDLoader::decode(const KUrl& uri)
colorSpaceId.second,
iccProfileData->icc);
dbgFile << "Loaded ICC profile" << profile->name();
delete resourceSection.resources.take(PSDResourceSection::ICC_PROFILE);
}
}
// Create the colorspace
......@@ -143,15 +143,13 @@ KisImageBuilder_Result PSDLoader::decode(const KUrl& uri)
if (resInfo) {
m_image->setResolution(POINT_TO_INCH(resInfo->hRes), POINT_TO_INCH(resInfo->vRes));
// let's skip the unit for now; we can only set that on the KoDocument, and krita doesn't use it.
delete resourceSection.resources.take(PSDResourceSection::RESN_INFO);
}
}
// Preserve the duotone colormode block for saving back to psd
if (header.colormode == DuoTone) {
KisAnnotationSP annotation = new KisAnnotation("DuotoneColormodeBlock",
i18n("Duotone Colormode Block"),
colorModeBlock.data);
m_image->addAnnotation(annotation);
// Preserve all the annotations
foreach(PSDResourceBlock *resourceBlock, resourceSection.resources.values()) {
m_image->addAnnotation(resourceBlock);
}
// read the projection into our single layer
......
......@@ -27,7 +27,8 @@
#include "psd_resource_section.h"
PSDResourceBlock::PSDResourceBlock()
: identifier(PSDResourceSection::UNKNOWN)
: KisAnnotation("PSD Resource Block", "", QByteArray())
, identifier(PSDResourceSection::UNKNOWN)
, resource(0)
{
}
......@@ -55,6 +56,9 @@ bool PSDResourceBlock::read(QIODevice* io)
dbgFile << "\tresource block identifier" << identifier;
m_type = QString("PSD Resource Block: %1").arg(identifier);
if (!psdread_pascalstring(io, name, 2)) {
error = "Could not read name of resource block";
return false;
......@@ -67,19 +71,22 @@ bool PSDResourceBlock::read(QIODevice* io)
return false;
}
if ((dataSize & 0x01) != 0) {
dataSize++;
}
dbgFile << "\tresource block size" << dataSize;
m_description = PSDResourceSection::idToString((PSDResourceSection::PSDResourceID)identifier);
data = io->read(dataSize);
if (!data.size() == dataSize) {
error = QString("Could not read data for resource block with name %1 of type %2").arg(name).arg(identifier);
return false;
}
m_annotation = data;
switch (identifier) {
case PSDResourceSection::MAC_PRINT_INFO:
resource = new MAC_PRINT_INFO_1001;
......
......@@ -20,9 +20,11 @@
class QIODevice;
#include <klocale.h>
#include <QDebug>
#include <QString>
#include <kis_annotation.h>
#include <kis_debug.h>
#include "psd.h"
......@@ -41,6 +43,8 @@ public:
virtual bool createBlock(QByteArray & /*data*/) { return true; }
virtual bool valid() { return true; }
virtual QString displayText() { return QString(); }
QString error;
};
......@@ -51,16 +55,24 @@ public:
* XXX: make KisAnnotations out of the resource blocks so we can load/save them. Need to
* expand KisAnnotation to make that work.
*/
class PSDResourceBlock //: public KisAnnotation
class PSDResourceBlock : public KisAnnotation
{
public:
PSDResourceBlock();
~PSDResourceBlock()
{
delete resource;
}
QString displayText() const {
if (resource) {
return resource->displayText();
}
return i18n("Unparsed Resource Block");
}
bool read(QIODevice* io);
bool write(QIODevice* io);
bool valid();
......
......@@ -32,21 +32,21 @@ PSDResourceSection::PSDResourceSection()
PSDResourceSection::~PSDResourceSection()
{
qDeleteAll(resources);
resources.clear();
}
bool PSDResourceSection::read(QIODevice* io)
{
quint32 resourceBlockLength = 0;
if (!psdread(io, &resourceBlockLength)) {
error = "Could not read resource block length";
quint32 resourceSectionLength = 0;
if (!psdread(io, &resourceSectionLength)) {
error = "Could not read image resource section length";
return false;
}
dbgFile << "Resource block length" << resourceBlockLength << "starts at" << io->pos();
dbgFile << "Image Resource Sectionlength:" << resourceSectionLength << ", starts at:" << io->pos();
QByteArray ba = io->read(resourceBlockLength);
if ((quint32)ba.size() != resourceBlockLength) {
QByteArray ba = io->read(resourceSectionLength);
if ((quint32)ba.size() != resourceSectionLength) {
error = "Could not read all resources";
return false;
}
......@@ -59,14 +59,19 @@ bool PSDResourceSection::read(QIODevice* io)
PSDResourceBlock* block = new PSDResourceBlock();
if (!block->read(&buf)) {
error = "Error reading block: " + block->error;
dbgFile << error << ",skipping.";
dbgFile << error << ", skipping.";
continue;
}
dbgFile << "resource block created. Type:" << block->identifier << "size"
<< block->dataSize
dbgFile << "resource block created. Type:" << block->identifier
<< "name" << block->name
<< "size" << block->dataSize
<< "," << buf.bytesAvailable() << "bytes to go";
resources[(PSDResourceID)block->identifier] = block;
}
qDebug() << "Read" << resources.size() << "Image Resource Blocks";
return valid();
}
......@@ -107,3 +112,119 @@ bool PSDResourceSection::valid()
{
return true;
}
QString PSDResourceSection::idToString(PSDResourceSection::PSDResourceID id)
{
switch(id) {
case UNKNOWN: return "Unknown";
case PS2_IMAGE_INFO : return "0x03e8 - Obsolete - ps 2.0 image info";
case MAC_PRINT_INFO : return "0x03e9 - Optional - Mac print manager print info record";
case PS2_COLOR_TAB : return "0x03eb - Obsolete - ps 2.0 indexed colour table";
case RESN_INFO : return "0x03ed - ResolutionInfo structure";
case ALPHA_NAMES : return "0x03ee - Alpha channel names";
case DISPLAY_INFO : return "0x03ef - DisplayInfo structure";
case CAPTION : return "0x03f0 - Optional - Caption string";
case BORDER_INFO : return "0x03f1 - Border info";
case BACKGROUND_COL : return "0x03f2 - Background colour";
case PRINT_FLAGS : return "0x03f3 - Print flags";
case GREY_HALFTONE : return "0x03f4 - Greyscale and multichannel halftoning info";
case COLOR_HALFTONE : return "0x03f5 - Colour halftoning info";
case DUOTONE_HALFTONE : return "0x03f6 - Duotone halftoning info";
case GREY_XFER : return "0x03f7 - Greyscale and multichannel transfer functions";
case COLOR_XFER : return "0x03f8 - Colour transfer functions";
case DUOTONE_XFER : return "0x03f9 - Duotone transfer functions";
case DUOTONE_INFO : return "0x03fa - Duotone image information";
case EFFECTIVE_BW : return "0x03fb - Effective black & white values for dot range";
case OBSOLETE_01 : return "0x03fc - Obsolete";
case EPS_OPT : return "0x03fd - EPS options";
case QUICK_MASK : return "0x03fe - Quick mask info";
case OBSOLETE_02 : return "0x03ff - Obsolete";
case LAYER_STATE : return "0x0400 - Layer state info";
case WORKING_PATH : return "0x0401 - Working path (not saved)";
case LAYER_GROUP : return "0x0402 - Layers group info";
case OBSOLETE_03 : return "0x0403 - Obsolete";
case IPTC_NAA_DATA : return "0x0404 - IPTC-NAA record (IMV4.pdf)";
case IMAGE_MODE_RAW : return "0x0405 - Image mode for raw format files";
case JPEG_QUAL : return "0x0406 - JPEG quality";
case GRID_GUIDE : return "0x0408 - Grid & guide info";
case THUMB_RES : return "0x0409 - Thumbnail resource";
case COPYRIGHT_FLG : return "0x040a - Copyright flag";
case URL : return "0x040b - URL string";
case THUMB_RES2 : return "0x040c - Thumbnail resource";
case GLOBAL_ANGLE : return "0x040d - Global angle";
case COLOR_SAMPLER : return "0x040e - Colour samplers resource";
case ICC_PROFILE : return "0x040f - ICC Profile";
case WATERMARK : return "0x0410 - Watermark";
case ICC_UNTAGGED : return "0x0411 - Do not use ICC profile flag";
case EFFECTS_VISIBLE : return "0x0412 - Show / hide all effects layers";
case SPOT_HALFTONE : return "0x0413 - Spot halftone";
case DOC_IDS : return "0x0414 - Document specific IDs";
case ALPHA_NAMES_UNI : return "0x0415 - Unicode alpha names";
case IDX_COL_TAB_CNT : return "0x0416 - Indexed colour table count";
case IDX_TRANSPARENT : return "0x0417 - Index of transparent colour (if any)";
case GLOBAL_ALT : return "0x0419 - Global altitude";
case SLICES : return "0x041a - Slices";
case WORKFLOW_URL_UNI : return "0x041b - Workflow URL - Unicode string";
case JUMP_TO_XPEP : return "0x041c - Jump to XPEP (?)";
case ALPHA_ID : return "0x041d - Alpha IDs";
case URL_LIST_UNI : return "0x041e - URL list - unicode";
case VERSION_INFO : return "0x0421 - Version info";
case EXIF_DATA : return "0x0422 - (Photoshop 7.0) EXIF data 1. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf";
case EXIF_DATA_3 : return "0x0423 - (Photoshop 7.0) EXIF data 3. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf";
case XMP_DATA : return "0x0424 - XMP data block";
case CAPTION_DIGEST : return "0x0425 - (Photoshop 7.0) Caption digest. 16 bytes: RSA Data Security, MD5 message-digest algorithm";
case PRINT_SCALE : return "0x0426 - (Photoshop 7.0) Print scale. 2 bytes style (0 = centered, 1 = size to fit, 2 = user defined). 4 bytes x location (floating point). 4 bytes y location (floating point). 4 bytes scale (floating point)";
case PIXEL_ASPECT_RATION : return "0x0428 - (Photoshop CS) Pixel Aspect Ratio. 4 bytes (version = 1 or 2), 8 bytes double, x / y of a pixel. Version 2, attempting to correct values for NTSC and PAL, previously off by a factor of approx. 5%.";
case LAYER_COMPS : return "0x0429 - (Photoshop CS) Layer Comps. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)";
case ALTERNATE_DUOTONE : return "0x042A - (Photoshop CS) Alternate Duotone Colors. 2 bytes (version = 1), 2 bytes count, following is repeated for each count: [ Color: 2 bytes for space followed by 4 * 2 byte color component ], following this is another 2 byte count, usually 256, followed by Lab colors one byte each for L, a, b. This resource is not read or used by Photoshop.";
case ALTERNATE_SPOT : return "0x042B - (Photoshop CS)Alternate Spot Colors. 2 bytes (version = 1), 2 bytes channel count, following is repeated for each count: 4 bytes channel ID, Color: 2 bytes for space followed by 4 * 2 byte color component. This resource is not read or used by Photoshop.";
case LAYER_SELECTION_ID : return "0x042D - (Photoshop CS2) Layer Selection ID(s). 2 bytes count, following is repeated for each count: 4 bytes layer ID";
case HDR_TONING : return "0x042E - (Photoshop CS2) HDR Toning information";
case CS2_PRINT_INFO : return "0x042F - (Photoshop CS2) Print info";
case LAYER_GROUP_ENABLED_ID: return "0x0430 - (Photoshop CS2) Layer Group(s) Enabled ID. 1 byte for each layer in the document, repeated by length of the resource. NOTE: Layer groups have start and end markers";
case COLOR_SAMPLERS : return "0x0431 - (Photoshop CS3) Color samplers resource. Also see ID 1038 for old format. See See Color samplers resource format.";
case MEASUREMENT_SCALE : return "0x0432 - (Photoshop CS3) Measurement Scale. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)";
case TIMELINE_INFO : return "0x0433 - (Photoshop CS3) Timeline Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)";
case SHEET_DISCLOSURE : return "0x0434 - (Photoshop CS3) Sheet Disclosure. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)";
case CS3_DISPLAY_INFO : return "0x0435 - (Photoshop CS3) DisplayInfo structure to support floating point clors. Also see ID 1007. See Appendix A in Photoshop API Guide.pdf .";
case ONION_SKINS : return "0x0436 - (Photoshop CS3) Onion Skins. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)";
case COUNT_INFO : return "0x0438 - (Photoshop CS4) Count Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the count in the document. See the Count Tool.";
case CS5_PRINT_INFO : return "0x043A - (Photoshop CS5) Print Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print settings in the document. The color management options.";
case CS5_PRINT_STYLE : return "0x043B - (Photoshop CS5) Print Style. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print style in the document. The printing marks, labels, ornaments, etc.";
case CS5_NSPrintInfo : return "0x043C - (Photoshop CS5) Macintosh NSPrintInfo. Variable OS specific info for Macintosh. NSPrintInfo. It is recommened that you do not interpret or use this data.";
case CS5_WIN_DEVMODE : return "0x043D - (Photoshop CS5) Windows DEVMODE. Variable OS specific info for Windows. DEVMODE. It is recommened that you do not interpret or use this data.";
case CS6_AUTOSAVE_FILE_PATH : return "0x043E - (Photoshop CS6) Auto Save File Path. Unicode string. It is recommened that you do not interpret or use this data.";
case CS6_AUTOSAVE_FORMAT : return "0x043F - (Photoshop CS6) Auto Save Format. Unicode string. It is recommened that you do not interpret or use this data.";
case CC_PATH_SELECTION_SATE : return "0x0440 - (Photoshop CC) Path Selection State. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current path selection state.";
case PATH_INFO_FIRST : return "0x07d0 - First path info block";
case PATH_INFO_LAST : return "0x0bb6 - Last path info block";
case CLIPPING_PATH : return "0x0bb7 - Name of clipping path";
case CC_ORIGIN_PATH_INFO : return "0x0BB8 (Photoshop CC) Origin Path Info. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the origin path data.";
case PLUGIN_RESOURCE_START : return "0x0FA0-0x1387 Plug-In resource(s). Resources added by a plug-in. See the plug-in API found in the SDK documentation ";
case PLUGIN_RESOURCE_END : return "Last plug-in resource";
case IMAGE_READY_VARS : return "0x1B58 Image Ready variables. XML representation of variables definition";
case IMAGE_READY_DATA_SETS : return "0x1B59 Image Ready data sets";
case LIGHTROOM_WORKFLOW : return "0x1F40 (Photoshop CS3) Lightroom workflow, if present the document is in the middle of a Lightroom workflow.";
case PRINT_FLAGS_2 : return "0x2710 - Print flags";
default: {
if (id > PATH_INFO_FIRST && id < PATH_INFO_LAST) return "Path Info Block";
if (id > PLUGIN_RESOURCE_START && id < PLUGIN_RESOURCE_END) return "Plug-In Resource";
}
};
return QString("Unknown Resource Block: %1").arg(id);
}
......@@ -98,30 +98,30 @@ public:
XMP_DATA = 1060, /* 0x0424 - XMP data block */
CAPTION_DIGEST = 1061, /* 0x0425 - (Photoshop 7.0) Caption digest. 16 bytes: RSA Data Security, MD5 message-digest algorithm */
PRINT_SCALE = 1062, /* 0x0426 - (Photoshop 7.0) Print scale. 2 bytes style (0 = centered, 1 = size to fit, 2 = user defined). 4 bytes x location (floating point). 4 bytes y location (floating point). 4 bytes scale (floating point) */
PIXEL_ASPECT_RATION = 1064, /* 0x0428 (Photoshop CS) Pixel Aspect Ratio. 4 bytes (version = 1 or 2), 8 bytes double, x / y of a pixel. Version 2, attempting to correct values for NTSC and PAL, previously off by a factor of approx. 5%. */
LAYER_COMPS = 1065, /* 0x0429 (Photoshop CS) Layer Comps. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
ALTERNATE_DUOTONE = 1066, /* 0x042A (Photoshop CS) Alternate Duotone Colors. 2 bytes (version = 1), 2 bytes count, following is repeated for each count: [ Color: 2 bytes for space followed by 4 * 2 byte color component ], following this is another 2 byte count, usually 256, followed by Lab colors one byte each for L, a, b. This resource is not read or used by Photoshop. */
ALTERNATE_SPOT = 1067, /* 0x042B (Photoshop CS)Alternate Spot Colors. 2 bytes (version = 1), 2 bytes channel count, following is repeated for each count: 4 bytes channel ID, Color: 2 bytes for space followed by 4 * 2 byte color component. This resource is not read or used by Photoshop. */
LAYER_SELECTION_ID =1069, /* 0x042D (Photoshop CS2) Layer Selection ID(s). 2 bytes count, following is repeated for each count: 4 bytes layer ID */
HDR_TONING = 1070, /* 0x042E (Photoshop CS2) HDR Toning information */
CS2_PRINT_INFO = 1071, /* 0x042F (Photoshop CS2) Print info */
LAYER_GROUP_ENABLED_ID = 1072, /* 0x0430 (Photoshop CS2) Layer Group(s) Enabled ID. 1 byte for each layer in the document, repeated by length of the resource. NOTE: Layer groups have start and end markers */
COLOR_SAMPLERS = 1073, /* 0x0431 (Photoshop CS3) Color samplers resource. Also see ID 1038 for old format. See See Color samplers resource format. */
MEASUREMENT_SCALE = 1074, /* 0x0432 (Photoshop CS3) Measurement Scale. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
TIMELINE_INFO = 1075, /* 0x0433 (Photoshop CS3) Timeline Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
SHEET_DISCLOSURE = 1076, /* 0x0434 (Photoshop CS3) Sheet Disclosure. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
CS3_DISPLAY_INFO = 1077, /* 0x0435 (Photoshop CS3) DisplayInfo structure to support floating point clors. Also see ID 1007. See Appendix A in Photoshop API Guide.pdf . */
ONION_SKINS = 1078, /* 0x0436 (Photoshop CS3) Onion Skins. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
COUNT_INFO = 1080, /* 0x0438 (Photoshop CS4) Count Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the count in the document. See the Count Tool. */
CS5_PRINT_INFO = 1082, /* 0x043A (Photoshop CS5) Print Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print settings in the document. The color management options. */
CS5_PRINT_STYLE = 1083, /* 0x043B (Photoshop CS5) Print Style. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print style in the document. The printing marks, labels, ornaments, etc. */
CS5_NSPrintInfo = 1084, /* 0x043C (Photoshop CS5) Macintosh NSPrintInfo. Variable OS specific info for Macintosh. NSPrintInfo. It is recommened that you do not interpret or use this data. */
CS5_WIN_DEVMODE = 1085, /* 0x043D (Photoshop CS5) Windows DEVMODE. Variable OS specific info for Windows. DEVMODE. It is recommened that you do not interpret or use this data. */
CS6_AUTOSAVE_FILE_PATH = 1086, /* 0x043E (Photoshop CS6) Auto Save File Path. Unicode string. It is recommened that you do not interpret or use this data. */
CS6_AUTOSAVE_FORMAT = 1087, /* 0x043F (Photoshop CS6) Auto Save Format. Unicode string. It is recommened that you do not interpret or use this data. */
CC_PATH_SELECTION_SATE = 1088, /* 0x0440 (Photoshop CC) Path Selection State. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current path selection state. */
PIXEL_ASPECT_RATION = 1064, /* 0x0428 - (Photoshop CS) Pixel Aspect Ratio. 4 bytes (version = 1 or 2), 8 bytes double, x / y of a pixel. Version 2, attempting to correct values for NTSC and PAL, previously off by a factor of approx. 5%. */
LAYER_COMPS = 1065, /* 0x0429 - (Photoshop CS) Layer Comps. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
ALTERNATE_DUOTONE = 1066, /* 0x042A - (Photoshop CS) Alternate Duotone Colors. 2 bytes (version = 1), 2 bytes count, following is repeated for each count: [ Color: 2 bytes for space followed by 4 * 2 byte color component ], following this is another 2 byte count, usually 256, followed by Lab colors one byte each for L, a, b. This resource is not read or used by Photoshop. */
ALTERNATE_SPOT = 1067, /* 0x042B - (Photoshop CS)Alternate Spot Colors. 2 bytes (version = 1), 2 bytes channel count, following is repeated for each count: 4 bytes channel ID, Color: 2 bytes for space followed by 4 * 2 byte color component. This resource is not read or used by Photoshop. */
LAYER_SELECTION_ID =1069, /* 0x042D - (Photoshop CS2) Layer Selection ID(s). 2 bytes count, following is repeated for each count: 4 bytes layer ID */
HDR_TONING = 1070, /* 0x042E - (Photoshop CS2) HDR Toning information */
CS2_PRINT_INFO = 1071, /* 0x042F - (Photoshop CS2) Print info */
LAYER_GROUP_ENABLED_ID = 1072, /* 0x0430 - (Photoshop CS2) Layer Group(s) Enabled ID. 1 byte for each layer in the document, repeated by length of the resource. NOTE: Layer groups have start and end markers */
COLOR_SAMPLERS = 1073, /* 0x0431 - (Photoshop CS3) Color samplers resource. Also see ID 1038 for old format. See See Color samplers resource format. */
MEASUREMENT_SCALE = 1074, /* 0x0432 - (Photoshop CS3) Measurement Scale. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
TIMELINE_INFO = 1075, /* 0x0433 - (Photoshop CS3) Timeline Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
SHEET_DISCLOSURE = 1076, /* 0x0434 - (Photoshop CS3) Sheet Disclosure. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
CS3_DISPLAY_INFO = 1077, /* 0x0435 - (Photoshop CS3) DisplayInfo structure to support floating point clors. Also see ID 1007. See Appendix A in Photoshop API Guide.pdf . */
ONION_SKINS = 1078, /* 0x0436 - (Photoshop CS3) Onion Skins. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
COUNT_INFO = 1080, /* 0x0438 - (Photoshop CS4) Count Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the count in the document. See the Count Tool. */
CS5_PRINT_INFO = 1082, /* 0x043A - (Photoshop CS5) Print Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print settings in the document. The color management options. */
CS5_PRINT_STYLE = 1083, /* 0x043B - (Photoshop CS5) Print Style. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print style in the document. The printing marks, labels, ornaments, etc. */
CS5_NSPrintInfo = 1084, /* 0x043C - (Photoshop CS5) Macintosh NSPrintInfo. Variable OS specific info for Macintosh. NSPrintInfo. It is recommened that you do not interpret or use this data. */
CS5_WIN_DEVMODE = 1085, /* 0x043D - (Photoshop CS5) Windows DEVMODE. Variable OS specific info for Windows. DEVMODE. It is recommened that you do not interpret or use this data. */
CS6_AUTOSAVE_FILE_PATH = 1086, /* 0x043E - (Photoshop CS6) Auto Save File Path. Unicode string. It is recommened that you do not interpret or use this data. */
CS6_AUTOSAVE_FORMAT = 1087, /* 0x043F - (Photoshop CS6) Auto Save Format. Unicode string. It is recommened that you do not interpret or use this data. */
CC_PATH_SELECTION_SATE = 1088, /* 0x0440 - (Photoshop CC) Path Selection State. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current path selection state. */
PATH_INFO_FIRST = 2000, /* 0x07d0 - First path info block */
PATH_INFO_LAST = 2998, /* 0x0bb6 - Last path info block */
......@@ -148,6 +148,8 @@ public:
bool write(QIODevice* io);
bool valid();
static QString idToString(PSDResourceID id);
QMap<PSDResourceID, PSDResourceBlock*> resources;
QString error;
......
......@@ -125,7 +125,7 @@ void KisDlgImageProperties::setAnnotation(const QString &type)
m_page->lblDescription->clear();
m_page->txtAnnotation->clear();
m_page->lblDescription->setText(annotation->description());
m_page->txtAnnotation->appendPlainText(QString::fromUtf8(annotation->annotation()));
m_page->txtAnnotation->appendPlainText(annotation->displayText());
}
else {
m_page->lblDescription->clear();
......
......@@ -953,7 +953,7 @@ KisImageBuilder_Result KisPNGConverter::buildFile(QIODevice* iodevice, KisImageW
QByteArray keyData = (*it)->description().toLatin1();
text[0].key = keyData.data();
text[0].text = (*it)->annotation().data();
text[0].text = (char*)(*it)->annotation().data();
text[0].text_length = (*it)->annotation().size();
text[0].compression = -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment