void HelloWorld::resizeAndWriteImage(Magick::Image image, string fileName, string size){ if (image.isValid()){ Magick::Image resizedImg = image; resizedImg.resize(size); printf("Saving...\n"); cout << fileName << "\n"; resizedImg.write(fileName+".png"); } }
QImage ImageFactoryThumbnail::image() { // try loading cached thumbnail of exported image Magick::Image thumbnail = m_config->db()->cache().retrieve(m_config->config(),true); if( !thumbnail.isValid() ) { // fallback to loading cached thumbnail embedded in RAW image thumbnail = m_config->db()->cache().retrieve(m_config->raw(),true); if( !thumbnail.isValid() ) { qDebug() << "ImageFactoryThumbnail::image() invalid" << m_config->raw(); return QImage(); } } Magick::Blob blob; thumbnail.write( &blob ); qDebug() << "ImageFactoryThumbnail::image()" << thumbnail.size().width() << "x" << thumbnail.size().height(); return QImage::fromData( QByteArray( static_cast<const char*>(blob.data()), blob.length() ) ); }
void Magick::isValidImage::operator()( Magick::Image &image_ ) const { image_.isValid( _isValid ); }