Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PHP Image Generation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
michaelr
n00b
n00b


Joined: 25 Jun 2002
Posts: 13

PostPosted: Fri Jun 28, 2002 4:29 am    Post subject: PHP Image Generation Reply with quote

I'm trying to generate PNG images using PHP. Here is the code I'm using:
Code:
<?php

    $image = imagecreate(200, 200)
        or die("Could not initialize GD image stream.");

    $white = imagecolorallocate($image, 0xff, 0xff, 0xff);
    $black = imagecolorallocate($image, 0x00, 0x00, 0x00);

    imagefilledrectangle($image, 50, 50, 150, 150, $black);

    header('Content-Type: image/png');
    imagepng($image);

?>


I don't get anything back. This code works.... I've tried it on another box running an earlier version of PHP. My version of PHP (4.2.1-r1) reports the necessary options (in the GD section). However, if I change the appropiate lines to generate a JPEG image, it works. This makes me think that it's a bug in the Gentoo version.

Any thoughts?
Back to top
View user's profile Send private message
masaclaw
n00b
n00b


Joined: 18 Jul 2002
Posts: 23
Location: Welly, NZ

PostPosted: Thu Jul 18, 2002 3:56 am    Post subject: Reply with quote

Try this:

https://forums.gentoo.org/viewtopic.php?t=8603

-Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum