Re: creating images to files
| From: | Richard Lynch | Date: | Sun, 07 Oct 2001 03:17:53 +0000 |
| Subject: | Re: creating images to files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70272@lists.php.net to get a copy of this message | ||
You shouldn't have a space between $ and im, and you would need to give
write access to 'pic.png' to either the world or at least to the 'nobody'
user.
That's a pretty big security problem, though...
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Robert Lenne <robert.lenne@hyperisland.se>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Saturday, October 06, 2001 1:39 PM
Subject: creating images to files
>
> Hi.
>
> I'm have a problem creating images to files. I can create and display
images
> with this code:
>
> <?
> Header("Content-type: image/png");
> $im = imageCreateFromPng("image.png");
> ImagePng($im);
> ImageDestroy($im);
> ?>
>
> But i want to save the image to a file. I have tried the follwing code but
I
> get "Warning: imagepng: unable to open 'pic.png' for writing in
> /public_html/imgtest.php on line 11".
>
> <?php
> $im = imageCreateFromPng("image.png");
> ImagePNG($ im,"pic.png");
> ImageDestroy($im);
> ?>
> <img src="pic.png" border=0>
> </body>
> </html>
>
> (Line 11 is "ImagePNG($ im,"pic.png");")
>
> Anyone?
>
> Robert
>