~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/gd/tests/xpm2gd.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
xpm --> gd1/gd2 conversion test
 
3
--SKIPIF--
 
4
<?php 
 
5
        if (!extension_loaded('gd')) {
 
6
                die("skip gd extension not available.");
 
7
        }
 
8
        if (!GD_BUNDLED) {
 
9
                die("skip external GD libraries always fail");
 
10
        }       
 
11
        if (!function_exists("imagecreatefromxpm")) {
 
12
                die("skip xpm read support unavailable");
 
13
        }
 
14
?>
 
15
--FILE--
 
16
<?php
 
17
        $cwd = dirname(__FILE__);
 
18
 
 
19
        echo "XPM to GD1 conversion: ";
 
20
        echo imagegd(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test.gd1") ? 'ok' : 'failed';
 
21
        echo "\n";
 
22
        
 
23
        echo "XPM to GD2 conversion: ";
 
24
        echo imagegd2(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test.gd2") ? 'ok' : 'failed';
 
25
        echo "\n";
 
26
        
 
27
        @unlink($cwd . "/test.gd1");
 
28
        @unlink($cwd . "/test.gd2");
 
29
?>
 
30
--EXPECT--
 
31
XPM to GD1 conversion: ok
 
32
XPM to GD2 conversion: ok