Prerequisites for Imagemagick

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
shaan

Prerequisites for Imagemagick

Post by shaan »

Hello,

I have installed "ImageMagick-6.5.4-10-Q16-windows-dll.exe" on my Windows XP computer. My application is a Ruby on Rails application, which uses a plugin named "Paperclip" for image uploading. This plugin uses Imagemagick for image resizing.

I wanted to understand the prerequisites that are needed for imagemagick to work right. I have installed .NetFrameWork 2.0 on my system.

Is the .net framework required as a pre requisite? If yes, which one? Could some one please help me with this information.

love-n-peace,
@shaan
'Aal izz well' :-)
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Prerequisites for Imagemagick

Post by Bonzo »

You do not need the .net framework to get ImageMagick to work but if working with text you will need ghostscript.

A simple batch script to prove Imagemagick is working; name this something like resize.bat and put onto your desktop.
Drag and drop a test photo onto it and you should get a resized thumbnail in the folder the original image came from.

Code: Select all

convert.exe %1 -auto-orient -thumbnail 800x800 -bordercolor Black -border 2x2 -quality 80 "th_%~n1.jpg"
A command line check: Open the command prompt and type convert -version which will display the version.

You MIGHT have a problem with the windows built in program called convert; I never have but there is a simple work around if you do.
shaan

Re: Prerequisites for Imagemagick

Post by shaan »

Hello,

I attempted your suggestion. Created the resize.bat file as mentioned and dropped in a image file onto it. However I couldn't see any thumbnail image created in the image folder.

Further, the convert -version revealed the below -
Version: ImageMagick 6.5.4-10 2009-08-08 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

A few details about the problem - the application I have has a function to upload and resize an image to the server computer. Sometimes, the image gets uploaded (and properly resized, whenever it gets uploaded), however sometimes, the image uplod itself fails.

Request you to please advise.

love-n-peace,
@shaan
'Aal izz well' :-)
shaan

Re: Prerequisites for Imagemagick

Post by shaan »

Hello,

There is a small correction to my earlier reply. The resize.bat file has worked correct on both the computers.

On the computer where I have the issue of paperclip plugin, the resize.bat file was able to convert an image to the thumbnail size.

Could you please advise what problem could exist?

love-n-peace,
@shaan
'Aal izz well' :-)
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Prerequisites for Imagemagick

Post by Bonzo »

You will probably need to add a link to the image so that others can try it.

Will the same file fail on upload and work if tried again ?
Is it always one type of file that will fail and another type always works ?
Will the bad file convert when dropped into my batch script example ?

I know nothing about Ruby on Rails applications and can not help on that side of things - does the paperclip plugin have a help forum ?
shaan

Re: Prerequisites for Imagemagick

Post by shaan »

Hello Bonzo,

There are certain observations below. Please note that these are with "ImageMagick-6.5.9-10-Q16-windows-dll" which I installed just yesterday to check if things could be right with this version, but the error still persists even with this version.

a) For the first time the file gets uploaded right.
b) The same file if attempted for again, twice, thrice, gets uploaded right.
c) At the fourth time (may not necessarily be at the fourth time, but often it is), it fails with this error - C:/...../stream.1644.0 is not recognized by the 'identify' command.
d) This happens with any file as such and the file is not at fault. I can mail this one to you if you need (please do let me know).
e) Some time after the occurrence of this error, I attempted again (w/o restarting my web server), it worked! But again in the next attempt - the same error gets shown. Then again, it worked.
f) There is a slightly uncertain behavior with this upload - it works if tried again (may be after some time).
g) However, on my development PC, this is not the case. It works right consistently.

The ROR folks have been saying that the cause of this error could be that the path to Imagemagick - identify.exe is incorrectly set. But, then the image upload works as well (can work right only if the path is correct) - so I do not suspect it to be a path problem.

Please do let me know if you need some more information.

love-n-peace,
@shaan
'Aal izz well' :-)
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Prerequisites for Imagemagick

Post by Bonzo »

It is strange that it works sometimes and not others; if the image worked once I would have said there was nothing wrong with the image or setup of Imagemagick. Also if it all works on the development PC what is differnt with the server setup ?

I am afraid that the problem is beyond me; perhaps you should start another post with a title like "Ruby on rails upload problem".
shaan

Re: Prerequisites for Imagemagick

Post by shaan »

Hello,

Yeah, its quite strange that way.
Thanks for your help anyway...

love-n-peace
@shaan
'Aal izz well' :-)
Post Reply