mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-05 07:37:37 +02:00
Moved all test-files into own directory.
This commit is contained in:
73
webroot/test/test.php
Normal file
73
webroot/test/test.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<!doctype html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<title>Testing img resizing using CImage.php</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Testing <code>CImage.php</code> through <code>img.php</code></h1>
|
||||
|
||||
<h2>Testcases</h2>
|
||||
|
||||
<?php
|
||||
$testcase = array(
|
||||
array('text'=>'Original image', 'query'=>''),
|
||||
array('text'=>'Crop out a rectangle of 100x100, start by position 200x200.', 'query'=>'&crop=100,100,200,200'),
|
||||
array('text'=>'Crop out a full width rectangle with height of 200, start by position 0x100.', 'query'=>'&crop=0,200,0,100'),
|
||||
array('text'=>'Max width 200.', 'query'=>'&w=200'),
|
||||
array('text'=>'Max height 200.', 'query'=>'&h=200'),
|
||||
array('text'=>'Max width 200 and max height 200.', 'query'=>'&w=200&h=200'),
|
||||
array('text'=>'No-ratio makes image fit in area of width 200 and height 200.', 'query'=>'&w=200&h=200&no-ratio'),
|
||||
array('text'=>'Crop to fit in width 200 and height 200.', 'query'=>'&w=200&h=200&crop-to-fit'),
|
||||
array('text'=>'Crop to fit in width 200 and height 100.', 'query'=>'&w=200&h=100&crop-to-fit'),
|
||||
array('text'=>'Crop to fit in width 100 and height 200.', 'query'=>'&w=100&h=200&crop-to-fit'),
|
||||
array('text'=>'Quality 70', 'query'=>'&w=200&h=200&quality=70'),
|
||||
array('text'=>'Quality 40', 'query'=>'&w=200&h=200&quality=40'),
|
||||
array('text'=>'Quality 10', 'query'=>'&w=200&h=200&quality=10'),
|
||||
array('text'=>'Filter: Negate', 'query'=>'&w=200&h=200&f=negate'),
|
||||
array('text'=>'Filter: Grayscale', 'query'=>'&w=200&h=200&f=grayscale'),
|
||||
array('text'=>'Filter: Brightness 90', 'query'=>'&w=200&h=200&f=brightness,90'),
|
||||
array('text'=>'Filter: Contrast 50', 'query'=>'&w=200&h=200&f=contrast,50'),
|
||||
array('text'=>'Filter: Colorize 0,255,0,0', 'query'=>'&w=200&h=200&f=colorize,0,255,0,0'),
|
||||
array('text'=>'Filter: Edge detect', 'query'=>'&w=200&h=200&f=edgedetect'),
|
||||
array('text'=>'Filter: Emboss', 'query'=>'&w=200&h=200&f=emboss'),
|
||||
array('text'=>'Filter: Gaussian blur', 'query'=>'&w=200&h=200&f=gaussian_blur'),
|
||||
array('text'=>'Filter: Selective blur', 'query'=>'&w=200&h=200&f=selective_blur'),
|
||||
array('text'=>'Filter: Mean removal', 'query'=>'&w=200&h=200&f=mean_removal'),
|
||||
array('text'=>'Filter: Smooth 2', 'query'=>'&w=200&h=200&f=smooth,2'),
|
||||
array('text'=>'Filter: Pixelate 10,10', 'query'=>'&w=200&h=200&f=pixelate,10,10'),
|
||||
array('text'=>'Multiple filter: Negate, Grayscale and Pixelate 10,10', 'query'=>'&w=200&h=200&&f=negate&f0=grayscale&f1=pixelate,10,10'),
|
||||
array('text'=>'Crop with width & height and crop-to-fit with quality and filter', 'query'=>'&crop=100,100,100,100&w=200&h=200&crop-to-fit&q=70&f0=grayscale'),
|
||||
);
|
||||
?>
|
||||
|
||||
<h3>Test case with image <code>wider.jpg</code></h3>
|
||||
<table>
|
||||
<caption>Test case with image <code>wider.jpg</code></caption>
|
||||
<thead><tr><th>Testcase:</th><th>Result:</th></tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($testcase as $key => $val) {
|
||||
$url = "../img.php?src=wider.jpg{$val['query']}";
|
||||
echo "<tr><td id=w$key><a href=#w$key>$key</a></br>{$val['text']}</br><code><a href='$url'>".htmlentities($url)."</a></code></td><td><img src='$url' /></td></tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Test case with image <code>higher.jpg</code></h3>
|
||||
<table>
|
||||
<caption>Test case with image <code>higher.jpg</code></caption>
|
||||
<thead><tr><th>Testcase:</th><th>Result:</th></tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($testcase as $key => $val) {
|
||||
$url = "../img.php?src=higher.jpg{$val['query']}";
|
||||
echo "<tr><td id=h$key><a href=#h$key>$key</a></br>{$val['text']}</br><code><a href='$url'>".htmlentities($url)."</a></code></td><td><img src='$url' /></td></tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
75
webroot/test/test_issue29.php
Normal file
75
webroot/test/test_issue29.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<!doctype html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<title>Testing img for issue 29</title>
|
||||
<style>
|
||||
body {background-color: #ccc;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Testing issue 29</h1>
|
||||
|
||||
<?php
|
||||
error_reporting(-1); // Report all type of errors
|
||||
ini_set('display_errors', 1); // Display all errors
|
||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
||||
|
||||
echo "<p>Version of PHP is: " . phpversion();
|
||||
|
||||
$imgphp = "../img.php?src=";
|
||||
|
||||
$images = array(
|
||||
'issue29/400x265.jpg',
|
||||
'issue29/400x268.jpg',
|
||||
'issue29/400x300.jpg',
|
||||
'issue29/465x304.jpg',
|
||||
'issue29/640x273.jpg',
|
||||
);
|
||||
|
||||
|
||||
$testcase = array(
|
||||
'&w=300&cf&q=80&nc',
|
||||
'&w=75&h=75&cf&q=80&nc',
|
||||
'&w=75&h=75&q=80',
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
<h2>Images used in test</h2>
|
||||
|
||||
<p>The following images are used for this test.</p>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Testcases used for each image</h2>
|
||||
|
||||
<p>The following testcases are used for each image.</p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<code><?=$tc?></code><br>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Applying testcase for each image</h2>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<h3><?=$image?></h3>
|
||||
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<h4><?=$tc?></h4>
|
||||
|
||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
77
webroot/test/test_issue36_aro.php
Normal file
77
webroot/test/test_issue36_aro.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<!doctype html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<title>Testing img for issue 36 - autoRotate</title>
|
||||
<style>
|
||||
body {background-color: #ccc;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Testing issue 36 - autoRotate</h1>
|
||||
|
||||
<?php
|
||||
error_reporting(-1); // Report all type of errors
|
||||
ini_set('display_errors', 1); // Display all errors
|
||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
||||
|
||||
$imgphp = "../img.php?src=";
|
||||
|
||||
$images = array(
|
||||
'issue36/me-0.jpg',
|
||||
'issue36/me-90.jpg',
|
||||
'issue36/me-180.jpg',
|
||||
'issue36/me-270.jpg',
|
||||
'issue36/flower-0.jpg',
|
||||
'issue36/flower-90.jpg',
|
||||
'issue36/flower-180.jpg',
|
||||
'issue36/flower-270.jpg',
|
||||
);
|
||||
|
||||
|
||||
$testcase = array(
|
||||
'&aro&nc',
|
||||
'&aro&nc&w=200',
|
||||
'&aro&nc&h=200',
|
||||
'&aro&nc&w=200&h=200&cf',
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
<h2>Images used in test</h2>
|
||||
|
||||
<p>The following images are used for this test.</p>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Testcases used for each image</h2>
|
||||
|
||||
<p>The following testcases are used for each image.</p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<code><?=$tc?></code><br>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Applying testcase for each image</h2>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<h3><?=$image?></h3>
|
||||
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<h4><?=$tc?></h4>
|
||||
|
||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
76
webroot/test/test_issue36_rb-ra-180.php
Normal file
76
webroot/test/test_issue36_rb-ra-180.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
$angle = 180;
|
||||
?><!doctype html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<title>Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?></title>
|
||||
<style>
|
||||
body {background-color: #ccc;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Testing issue 36 - rotateBefore, rotateAfter <?=$angle?></h1>
|
||||
|
||||
<?php
|
||||
error_reporting(-1); // Report all type of errors
|
||||
ini_set('display_errors', 1); // Display all errors
|
||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
||||
|
||||
$imgphp = "../img.php?src=";
|
||||
|
||||
$images = array(
|
||||
'kodim08.png',
|
||||
'kodim04.png',
|
||||
);
|
||||
|
||||
$testcase = array(
|
||||
"&rb=$angle&nc",
|
||||
"&rb=$angle&nc&w=200",
|
||||
"&rb=$angle&nc&h=200",
|
||||
"&rb=$angle&nc&w=200&h=200&cf",
|
||||
"&ra=$angle&nc",
|
||||
"&ra=$angle&nc&w=200",
|
||||
"&ra=$angle&nc&h=200",
|
||||
"&ra=$angle&nc&w=200&h=200&cf",
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
<h2>Images used in test</h2>
|
||||
|
||||
<p>The following images are used for this test.</p>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Testcases used for each image</h2>
|
||||
|
||||
<p>The following testcases are used for each image.</p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<code><?=$tc?></code><br>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Applying testcase for each image</h2>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<h3><?=$image?></h3>
|
||||
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<h4><?=$tc?></h4>
|
||||
|
||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
76
webroot/test/test_issue36_rb-ra-270.php
Normal file
76
webroot/test/test_issue36_rb-ra-270.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
$angle = 270;
|
||||
?><!doctype html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<title>Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?></title>
|
||||
<style>
|
||||
body {background-color: #ccc;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Testing issue 36 - rotateBefore, rotateAfter <?=$angle?></h1>
|
||||
|
||||
<?php
|
||||
error_reporting(-1); // Report all type of errors
|
||||
ini_set('display_errors', 1); // Display all errors
|
||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
||||
|
||||
$imgphp = "../img.php?src=";
|
||||
|
||||
$images = array(
|
||||
'kodim08.png',
|
||||
'kodim04.png',
|
||||
);
|
||||
|
||||
$testcase = array(
|
||||
"&rb=$angle&nc",
|
||||
"&rb=$angle&nc&w=200",
|
||||
"&rb=$angle&nc&h=200",
|
||||
"&rb=$angle&nc&w=200&h=200&cf",
|
||||
"&ra=$angle&nc",
|
||||
"&ra=$angle&nc&w=200",
|
||||
"&ra=$angle&nc&h=200",
|
||||
"&ra=$angle&nc&w=200&h=200&cf",
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
<h2>Images used in test</h2>
|
||||
|
||||
<p>The following images are used for this test.</p>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Testcases used for each image</h2>
|
||||
|
||||
<p>The following testcases are used for each image.</p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<code><?=$tc?></code><br>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Applying testcase for each image</h2>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<h3><?=$image?></h3>
|
||||
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<h4><?=$tc?></h4>
|
||||
|
||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
78
webroot/test/test_issue36_rb-ra-45.php
Normal file
78
webroot/test/test_issue36_rb-ra-45.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
$angle = 45;
|
||||
?><!doctype html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<title>Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?></title>
|
||||
<style>
|
||||
body {background-color: #ccc;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Testing issue 36 - rotateBefore, rotateAfter <?=$angle?></h1>
|
||||
|
||||
<?php
|
||||
error_reporting(-1); // Report all type of errors
|
||||
ini_set('display_errors', 1); // Display all errors
|
||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
||||
|
||||
$imgphp = "../img.php?src=";
|
||||
|
||||
$images = array(
|
||||
'kodim08.png',
|
||||
'kodim04.png',
|
||||
);
|
||||
|
||||
$testcase = array(
|
||||
"&rb=$angle&bgc=ffffff&nc",
|
||||
"&rb=$angle&bgc=ffffff&nc&w=200",
|
||||
"&rb=$angle&bgc=ffffff&nc&h=200",
|
||||
"&rb=$angle&bgc=ffffff&nc&w=200&h=200&cf",
|
||||
"&rb=$angle&bgc=ffffff&nc&w=200&h=200&cf&crop=200,200,center,center",
|
||||
"&ra=$angle&bgc=ffffff&nc",
|
||||
"&ra=$angle&bgc=ffffff&nc&w=200",
|
||||
"&ra=$angle&bgc=ffffff&nc&h=200",
|
||||
"&ra=$angle&bgc=ffffff&nc&w=200&h=200&cf",
|
||||
"&ra=$angle&bgc=ffffff&nc&w=200&h=200&cf&crop=200,200,center,center",
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
<h2>Images used in test</h2>
|
||||
|
||||
<p>The following images are used for this test.</p>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Testcases used for each image</h2>
|
||||
|
||||
<p>The following testcases are used for each image.</p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<code><?=$tc?></code><br>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Applying testcase for each image</h2>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<h3><?=$image?></h3>
|
||||
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<h4><?=$tc?></h4>
|
||||
|
||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
76
webroot/test/test_issue36_rb-ra-90.php
Normal file
76
webroot/test/test_issue36_rb-ra-90.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
$angle = 90;
|
||||
?><!doctype html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<title>Testing img for issue 36 - rotateBefore, rotateAfter <?=$angle?></title>
|
||||
<style>
|
||||
body {background-color: #ccc;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Testing issue 36 - rotateBefore, rotateAfter <?=$angle?></h1>
|
||||
|
||||
<?php
|
||||
error_reporting(-1); // Report all type of errors
|
||||
ini_set('display_errors', 1); // Display all errors
|
||||
ini_set('output_buffering', 0); // Do not buffer outputs, write directly
|
||||
|
||||
$imgphp = "../img.php?src=";
|
||||
|
||||
$images = array(
|
||||
'kodim08.png',
|
||||
'kodim04.png',
|
||||
);
|
||||
|
||||
$testcase = array(
|
||||
"&rb=$angle&nc",
|
||||
"&rb=$angle&nc&w=200",
|
||||
"&rb=$angle&nc&h=200",
|
||||
"&rb=$angle&nc&w=200&h=200&cf",
|
||||
"&ra=$angle&nc",
|
||||
"&ra=$angle&nc&w=200",
|
||||
"&ra=$angle&nc&h=200",
|
||||
"&ra=$angle&nc&w=200&h=200&cf",
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
<h2>Images used in test</h2>
|
||||
|
||||
<p>The following images are used for this test.</p>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Testcases used for each image</h2>
|
||||
|
||||
<p>The following testcases are used for each image.</p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<code><?=$tc?></code><br>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
|
||||
<h2>Applying testcase for each image</h2>
|
||||
|
||||
<?php foreach($images as $image) : ?>
|
||||
<h3><?=$image?></h3>
|
||||
|
||||
<p><code><a href="img/<?=$image?>"><?=$image?></a></code><br>
|
||||
<img src="<?=$imgphp . $image?>"></p>
|
||||
|
||||
<?php foreach($testcase as $tc) : ?>
|
||||
<h4><?=$tc?></h4>
|
||||
|
||||
<p><code><a href="<?=$imgphp . $image . $tc?>"><?=$image . $tc?></a></code><br>
|
||||
<img src="<?=$imgphp . $image . $tc?>"></p>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
Reference in New Issue
Block a user