Jump to content

mfflynn

Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mfflynn's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. With the colors we need to use in this project, not using imagecreatetruecolor() doesn't seem to be an option. Does anyone kow of anyway that I can fix this bug and be able to use imagefill() on an imagecreatetruecolor() image? UPDATE: Though the issue is not resolved. I have found 2 hacks that can make this work with an imagecreatetruecolor() image: 1. though imagefill() doesn't work, I've found that imagefilledrectangle() does, so you just fill a rectangle the total size of your image and it works. 2. Colors don't work with imagefill() but tiled images do.
  2. We are running Fedora. Not exactly an uncommon setup.
  3. Here's something interesting...I found something related to this problem on PHP's page for imagefill(). It was in the discussion section at the bottom. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] glimpse at glimpse-fr dot org 25-Apr-2005 06:42 In response to philip at fcknet dot dk : It depends on the version of PHP. In some 4.3 releases (but I'm not sure to know the exact version number), you must use the tips given by latortugamorada at yahoo dot com : "you have to use imagecreate and fill it and then imagecopy that onto the imagecreatetruecolor..." Thank you very much, latortugamorada at yahoo dot com! philip at fcknet dot dk 28-Feb-2005 08:31 In response to latortugamorada at yahoo dot com at 21-Jan-2005 07:56. Imagefill works fine with imagecreatetruecolor. I tested on both Windows XP Home (PHP 5.0.3, Apache 2.x), and FreeBSD v. somethin PHP 5.0.3. Both worked absolutely fine. latortugamorada at yahoo dot com 21-Jan-2005 10:56 Hey, um, this imagefill stuff doesn't work with imagecreatetruecolor. you have to use imagecreate and fill it and then imagecopy that onto the imagecreatetruecolor... if that makes any sense. [/quote] The really weird thing was that discussion above is only available on the Google cache of the page, not on the current page. Someone edited that conversation out, which was beyond dumb because the problem clearly still exists. Current page:[a href=\"http://us2.php.net/imagefill\" target=\"_blank\"]http://us2.php.net/imagefill[/a] Cache: [a href=\"http://64.233.179.104/search?q=cache:n28XDhkQxPkJ:www.php.net/imagefill+imagecreatetruecolor+imagefill&hl=en&gl=us&ct=clnk&cd=2&client=safari\" target=\"_blank\"]http://64.233.179.104/search?q=cache:n28XD...2&client=safari[/a]
  4. Thåt block of code just gives me a big black square. It must be something with the "truecolor" which is truly bizarre and unfortunate because that is the preferred function.
  5. Thanks! By just pasting it in and not playing with it at all yet, it showed what it should. Any idea why the first block of code you pasted worked for you and not me, and why this new block seems to work and not the others? It is a PHP version differences because I'm running 5 and GD 2.0.28? The only differences I see in the the "broken" blocks and the new block is that you are assigning the color black to the inside square as opposed to just leaving the initial color black as is and the major difference being you are using regular "imagecreate" instead of "imagecreatetruecolor". If those were the difference makers, will not using a "imagecreatetruecolor" image (As the PHP white paper says you should) effect the overall look of my images I create? ...I'm just trying to understand the weird issue as much as I can, and I can't find ANY information about this anywhere on the net.
  6. Awesome. But its not working for me. What could be causing that weirdness in my php setup? I'm running PHP version 5.1.2 with the bundled GD compiled into it. UPDATE: I just copied and pasted your code and it just shows me a 555x555 black square.
  7. I am working on a project with GD and I need to fill and an image with a color. Sounds easy, but the imagefill doesn't seem to be working. I will create an image, and allocate the color and then I will use imagefill, which returns true, but doesn't actually fill anything with color. Here's the weird part: It will work if the image is smaller than what I want. If I replace the variables that state the size of the image I create with any numbers lower than 250, then the image fills with color fine, any bigger and it stays black. Any suggestions to what the problem could possibly be? Here is some sample code I ripped out of my script that behaves the same way: [code] <?php $print = imagecreatetruecolor(100, 100); $image = imagecreatetruecolor(249, 249); #<-- Make these numbers any bigger and the imagefill won't work. $mat1 = imagecolorallocate($image, 255, 255, 0); if(!imagefill($image, 0, 0, $mat1)){     print("Image not filling!"); exit; } imagecopy($image,$print,50,50,0,0,100,100); header("Content-type: image/jpg"); imagejpeg($image); imagedestroy($image);  // Free memory ?> [/code] UPDATE: Actually the size restrictions aren't so cut and dry. They waiver a bit too. Now even 240x240 pictures aren't working with the exact same code as above.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.