| 84 | } // namespace |
| 85 | |
| 86 | Jp2Image::Jp2Image(BasicIo::UniquePtr io, bool create) : Image(ImageType::jp2, mdExif | mdIptc | mdXmp, std::move(io)) { |
| 87 | if (create && io_->open() == 0) { |
| 88 | #ifdef EXIV2_DEBUG_MESSAGES |
| 89 | std::cerr << "Exiv2::Jp2Image:: Creating JPEG2000 image to memory" << std::endl; |
| 90 | #endif |
| 91 | IoCloser closer(*io_); |
| 92 | if (io_->write(Jp2Blank.data(), Jp2Blank.size()) != Jp2Blank.size()) { |
| 93 | #ifdef EXIV2_DEBUG_MESSAGES |
| 94 | std::cerr << "Exiv2::Jp2Image:: Failed to create JPEG2000 image on memory" << std::endl; |
| 95 | #endif |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | // Obtains the ascii version from the box.type |
| 101 | std::string Jp2Image::toAscii(uint32_t n) { |