-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathmod-gd-empty-gif.inc
More file actions
40 lines (34 loc) · 1006 Bytes
/
mod-gd-empty-gif.inc
File metadata and controls
40 lines (34 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* module gd+gif test functions
* Php 5.2+
*/
/** ---------------------------------- Tests functions -------------------------------------------- */
function test_40_01_gd_save_fill_empty_gif()
{
global $stringTest, $emptyResult, $testsLoopLimits, $totalOps;
if (!function_exists('imagegif')) {
return $emptyResult;
}
if (!function_exists('imagecreatetruecolor')) {
return $emptyResult;
}
if (!function_exists('imagefilledrectangle')) {
return $emptyResult;
}
// Create a new image instance
$im = imagecreatetruecolor(1, 1);
// Make the background white
imagefilledrectangle($im, 0, 0, 1, 1, 0xFFFFFF);
$count = $testsLoopLimits['40_01_gd_save_fill_empty_gif'];
$time_start = get_microtime();
$nillpath='/dev/null';
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$nillpath='\\.\NUL';
}
for ($i = 0; $i < $count; $i++) {
imagegif($im, $nillpath);
}
$totalOps += $count;
return format_result_test(get_microtime() - $time_start, $count, mymemory_usage());
}