bool ImageFileHandlerBase::write(Image const *pImage, Char8 const *fileName, Char8 const *mimeType) { bool retCode = false; ImageFileType *type; const std::string *fNAttachment; if(!fileName && (fNAttachment = pImage->findAttachmentField(_fileNameKey))) { fileName = fNAttachment->c_str(); } if((type = getFileType(mimeType, fileName))) { SINFO << "try to write " << fileName << " as " << type->getMimeType() << std::endl; retCode = type->write(pImage, fileName); } else { SWARNING << "can't write " << fileName << "; unknown image format" << std::endl; } return retCode; }
bool ImageFileHandlerBase::write(Image const *pImage, std::ostream &os, std::string const &mimeType) { ImageFileType *type = getFileType(mimeType.c_str()); return type == 0 ? false : type->write(pImage, os, mimeType); }