I'm creating thumbnails for a Digital asset manager, what is the best way to do this with imagemagick?
is there good resource out there?
I'm creating thumbnails for a Digital asset manager, what is the best way to do this with imagemagick?
is there good resource out there?
I solved it and will share with the WORLD! it will convert .ai, .psd, .jpg, .png, .gif into thumbnails.
Here is a function that takes 4 params:
$dir - directory to save to.
$tmpName - the name to name the file excluding the extension.
$fileType - self explanatory.
$size - Large or small.
@Jason - Thanks for sharing. Here are a few tips for cleaner and easier to maintain/extend code. Again, a lot of it depends on your requirements. Also, I didn't actually run this code, so forgive any typos.
$dir - directory to save to.
$tmpName - the name to name the file excluding the extension.
$fileType - self explanatory.
$size - Large or small. You may consider taking a pixel width value for the thumbnail rather than a string for a predefined width. Let's say you will have the need for a larger thumbnail in a new section of your page in the future (i.e. Retina-ready icons with 500px for "small" thumbnails). You should preferably define the size in the new part of the code rather than in the shared thumbGenerator function