| 482 | } // PngImage::readMetadata |
| 483 | |
| 484 | void PngImage::writeMetadata() { |
| 485 | if (io_->open() != 0) { |
| 486 | throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); |
| 487 | } |
| 488 | IoCloser closer(*io_); |
| 489 | MemIo tempIo; |
| 490 | |
| 491 | doWriteMetadata(tempIo); // may throw |
| 492 | io_->close(); |
| 493 | io_->transfer(tempIo); // may throw |
| 494 | |
| 495 | } // PngImage::writeMetadata |
| 496 | |
| 497 | void PngImage::doWriteMetadata(BasicIo& outIo) { |
| 498 | if (!io_->isopen()) |