| [ Index ] |
PHP Cross Reference of Limb3 |
[Summary view] [Print] [Text view]
1 <?php 2 ////////////////////////////////////////////////////////////// 3 /// phpThumb() by James Heinrich <info@silisoftware.com> // 4 // available at http://phpthumb.sourceforge.net /// 5 ////////////////////////////////////////////////////////////// 6 /// // 7 // phpThumb.demo.demo.php // 8 // James Heinrich <info@silisoftware.com> // 9 // // 10 // Demo showing a wide variety of parameters that can be // 11 // passed to phpThumb.php // 12 // Live demo is at http://phpthumb.sourceforge.net/demo/ // 13 // // 14 ////////////////////////////////////////////////////////////// 15 $ServerInfo['gd_string'] = 'unknown'; 16 $ServerInfo['gd_numeric'] = 0; 17 //ob_start(); 18 if (!include_once ('../phpthumb.functions.php')) { 19 //ob_end_flush(); 20 die('failed to include_once ("../phpthumb.functions.php")'); 21 } 22 if (!include_once ('../phpthumb.class.php')) { 23 //ob_end_flush(); 24 die('failed to include_once ("../phpthumb.class.php")'); 25 } 26 //ob_end_clean(); 27 $phpThumb = new phpThumb(); 28 if (include_once ('../phpThumb.config.php')) { 29 foreach ($PHPTHUMB_CONFIG as $key => $value) { 30 $keyname = 'config_'.$key; 31 $phpThumb->setParameter($keyname, $value); 32 } 33 } 34 $ServerInfo['phpthumb_version'] = $phpThumb->phpthumb_version; 35 $ServerInfo['im_version'] = $phpThumb->ImageMagickVersion();; 36 $ServerInfo['gd_string'] = phpthumb_functions::gd_version(true); 37 $ServerInfo['gd_numeric'] = phpthumb_functions::gd_version(false); 38 unset($phpThumb); 39 ?> 40 41 <html> 42 <head> 43 <title>Demo of phpThumb() - thumbnails created by PHP using GD and/or ImageMagick</title> 44 <link rel="stylesheet" type="text/css" href="/style.css" title="style sheet"> 45 </head> 46 <body bgcolor="#C5C5C5"> 47 48 This is a demo of <a href="http://phpthumb.sourceforge.net"><b>phpThumb()</b></a> (current version: v<?php echo @$ServerInfo['phpthumb_version']; ?>)<br> 49 <a href="index.php?list=1">Other phpThumb() demos</a> are also available.<br> 50 <br> 51 <b>Note:</b> this server is working on GD "<?php 52 echo $ServerInfo['gd_string'].'"'; 53 if ($ServerInfo['gd_numeric'] >= 2) { 54 echo ', so images should be of optimal quality.'; 55 } else { 56 echo ', so images (especially watermarks) do not look as good as they would on GD v2.'; 57 } 58 ?><br> 59 60 <hr size="1"> 61 <a href="#showpic">phpThumb.demo.showpic.php demo here</a><br> 62 <a href="#gd1vs2">Difference between GD1 and GD2</a><br> 63 <hr size="1"> 64 <table border="5" align="center" width="500" cellpadding="5"><tr><td> 65 <b>The following images have the textured background behind them to illustrate transparency effects. 66 Note that some browsers, notably Internet Explorer, are incapable of displaying alpha-channel PNGs. 67 See my page on the <a href="http://www.silisoftware.com/png_alpha_transparency/" target="_blank">PNG transparency problem</a>. 68 Other modern browsers such as <a href="http://www.mozilla.org">Mozilla/Firefox</a> display alpha-transparent PNGs with no problems.</b> 69 </td></tr></table><br> 70 <script language="Javascript" defer> 71 <!-- 72 var agt = navigator.userAgent.toLowerCase(); 73 if ((agt.indexOf("opera") == -1) && (agt.indexOf("msie 7") == -1) && (navigator.product != "Gecko")) { 74 alert("You are (probably) using Internet Explorer and PNG transparency is (probably) broken"); 75 } 76 // --> 77 </script> 78 79 80 <?php 81 $phpThumbBase = '../phpThumb.php'; 82 83 $img['background'] = 'images/lrock011.jpg'; 84 85 $img['square'] = 'images/disk.jpg'; 86 $img['landscape'] = 'images/loco.jpg'; 87 $img['portrait'] = 'images/pineapple.jpg'; 88 $img['unrotated'] = 'images/monkey.jpg'; 89 $img['watermark'] = 'images/watermark.png'; 90 $img['levels'] = 'images/bunnies.jpg'; 91 $img['anigif'] = 'images/animaple.gif'; 92 $img['alpha'] = 'images/alpha.png'; 93 //$img['alpha'] = 'images/North15.gif'; 94 95 $img['mask1'] = 'images/mask04.png'; 96 $img['mask2'] = 'images/mask05.png'; 97 $img['mask3'] = 'images/mask06.png'; 98 99 $img['frame1'] = 'images/frame1.png'; 100 $img['frame2'] = 'images/frame2.png'; 101 102 $img['bmp'] = 'images/winnt.bmp'; 103 $img['tiff'] = 'images/1024-none.tiff'; 104 $img['wmf'] = 'images/computer.wmf'; 105 106 $img['small'] = 'images/small.jpg'; 107 $img['big'] = 'images/big.jpg'; 108 109 $png_alpha = 'Note: PNG/ICO output is 32-bit with alpha transparency, subject to <a href="http://www.silisoftware.com/png_alpha_transparency/" target="_blank">PNG transparency problem</a> in Internet Explorer'; 110 $only_gd = '<br>(only works with GD (any version), this server is '.($ServerInfo['gd_string'] ? 'running GD "<i>'.$ServerInfo['gd_string'].'</i>" so it <b><font color="green">will</font>' : 'not running any recognized version of GD so it <b><font color="red">will not</font>').'</b> work)'; 111 $only_gd2 = '<br>(only works with GD v2.0+, this server is running GD "<i>'.($ServerInfo['gd_string'] ? $ServerInfo['gd_string'] : 'n/a').'</i>" so it <b>'.(($ServerInfo['gd_numeric'] >= 2) ? '<font color="green">will</font>' : '<font color="red">will not</font>').'</b> work)'; 112 $only_php42 = '<br>(only works with PHP v4.2.0+, this server is running PHP v'.phpversion().' so it <b>'.(version_compare(phpversion(), '4.2.0', '>=') ? '<font color="green">will</font>' : '<font color="red">will not</font>').'</b> work)'; 113 $only_php43 = '<br>(only works with PHP v4.3.0+, this server is running PHP v'.phpversion().' so it <b>'.(version_compare(phpversion(), '4.3.0', '>=') ? '<font color="green">will</font>' : '<font color="red">will not</font>').'</b> work)'; 114 $only_php432 = '<br>(only works with PHP v4.3.2+, this server is running PHP v'.phpversion().' so it <b>'.(version_compare(phpversion(), '4.3.2', '>=') ? '<font color="green">will</font>' : '<font color="red">will not</font>').'</b> work (correctly))'; 115 $only_php500 = '<br>(only works with PHP v5.0.0+, this server is running PHP v'.phpversion().' so it <b>'.(version_compare(phpversion(), '5.0.0', '>=') ? '<font color="green">will</font>' : '<font color="red">will not</font>').'</b> work (correctly))'; 116 $php5_or_IM = '<br>(only works with PHP v5.0.0+ <i>or</i> ImageMagick, this server is running PHP v'.phpversion().' and "<i>'.($ServerInfo['im_version'] ? $ServerInfo['im_version'] : 'n/a').'</i>" so it <b>'.(($ServerInfo['im_version'] && version_compare(phpversion(), '5.0.0', '>=')) ? '<font color="green">will</font>' : '<font color="red">will not</font>').'</b> work (correctly))'; 117 $only_exif = '<br>(only works when the EXIF extension is loaded, so on this server it <b>'.(extension_loaded('exif') ? '<font color="green">will</font>' : '<font color="red">will not</font>').'</b> work)'; 118 $only_im = '<br>(requires ImageMagick, this server is running "<i>'.($ServerInfo['im_version'] ? $ServerInfo['im_version'] : 'n/a').'</i>" so it <b>'.($ServerInfo['im_version'] ? '<font color="green">will</font>' : '<font color="red">will not</font>').'</b> work)'; 119 120 $Examples[] = array('getstrings' => array($phpThumbBase), 'description' => 'phpThumb version'); 121 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['square'].'&w=200'), 'description' => 'width=200px'); 122 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['square'].'&w=200&q=10'), 'description' => 'width=200px, JPEGquality=10%'); 123 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['watermark'].'&w=400&aoe=1&bg=ffffff'), 'description' => 'width=400px, AllowOutputEnlargement enabled'); 124 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['square'].'&w=250&sx=600&sy=5&sw=100&sh=100&aoe=1'), 'description' => 'section from (600x5 - 700x105) cropped and enlarged by 250%, AllowOutputEnlargement enabled'); 125 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.urlencode('http://silisoftware.com/images/SiliSoft.gif').'&w=100'), 'description' => 'HTTP source image'.$only_gd); 126 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['square'].'&w=200&fltr[]=wmi|'.$img['watermark'].'|BL'), 'description' => 'width=200px, watermark (bottom-left, 75% opacity)'.$only_gd); 127 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['square'].'&w=200&fltr[]=wmi|'.$img['watermark'].'|*|25'), 'description' => 'width=200px, watermark (tiled, 25% opacity)'.$only_gd); 128 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['watermark'].'&bg=00FFFF&f=png', $phpThumbBase.'?src='.$img['watermark'].'&bg=00FFFF&f=gif', $phpThumbBase.'?src='.$img['watermark'].'&bg=00FFFF&f=jpeg'), 'description' => 'source image (GIF) transpancy with transparent output (PNG, GIF) vs. specified background color (JPEG)'); 129 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['anigif'], $phpThumbBase.'?src='.$img['anigif'].'&w=25&f=gif', $phpThumbBase.'?src='.$img['anigif'].'&w=25&f=png', $phpThumbBase.'?src='.$img['anigif'].'&w=25&f=ico', $phpThumbBase.'?src='.$img['anigif'].'&w=25&f=bmp', $phpThumbBase.'?src='.$img['anigif'].'&w=25&f=jpeg'), 'description' => 'resize animated GIF. Notice how output format affects the result: GIF is animated and transparent; PNG and ICO are tranparent but not animated (first frame is rendered as a still image); JPEG and BMP are neither transparent nor animated. Any filters will disable animated resizing (may be fixed in a future version).<br>'.$only_im); 130 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['alpha'].'&f=png', $phpThumbBase.'?src='.$img['alpha'].'&f=ico', $phpThumbBase.'?src='.$img['alpha'].'&f=gif', $phpThumbBase.'?src='.$img['alpha'].'&f=jpeg'), 'description' => 'PNG alpha transparency test, using test image from the <a href="http://trific.ath.cx/web/png/">PNG transparency test page</a>'.$only_php432); 131 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=usm|80|0.5|3'), 'description' => 'normal vs. unsharp masking at default settings'.$only_gd2); 132 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=blur|1', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=blur|5'), 'description' => 'normal vs. blur at default (1) and heavy (5)'.$only_gd2); 133 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=gblr', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=sblr'), 'description' => 'normal vs. gaussian blur vs. selective blur'.$only_php500.$only_gd2); 134 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['portrait'].'&w=100&h=100&far=L&bg=0000FF&f=png&fltr[]=bord|1', $phpThumbBase.'?src='.$img['landscape'].'&w=100&h=100&far=T&bg=FF0000&f=png&fltr[]=bord|1', $phpThumbBase.'?src='.$img['portrait'].'&w=100&h=100&far=C&bg=0000FF&f=png&fltr[]=bord|1', $phpThumbBase.'?src='.$img['landscape'].'&w=100&h=100&far=B&bg=FF0000&f=png&fltr[]=bord|1', $phpThumbBase.'?src='.$img['portrait'].'&w=100&h=100&far=R&bg=0000FF&f=png&fltr[]=bord|1'), 'description' => 'Forced Aspect Ratio, colored background, PNG output'.$only_gd); 135 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['portrait'].'&w=150&ar=L', $phpThumbBase.'?src='.$img['landscape'].'&w=150&ar=L'), 'description' => 'auto-rotate counter-clockwise to landscape from portrait & lanscape'.$only_php42.$only_gd); 136 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['portrait'].'&hp=100&wl=200', $phpThumbBase.'?src='.$img['landscape'].'&hp=100&wl=200'), 'description' => 'auto-selection of W and H based on source image orientation'); 137 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['unrotated'].'&w=150&h=150', $phpThumbBase.'?src='.$img['unrotated'].'&w=150&h=150&ar=x'), 'description' => 'original image vs. auto-rotated based on EXIF data'.$only_php42.$only_exif.$only_gd); 138 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&ra=30&bg=0000FF', $phpThumbBase.'?src='.$img['landscape'].'&w=200&ra=30&f=png', $phpThumbBase.'?src='.$img['alpha'].'&ra=30&f=png', $phpThumbBase.'?src='.$img['alpha'].'&ra=30&f=gif'), 'description' => 'Rotated 30° (counter-clockwise), width=200px, blue background vs. transparent background vs. rotated image with pre-existing alpha'.$only_php42.$only_gd); 139 //$Examples[] = array('getstrings' => array($phpThumbBase.'?src=images/1-bit.gif&ra=30&f=png', $phpThumbBase.'?src=images/4-bit.gif&ra=30&f=png', $phpThumbBase.'?src=images/8-bit.gif&ra=30&f=png'), 'description' => '2-color, 16-color, 256-color transparent GIFs'.$only_php42.$only_gd); 140 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&h=300&far=1&bg=CCCCCC', $phpThumbBase.'?src='.$img['landscape'].'&w=200&h=300&iar=1'), 'description' => 'Normal resize behavior (left) vs. Forced non-proportional resize (right)'.$only_gd); 141 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=100&h=50&zc=1', $phpThumbBase.'?src='.$img['landscape'].'&w=100&zc=1', $phpThumbBase.'?src='.$img['landscape'].'&h=50&zc=1', $phpThumbBase.'?src='.$img['portrait'].'&w=100&h=50&zc=1', $phpThumbBase.'?src='.$img['portrait'].'&w=100&zc=1', $phpThumbBase.'?src='.$img['portrait'].'&h=50&zc=1'), 'description' => 'Zoom-Crop'); 142 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=crop|50', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=crop|0|0|0|0.25'), 'description' => 'crop filter'); 143 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=bord|2|20|10|009900&f=png'), 'description' => '2px border, curved border corners (20px horizontal radius, 10px vertical radius)'.$only_gd); 144 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=ric|50|20&f=png'), 'description' => 'curved border corners (20px vertical radius, 50px horizontal radius)<br>'.$png_alpha.$only_gd2.$only_php432); 145 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=sat|75', $phpThumbBase.'?src='.$img['landscape'].'&w=200', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=sat|-100'), 'description' => 'saturation -75% vs. normal vs. -100%'.$only_gd2); 146 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=ds|75', $phpThumbBase.'?src='.$img['landscape'].'&w=200', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=ds|-100'), 'description' => 'desaturated 75% vs. normal vs. -100%'.$only_gd2); 147 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=clr|25|00FF00'), 'description' => 'colorized 25% to green (#00FF00)'.$only_gd2); 148 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=gray', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=sep'), 'description' => 'grayscale vs. sepia'.$only_gd2); 149 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=mask|'.$img['mask3'].'&f=png', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=mask|'.$img['mask1'].'&f=png', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=mask|'.$img['mask2'].'&f=jpeg&bg=9900CC&q=100'), 'description' => 'Assorted alpha masks (seen below) applied<br>'.$png_alpha.$only_php432.'<br>JPEG/GIF output is flattened to "bg" background color'.$only_gd2.'<br><img src="../'.$img['mask3'].'"> <img src="../'.$img['mask1'].'"> <img src="../'.$img['mask2'].'">'); 150 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=drop|5|10|000000|225&f=png', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=mask|'.$img['mask3'].'&fltr[]=drop|5|10|000000|225&f=png', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=drop|5|10|000000|225&fltr[]=elip&f=png', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=elip&fltr[]=drop|5|10|000000|225&f=png'), 'description' => 'Drop shadow. Note how the order in which filters are applied matters.'.$only_php432.$only_gd); 151 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=elip&f=png', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=elip&f=jpeg&bg=00FFFF'), 'description' => 'Elipse<br>'.$png_alpha.$only_php432.'<br>JPEG/GIF output is flattened to "bg" background color'.$only_gd2); 152 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=flip|x', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=flip|y', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=flip|xy'), 'description' => 'flipped on X, Y and X+Y axes'.$only_gd); 153 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=bvl|10|FFFFFF|000000', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=bvl|10|000000|FFFFFF'), 'description' => '10px bevel edge filter'.$only_php432.$only_gd); 154 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=fram|3|2|CCCCCC|FFFFFF|000000', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=fram|3|2|CC9966|333333|CCCCCC'), 'description' => '3+2px frame filter'.$only_gd); 155 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=neg'), 'description' => 'Negative filter (inverted color)'.$only_gd); 156 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=th|105', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=mask|'.$img['mask1'].'&fltr[]=th|105&f=png'), 'description' => 'Threshold filter; showing preserved alpha channel'.$only_php432.$only_gd); 157 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['portrait'].'&w=150', $phpThumbBase.'?src='.$img['portrait'].'&w=150&fltr[]=rcd|16|1', $phpThumbBase.'?src='.$img['portrait'].'&w=150&fltr[]=rcd|16|0', $phpThumbBase.'?src='.$img['portrait'].'&w=150&fltr[]=gray&fltr[]=rcd|8|1'), 'description' => 'ReduceColorDepth filter; original vs. 16-color dither vs. 16-color nodither vs. 4-gray dither'.$only_gd2); 158 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['levels'].'&w=200', $phpThumbBase.'?src='.$img['levels'].'&w=200&fltr[]=lvl'), 'description' => 'original vs. Levels filter (default settings)'.$only_gd); 159 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['portrait'].'&w=200', $phpThumbBase.'?src='.$img['portrait'].'&w=200&fltr[]=wb', $phpThumbBase.'?src='.$img['portrait'].'&w=200&fltr[]=wb&fltr[]=lvl'), 'description' => 'original vs. White Balance vs. White Balance + Levels'.$only_gd); 160 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=300&fltr[]=hist|rgb', $phpThumbBase.'?src='.$img['levels'].'&w=200&fltr[]=hist|*'), 'description' => 'histograms of RGB vs. grayscale'.$only_gd); 161 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=300&fltr[]=edge'), 'description' => 'Edge Detect filter'.$php5_or_IM.$only_gd2); 162 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=300&fltr[]=emb'), 'description' => 'Emboss filter'.$php5_or_IM.$only_gd2); 163 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=300&fltr[]=mean'), 'description' => 'Mean Removal filter'.$only_php500.$only_gd2); 164 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=300&fltr[]=smth'), 'description' => 'Smooth filter'.$only_php500.$only_gd2); 165 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=gam|0.6', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=gam|1.6'), 'description' => 'Gamma corrected to 0.6 vs. 1.6'.$only_gd); 166 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=brit|50', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=brit|-50'), 'description' => 'Brightness filter (original vs. +50 vs. -50)'.$only_gd2); 167 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=cont|50', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=cont|-50'), 'description' => 'Contrast filter (original vs. +50 vs. -50)'.$only_gd2); 168 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['portrait'].'&w=200&fltr[]=over|'.$img['frame1'].'|0', $phpThumbBase.'?src='.$img['portrait'].'&w=200&fltr[]=over|'.$img['frame2'].'|1'), 'description' => 'Overlay vs. Underlay<br><br>Original over/under images:<br><table border="0"><tr><td style="padding: 20px; background-image: url(../'.$img['background'].');"><img src="../'.$img['frame1'].'"> <img src="../'.$img['frame2'].'"></td></tr></table>'.$only_gd); 169 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=wmt|phpThumb|18|C|FF0000|loki.ttf|100|5|20&f=png', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=wmt|'.rawurlencode('☺♫ǖڞ').'|40|L|FF0000|arial.ttf|100&f=png', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=wmt|copyright+'.date('Y').'|3|BR|00FFFF||50&f=png', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=wmt|copyright+'.date('Y').'%0AphpThumb()|3|L|00FFFF&f=png'), 'description' => 'Text overlay, TTF and built-in fonts, unicode characters (rawurlencoded HTMLentities), multiple lines, metacharacters (height, width)'.$only_gd); 170 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=wmt|thumbnail+=+^Xx^Y|3|BR|00FFFF||50&f=png', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=wmt|click%0Ahere%0A^FkkB|10|L|FF00FF|arial.ttf|100|0||333399|50|y&f=png', $phpThumbBase.'?src='.$img['landscape'].'&w=200&fltr[]=wmt|resized:+^Xx^Y+to+^xx^y|10|B|FFFFFF|arial.ttf|100|0||000000|100|x&f=png'), 'description' => 'metacharacters (height, width), background color, background extend'.$only_gd); 171 $Examples[] = array('getstrings' => array($phpThumbBase.'?new=FF0000&w=100&h=50&fltr[]=bvl|10&fltr[]=wmt|hello|14|C|00FFFF|arial.ttf&f=png', $phpThumbBase.'new=FF0000|25&w=150&h=50&fltr[]=bvl|10&fltr[]=wmt|25%+opaque|14|C|0066FF|arial.ttf&f=png'), 'description' => 'Image created with "new", red background, bevel, TTF text'.$only_gd); 172 173 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['bmp'].'&w=200'), 'description' => 'BMP source, width=200px'); 174 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['tiff'], $phpThumbBase.'?src='.$img['tiff'].'&w=200&aoe=1'), 'description' => 'TIFF source, width=200px'.$only_im); 175 $Examples[] = array('getstrings' => array($phpThumbBase.'?src='.$img['wmf'].'&w=200'), 'description' => 'WMF source, width=200px'.$only_im); 176 //$Examples[] = array('getstrings' => array(''), 'description' => ''); 177 178 foreach ($Examples as $key => $ExamplesArray) { 179 echo '<a href="#" name="'.$key.'" title="click to get URL link for example #'.$key.'" onClick="prompt(\'Here is the link to example #'.$key.'\', \'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'#'.$key.'\'); return false;">#'.$key.'</a>'; 180 echo '<table border="0"><tr><td style="padding: 20px; background-image: url(../'.$img['background'].');">'; 181 foreach ($ExamplesArray['getstrings'] as $dummy => $GETstring) { 182 echo '<a href="'.$GETstring.'&down='.urlencode($GETstring).'" title="'.htmlentities(str_replace($phpThumbBase, '', $GETstring), ENT_QUOTES).'">'; 183 echo '<img border="0" src="'.$GETstring.'">'; 184 echo '</a> '; 185 } 186 echo '</td></tr></table>'; 187 echo '<xmp><img src="'.implode('">'."\n".'<img src="', $ExamplesArray['getstrings']).'"></xmp>'; 188 echo $ExamplesArray['description'].'<br>'; 189 echo '<br><br><hr size="1">'; 190 } 191 192 $PATH_INFO_examples = array( 193 'fltr[]=sep;200x200;'.$img['portrait'], 194 'f=png;fltr[]=wmt|hello;fltr[]=flip|y;fltr[]=wmt|hello;200x100;new=FF00FF', 195 ); 196 197 echo '<a href="#" name="pathinfo" title="click to get URL link for PATH_INFO example" onClick="prompt(\'Here is the link to the PATH_INFO example\', \'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'#pathinfo\'); return false;">#pathinfo</a>'; 198 echo '<table border="0"><tr><td style="padding: 20px; background-image: url(../'.$img['background'].');">'; 199 foreach ($PATH_INFO_examples as $key => $value) { 200 echo ' <img src="'.$phpThumbBase.'/'.$value.'"> '; 201 } 202 echo '</td></tr></table>'; 203 echo '<xmp>'; 204 foreach ($PATH_INFO_examples as $key => $value) { 205 echo ' <img src="'.$phpThumbBase.'/'.$value.'"> '."\n"; 206 } 207 echo '</xmp>'; 208 echo 'PATH_INFO example<br>'; 209 echo '<br><br><hr size="1">'; 210