| 567 | } |
| 568 | |
| 569 | void Jp2Image::writeMetadata() { |
| 570 | if (io_->open() != 0) { |
| 571 | throw Error(ErrorCode::kerDataSourceOpenFailed, io_->path(), strError()); |
| 572 | } |
| 573 | IoCloser closer(*io_); |
| 574 | MemIo tempIo; |
| 575 | |
| 576 | doWriteMetadata(tempIo); // may throw |
| 577 | io_->close(); |
| 578 | io_->transfer(tempIo); // may throw |
| 579 | |
| 580 | } // Jp2Image::writeMetadata |
| 581 | |
| 582 | #ifdef __clang__ |
| 583 | // ignore cast align errors. dataBuf.pData_ is allocated by malloc() and 4 (or 8 byte aligned). |