Using Convert directly with HTTPS

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jimmacka
Posts: 1
Joined: 2011-03-18T07:37:05-07:00
Authentication code: 8675308

Using Convert directly with HTTPS

Post by jimmacka »

I'm trying to use Convert to directly access an image on the internet, then convert it and save it locally. This seems to work fine:
convert http://mywebsite.com/welcome.png -resize 150x150 c:\images\c-07352-01.png

But if I use HTTPS, it does not work:
convert https://mywebsite.com/welcome.png -resize 150x150 c:\images\c-07352-01.png
Magick: no decode delegate for this image format `//mywebsite.com/welcome.png' @ error/constitute.c/ReadImage/532.
Magick: missing an image filename `c:\images\c-07352-01.png' @ error/convert.c/ConvertImageCommand/2953.

Is my installation missing something that would allow a SSL connection?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Using Convert directly with HTTPS

Post by magick »

Your command works under Linux and Cygwin under Windows with the curl delegate program. ImageMagick does not have direct support for the HTTPS protocol so it relies on an external delegate program. Is there a Windows command-line utility that you can use to download from HTTPS? If so we might be able to configure it in delegates.xml to support HTTPS directly under Windows.
Silvertiger
Posts: 2
Joined: 2011-03-27T06:24:27-07:00
Authentication code: 8675308

Re: Using Convert directly with HTTPS

Post by Silvertiger »

if you have no firewall restrictions or issues, the following works for me:
(requires imageMagick and imagick for PHP)

Code: Select all

      $file_to_adjust = "https://www.myfile.com/filename.jpg";
      $handle = fopen($file_to_adjust, 'rb');
      $img = new Imagick();
      $img->readImageFile($handle);
      $img->thumbnailImage( 100, null );
      $img->writeImage('save_folder/save_filename.jpg";
the fopen() works around directly accessing the file via the http/https protocol.
Post Reply