Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsWeb Design & DevelopmentServer Side ScriptingPHP right
  Reply to this topic Start new topic
left right
Sipphy
post May 29 2012, 07:50 PM
Post #1


Newbie
*

Group: Members
Posts: 3
Joined: 1-May 12
Member No.: 240,075



I've been able to create and manipulate images from scratch but today I've been trying to manipulate an existing image and all I've been getting are confusing errors.

This is my code at this point:
CODE
<?php
            $image= imagecreatefrompng("animals/cat_normal.png");
            $image2= imagecreatefrompng("animals/cat_normal.png");
            $black= imagecolorallocate($image2, 0, 0, 0);
            $alpha= imagecolorallocatealpha($image2, 0, 0, 0, 127);
            imagefilltoborder($image2, 0, 0, $alpha, $black);
            imagepng($image2, "someimage.png");
            $newimage= imagecopymerge($image, $image2, 0, 0, 0, 0, 500, 455, 50);
            imagepng($newimage, "newimage.png");
            imagedestroy($image);
            imagedestroy($newimage);
?>


These are the errors this code gets:
QUOTE
Warning: imagepng() [function.imagepng]: Unable to open 'someimage.png' for writing: Permission denied in /www/zymichost.com/s/y/l/sylesca/htdocs/homestead/showanimal.phtml on line 7

Warning: imagepng(): supplied argument is not a valid Image resource in /www/zymichost.com/s/y/l/sylesca/htdocs/homestead/showanimal.phtml on line 9

Warning: imagedestroy(): supplied argument is not a valid Image resource in /www/zymichost.com/s/y/l/sylesca/htdocs/homestead/showanimal.phtml on line 11


If anyone could point out an error I've made I would really appreciate it because I am nearing the end of my rope trying to fix this script.
Go to the top of the page 
 
  + Quote Post
 Reply to this topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 18th May 2013 - 09:08 PM