Can we convert a .msg to jpeg using imagemagick? - imagemagick

I need to convert a .msg file to an jpeg image. Can we do it using ImageMagick ?
I tried to run the below command,
magick mail.msg mail.jpeg
but it gives an error :
magick: no decode delegate for this image format `MSG' # error/constitute.c/ReadImage/512.
I need .msg to be converted into an image.
Can you please suggest if that is possible.
Thanks,
Abha

Related

Convert Dicom Image to JPG

I am trying to convert a dicom file to JPG which I would then use to show as thumbnail for the dicom file. I am using the code below to convert the dicom file but When I execute it I get the following error
'write': no encode delegate for this image format `' # error/constitute.c/WriteImage/1272 (Magick::ImageMagickError)
I am using ruby version 2.7.0 and I have installed ImageMagick 7.1.0-4 and the supportive gems. How to solve this error?
require 'dicom'
require 'rmagick'
include DICOM
dcm = DObject.read("sample.dcm")
image = dcm.image(:frame => 5)
image.normalize.write("test.jpeg");
I had to reinstall ImageMagick-7.1.0-26 along with libgdcm-tools on my system and the above mentioned code worked fine. So Imagemagick needs these additional libraries (libjpeg62-dev, libtiff-dev, libpng-dev, libpng12-0 and libgdcm-tools) to work with these image types. I don't know if this is correct or not but that the problem I was facing has been resolved by following this approach. Here are some of the links which helped me in solving this
Install ImageMagick with JPG TIFF and PNG Delegates
How to configure and build with libgcdm for lossless jpeg conversion
and dicom support

How to Convert base64 data of tiff (String) to base64 data of png (String) in Ruby?

I am trying to convert base64 of tiff to base64 of png in controller of Ruby on Rails.
But, failed...
my ruby code is
#png_de =Base64.strict_encode64(IO.read('..//test1234.tif', mode: 'rb') )
this code causes not display a png image but a load failed icon in chrome.
I don't know how to fix the above issue

get "convert: improper image header" error when convert gif to png using ImageMagick

I am using ImageMagick to convert a gif to multiple png data. But I get this error:
convert: improper image header
/misc/lmbraid11/jingl/webscraping/dataset_2018_05_18/image2018_5_4_10_34.gif'
# error/gif.c/ReadGIFImage/1037. convert: no images defined
/misc/lmbraid11/jingl/webscraping/dataset_2018_05_18/image2018_5_4_10_34.png'
# error/convert.c/ConvertImageCommand/3210.
Here is the command:
convert -coalesce /misc/lmbraid11/jingl/webscraping/dataset_2018_05_18/image2018_5_4_10_34.gif /misc/lmbraid11/jingl/webscraping/dataset_2018_05_18/image2018_5_4_10_34.png
The gif file was downloaded from:
[http://www.niederschlagsradar.de/image.ashx?type=regioloop&regio=fre][1]
ImageMagick version: Version: ImageMagick 6.8.9-9 Q16 x86_64
Any help will be appreciated.
Problem get solved. It turns out that I did not download the gif file correctly, so the gif file was corrupted.
The syntax should be:
convert image2018_5_4_10_34.gif -coalesce image2018_5_4_10_34.png
In your case, you're specifying the option before files, however it can vary on your IM version.
As per #fmw42 comment:
Note that proper ImageMagick syntax reads the input before the -coalesce. Though ImageMagick 6 is forgiving, ImageMagick 7 is not.

Svg to jpg or png file using Paperclip in Rails 5.1

I've been using paperclip for a while, allowing my users to upload svg files to it. The problem here is i would like to convert that svg file into a png (or jpg, it doesnt matter). But i dont know if there is a convert_option value to transform it, or if we can do something about it.
When i run
convert file.svg file.png
in my console, i'm getting
attribute not recognized: n
attribute not recognized: u
attribute not recognized: n
attribute not recognized: u
convert: unable to open image `#': No such file or directory # error/blob.c/OpenBlob/2701.
convert: no decode delegate for this image format `' # error/constitute.c/ReadImage/504.
convert: unable to open image `#': No such file or directory # error/blob.c/OpenBlob/2701.
convert: no decode delegate for this image format `' # error/constitute.c/ReadImage/504.
I'm using macosx with imagemagick

How to instruct convert to resize only first TIFF frame if file path specified?

I tested some code which works fine:
C:\root\Dropbox\WWW\TIFF\sandbox 17:17:37,86
$c:\cygwin\bin\convert.exe gallery.tif[0] -thumbnail 300x300^ -format jpg gallery.jpg
But I want to specify full path to image and it is not works - why it is not working?
It is the same image.
c:\root\Dropbox\WWW\TIFF\sandbox\gallery.tif[0] == gallery.tif[0] - why it is not working?
C:\root\Dropbox\WWW\TIFF\sandbox 17:17:59,29
$c:\cygwin\bin\convert.exe c:\root\Dropbox\WWW\TIFF\sandbox\gallery.tif[0] -thumbnail 300x300^ -format jpg gallery.jpg
convert: must specify image size `\root\Dropbox\WWW\TIFF\sandbox\gallery.tif' # error/raw.c/ReadRAWImage/136.
convert: no images defined `gallery.jpg' # error/convert.c/ConvertImageCommand/3210.
You seem to be using Cygwin. Cygwin expects a different way to specify paths. IIRC, you should use something like:
convert.exe /cygdrive/c/root/Dropbox/WWW/TIFF/sandbox/gallery.tif[0] \
-thumbnail 300x300^ -format jpg gallery.jpg

Resources