Trying to make Thumbnails with `convert` & PHP…

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
ridera

Post by ridera »

Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Post by Bonzo »

I have not converted a tiff but there are some php code examples I have made at http://www.rubblewebs.com/imagemagick/thumbnail.php

If you use my code for some reason the line below is causing a problem all of a sudden, I do not know if my host has changed something but just remove it. If you are letting others upload to your server you will need to put other safety precautions in the code.

// Strip any malicious code from the user input
$new_image = escapeshellarg( $new_image );
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Post by Bonzo »

I would try making the comand simpler first and see what happens:

Code: Select all

exec("/usr/local/bin/convert plans/24.tif -resize 310x414! -quality 50 -debug all thumbnails/24.jpg");
Notes:
I have found you do not need the full server path to the image.
An image path like /Users/johnm/webfolder/win/plans/24.tif seems to cause problems - it may be all the / in the path.
If you need a path like /Users/johnm/webfolder/win/plans/24.tif it seems better to put it into a variable and call the variable in the code instead.

Otherwise I have no idea what your problem is.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

You do have a ".thumbnail" sub-directory don't you?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

typo. missing the parent directory is a common cause for permission denied.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
GiantRabbit

Post by GiantRabbit »

unable to open module file `/usr/local/lib/ImageMagick-6.2.7/modules-Q16/coders/tiff.la': No such file or directory

Looks like u cannot read tiff's at all. Are u sure a *proper* thumbnail was generated from the terminal, and not a black empty *thingy* :?

Try it with another type of source file, .png .bmp .jpg etc.
Post Reply