Snippets - Utilities
NOTE: Most of the IM snippets have been tested on IM version 6.3.5 There may be some differences if you are using the code on other versions.
Fonts installed - Anthony 15/6/2008
You can find which fonts are available to you in your standard installation by using the code below. ( NB: "font" replaced "type" in the latest release due to a name clash for the '-type' options list ).
<?php// Select the version number from the configeration filepreg_match('/^LIB_VERSION_NUMBER ([0-9,]+)$/m', shell_exec("convert -list configure "), $vnums);// Seperate the numbers at the ,$number = explode( ",", $vnums[1] );// Format the version from 6,3,4,1 format to 06030401$version = "";for($i=0;$i<4;$i++){$version .= str_pad( $number[$i], 2, '0', STR_PAD_LEFT );}// The 'list' method used to get the fonts changed in IM v6.3.5-7$font_list = ( $version > "06030507" ) ? "font" : "type";// Display the version of Imagemagick, the method to read the fonts and the list of fontsecho "<h2>IM version: ".$version." </h2>\n<h3>Method used: convert -list $font_list</h3>\n<hr>\n<pre>";system("convert -list $font_list");echo "</pre>\n<hr>";?>
For more examples and information check out the main Imagemagick section.
Batch file ViewFonts installed View
Fonts Installed view View
Gravity option View
http image source View
Image information View
New image size in variable View
Path - find automaticly View
Path to Imagemagick View
Setup Information View
Shell script View
Variables in the code View
Version of Imagemagick installed View
Writing IM code View