4 # Axis--Image--Test.php 5 # Test scaffolding for the AxisPHP Image object. 7 # Copyright 2002-2003 Axis Data 8 # This code is free software that can be used or redistributed under the 9 # terms of Version 2 of the GNU General Public License, as published by the 10 # Free Software Foundation (http://www.fsf.org). 12 # Author: Edward Almasy (ealmasy@axisdata.com) 14 # Part of the AxisPHP library v1.2.5 15 # For more information see http://www.axisdata.com/AxisPHP/ 18 require_once(
"Axis--Image.php");
21 printf(
"Image Manipulation Method: %s<br>\n",
$Img->ImageManipulationMethod());
23 ?>Original #1:<br><img src=
"TestImage1.jpg"><br><br><br><?
PHP 26 $Img->ScaleTo(100, 100);
27 $Img->SaveAs(
"TestImage--TEMP1.jpg");
28 ?>JPEG scaled to 100w by 100h:<br><img src=
"TestImage--TEMP1.jpg"><br><br><br><?
PHP 30 $Img =
new Image(
"TestImage1.jpg");
31 $Img->ScaleTo(100, 100, TRUE);
32 $Img->SaveAs(
"TestImage--TEMP4.jpg");
33 ?>JPEG scaled to 100w by 100h with aspect ration maintained:<br><img src=
"TestImage--TEMP4.jpg"><br><br><br><?
PHP 35 $Img =
new Image(
"TestImage1.jpg");
36 $Img->CropTo(300, 200, 50, 300);
37 $Img->SaveAs(
"TestImage--TEMP2.jpg");
38 ?>JPEG cropped to 300w by 200h:<br><img src=
"TestImage--TEMP2.jpg"><br><br><br><?
PHP 40 $Img =
new Image(
"TestImage1.jpg");
41 $Img->CropTo(300, 200, 50, 300);
42 $Img->SaveAs(
"TestImage--TEMP2.jpg");
43 ?>JPEG cropped to 300w by 200h:<br><img src=
"TestImage--TEMP2.jpg"><br><br><br><?
PHP 45 if (imagetypes() & IMG_GIF)
47 $Img =
new Image(
"TestImage1.jpg");
48 $Img->ScaleTo(50, 300);
49 $Img->SaveAs(
"TestImage--TEMP3.gif");
50 ?>GIF scaled to 50w by 300h:<br><img src=
"TestImage--TEMP3.gif"><br><br><br><?
PHP 54 print(
"GIF image output not supported on this server<br><br><br>\n");
57 ?>Original #2:<br><img src=
"TestImage2.jpg"><br><br><br><?
PHP 59 $Img =
new Image(
"TestImage2.jpg");
60 $Img->ScaleTo(100, 100, TRUE);
61 $Img->SaveAs(
"TestImage--TEMP5.jpg");
62 ?>JPEG scaled to 100w by 100h with aspect ration maintained:<br><img src=
"TestImage--TEMP5.jpg"><br><br><br><?
PHP 64 $Img =
new Image(
"TestImage2.jpg");
65 $Img->ScaleTo(100, 200, TRUE);
66 $Img->SaveAs(
"TestImage--TEMP6.jpg");
67 ?>JPEG scaled to 100w by 200h with aspect ration maintained:<br><img src=
"TestImage--TEMP6.jpg"><br><br><br><?
PHP 69 $Img =
new Image(
"TestImage2.jpg");
70 $Img->ScaleTo(200, 100, TRUE);
71 $Img->SaveAs(
"TestImage--TEMP7.jpg");
72 ?>JPEG scaled to 200w by 100h with aspect ration maintained:<br><img src=
"TestImage--TEMP7.jpg"><br><br><br><?
PHP