Hi Webmasters, I need help with this, can't figure it out yet by myself.
I need to create thumbnails from *any* image. The original size could be anything but the final size will be user defined (almost anything). It could be square, a rectangle, etc. I need it to be centered.
After hours of trying I came up with this:
convert -define jpeg:size=$dm $filename -thumbnail $dm^ \ -gravity center -extent $dm $filenamemini
where $dm stores "200x200" or "100x60" whatever the size of the final image is.
It works, but not on every server, I guess it has to do with the versions of immagemagick, in fact I bet that is the thing. I could dig into that but my script would supposed to be "install and use" so I ask for your help if there is any way to do the same but in some more "standard" way.
The final image shoud be the exact size one tells it to create. Any help would be appreciated, I tried and searched and there are many others trying to do the same.
Thanks in advance.