Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
2
<HTML>
3
<HEAD>
4
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
5
<LINK REL="Start" HREF="index.html">
6
<LINK REL="Contents" HREF="toc.html">
7
<LINK REL="Prev" HREF="31Preparation.html">
8
<LINK REL="Next" HREF="312VerifyingthatyouhaveGD2installed.html">
9
<STYLE TYPE="text/css"><!--
10
BODY { font-family: serif }
11
H1 { font-family: sans-serif }
12
H2 { font-family: sans-serif }
13
H3 { font-family: sans-serif }
14
H4 { font-family: sans-serif }
15
H5 { font-family: sans-serif }
16
H6 { font-family: sans-serif }
17
SUB { font-size: smaller }
18
SUP { font-size: smaller }
19
PRE { font-family: monospace }
20
A { text-decoration: none }
21
--></STYLE>
22
</HEAD>
23
<BODY>
24
<A HREF="toc.html">Contents</A>
25
<A HREF="31Preparation.html">Previous</A>
26
<A HREF="312VerifyingthatyouhaveGD2installed.html">Next</A>
27
<HR NOSHADE>
28
<H3><A NAME="3_1_1">3.1.1 Verifying that you have the GD library
29
 installed</A></H3>
30
<P> In order to make sure that the GD installed the following example
31
 would be run. The example creates a very simple image using just pure
32
 GD calls and outputs an image in PNG format. This could be considered a
33
 smoke-test to see that the GD library is available from PHP. Please
34
 note that this is an<B> absolute</B> pre-requisite in order for the
35
 JpGraph library to work at all.</P>
36
<P> Store the code snippet below somewhere in the document root and make
37
 sure it runs correctly.<DIV class="phpscript"><CODE><FONT color="#000000">
38
 <FONT color="#0000BB">&nbsp;$im&nbsp;</FONT><FONT color="#007700">=&nbsp;@</FONT><FONT color="#0000BB">
39
ImageCreate&nbsp;</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
40
150</FONT><FONT color="#007700">,&nbsp;</FONT><FONT color="#0000BB">100</FONT><FONT
41
color="#007700">)
42
<BR>&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;die&nbsp;(</FONT><FONT color="#DD0000">
43
&quot;Cannot&nbsp;create&nbsp;a&nbsp;new&nbsp;GD&nbsp;image.&quot;</FONT><FONT color="#007700">);
44
<BR></FONT><FONT color="#0000BB">$background_color&nbsp;</FONT><FONT color="#007700">
45
=&nbsp;</FONT><FONT color="#0000BB">ImageColorAllocate&nbsp;</FONT><FONT color="#007700">
46
(</FONT><FONT color="#0000BB">$im</FONT><FONT color="#007700">,&nbsp;</FONT><FONT
47
color="#0000BB">255</FONT><FONT color="#007700">,&nbsp;</FONT><FONT color="#0000BB">
48
255</FONT><FONT color="#007700">,&nbsp;</FONT><FONT color="#0000BB">255</FONT><FONT
49
color="#007700">);
50
<BR></FONT><FONT color="#0000BB">$text_color&nbsp;</FONT><FONT color="#007700">
51
=&nbsp;</FONT><FONT color="#0000BB">ImageColorAllocate&nbsp;</FONT><FONT color="#007700">
52
(</FONT><FONT color="#0000BB">$im</FONT><FONT color="#007700">,&nbsp;</FONT><FONT
53
color="#0000BB">233</FONT><FONT color="#007700">,&nbsp;</FONT><FONT color="#0000BB">
54
14</FONT><FONT color="#007700">,&nbsp;</FONT><FONT color="#0000BB">91</FONT><FONT
55
color="#007700">);
56
<BR></FONT><FONT color="#0000BB">ImageString&nbsp;</FONT><FONT color="#007700">
57
(</FONT><FONT color="#0000BB">$im</FONT><FONT color="#007700">,&nbsp;</FONT><FONT
58
color="#0000BB">1</FONT><FONT color="#007700">,&nbsp;</FONT><FONT color="#0000BB">
59
5</FONT><FONT color="#007700">,&nbsp;</FONT><FONT color="#0000BB">5</FONT><FONT
60
color="#007700">,&nbsp;&nbsp;</FONT><FONT color="#DD0000">&quot;A&nbsp;Simple&nbsp;Text&nbsp;String&quot;</FONT><FONT
61
color="#007700">,&nbsp;</FONT><FONT color="#0000BB">$text_color</FONT><FONT color="#007700">
62
);
63
<BR></FONT><FONT color="#0000BB">header&nbsp;</FONT><FONT color="#007700">(</FONT><FONT
64
color="#DD0000">&quot;Content-type:&nbsp;image/png&quot;</FONT><FONT color="#007700">);
65
<BR></FONT><FONT color="#0000BB">ImagePng&nbsp;</FONT><FONT color="#007700">(</FONT><FONT
66
color="#0000BB">$im</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB">
67
</FONT></FONT></CODE></DIV></P>
68
<P> If the above script does not work or some error or warnings are
69
 printed on the screen then it is necessary to correct those problems
70
 before proceeding with the installation.</P>
71
<HR NOSHADE>
72
<A HREF="toc.html">Contents</A>
73
<A HREF="31Preparation.html">Previous</A>
74
<A HREF="312VerifyingthatyouhaveGD2installed.html">Next</A>
75
</BODY>
76
</HTML>