Problem with imagecreatetruecolor
Posted: Wed May 07, 2008 8:34 pm
Hello.
I am working on an app that will allow a series of boxes to be added to an image, with different rotations. As such, I have created my base img resource. Which worked fine.
The problem lies with trying to create an additional img resource for the box, so that it may be rotated, before adding to the main img. for some reason I always get the following error:
<b>Warning</b>: imagecreatetruecolor() [<a href='function.imagecreatetruecolor'>function.imagecreatetruecolor</a>]: Invalid image dimensions in <b>/mnt/Target01/334547/351713/www.delaced.com/web/content/cards/createNew2.php</b> on line <b>18</b><br />
The values getting passed to it are correct, as I have used them in other things (read only, they are never set). The values that are passed change, but an example of other ones that have been sent are "width:370.8904820" "height:200.83920" I figured this may be a problem with them not being integers, so I used both intval() and (int) to try to convert them (both of which seem to give width:3708 height:2008 very strange...Even so. No matter what values I pass, I cant make this work. If I use static values, it does work.
Any help will be appreciated.
I am working on an app that will allow a series of boxes to be added to an image, with different rotations. As such, I have created my base img resource. Which worked fine.
The problem lies with trying to create an additional img resource for the box, so that it may be rotated, before adding to the main img. for some reason I always get the following error:
<b>Warning</b>: imagecreatetruecolor() [<a href='function.imagecreatetruecolor'>function.imagecreatetruecolor</a>]: Invalid image dimensions in <b>/mnt/Target01/334547/351713/www.delaced.com/web/content/cards/createNew2.php</b> on line <b>18</b><br />
The values getting passed to it are correct, as I have used them in other things (read only, they are never set). The values that are passed change, but an example of other ones that have been sent are "width:370.8904820" "height:200.83920" I figured this may be a problem with them not being integers, so I used both intval() and (int) to try to convert them (both of which seem to give width:3708 height:2008 very strange...Even so. No matter what values I pass, I cant make this work. If I use static values, it does work.
Any help will be appreciated.