419 |
419 |
uint32_t curOffset = io_->tell();
|
420 |
420 |
|
421 |
421 |
// Write IPTC_NAA resource block
|
422 |
|
if ( resourceId == kPhotoshopResourceID_IPTC_NAA
|
423 |
|
|| (resourceId > kPhotoshopResourceID_IPTC_NAA && iptcDone == false)) {
|
|
422 |
if ((resourceId == kPhotoshopResourceID_IPTC_NAA ||
|
|
423 |
resourceId > kPhotoshopResourceID_IPTC_NAA) && iptcDone == false) {
|
424 |
424 |
newResLength += writeIptcData(iptcData_, outIo);
|
425 |
425 |
resourceSize = (resourceSize + 1) & ~1; // adjust for padding
|
426 |
426 |
iptcDone = true;
|
427 |
427 |
}
|
428 |
428 |
|
429 |
429 |
// Write ExifInfo resource block
|
430 |
|
else if ( resourceId == kPhotoshopResourceID_ExifInfo
|
431 |
|
|| (resourceId > kPhotoshopResourceID_ExifInfo && exifDone == false)) {
|
|
430 |
else if ((resourceId == kPhotoshopResourceID_ExifInfo ||
|
|
431 |
resourceId > kPhotoshopResourceID_ExifInfo) && exifDone == false) {
|
432 |
432 |
newResLength += writeExifData(exifData_, outIo);
|
433 |
433 |
resourceSize = (resourceSize + 1) & ~1; // adjust for padding
|
434 |
434 |
exifDone = true;
|
435 |
435 |
}
|
436 |
436 |
|
437 |
437 |
// Write XMPpacket resource block
|
438 |
|
else if ( resourceId == kPhotoshopResourceID_XMPPacket
|
439 |
|
|| (resourceId > kPhotoshopResourceID_XMPPacket && xmpDone == false)) {
|
|
438 |
else if ((resourceId == kPhotoshopResourceID_XMPPacket ||
|
|
439 |
resourceId > kPhotoshopResourceID_XMPPacket) && xmpDone == false) {
|
440 |
440 |
newResLength += writeXmpData(xmpData_, outIo);
|
441 |
441 |
resourceSize = (resourceSize + 1) & ~1; // adjust for padding
|
442 |
442 |
xmpDone = true;
|
... | ... | |
456 |
456 |
us2Data(buf, resourceId, bigEndian);
|
457 |
457 |
if (outIo.write(buf, 2) != 2) throw Error(21);
|
458 |
458 |
// Write resource name as Pascal string
|
459 |
|
buf[0] = resourceNameLength & 0x000f;
|
|
459 |
buf[0] = resourceNameLength & 0x00ff;
|
460 |
460 |
if (outIo.write(buf, 1) != 1) throw Error(21);
|
461 |
461 |
buf[0] = resourceNameFirstChar;
|
462 |
462 |
if (outIo.write(buf, 1) != 1) throw Error(21);
|