Bluehost.com Web Hosting $6.95

imagegammacorrect

This is a discussion on imagegammacorrect within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I copy pasted this code from a book I just bought from Atkinson. The image is in the same folder ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-22-2006
Jean Pierre Daviau
 
Posts: n/a
Default imagegammacorrect

I copy pasted this code from a book I just bought from Atkinson.

The image is in the same folder has the page. The page displays the string.
What am I doing wrong ... again?

<?php
echo "In ima page\n";



//attempt to open image, suppress error messages
if(!($image = @imagecreatefromjpeg("deuxpointdeux.jpg")))
{
//error, so create an error image and exit
$image = imagecreate(200,200);
$colorWhite = imagecolorallocate($image, 255, 255, 255);
$colorBlack = imagecolorallocate($image, 0, 0, 0);
imagefill($image, 0, 0, $colorWhite);
imagestring($image, 4, 10, 10, "Couldn't load image!",
$colorBlack);
header("Content-type: image/jpeg");
imagejpeg($image);
exit();
}

//adjust gamma, display inputimage, outputimage
imagegammacorrect($image, 2.2, 1.571);

//send image
header("Content-type: image/jpeg");

imagejpeg($image);

?>

--
Thanks for your attention.

Jean Pierre Daviau
--
Easyphp1.8
Apache1.3.24
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
http://www.jeanpierredaviau.com


Reply With Quote
  #2 (permalink)  
Old 03-22-2006
Oli Filth
 
Posts: n/a
Default Re: imagegammacorrect

Jean Pierre Daviau said the following on 22/03/2006 15:01:
> I copy pasted this code from a book I just bought from Atkinson.
>
> The image is in the same folder has the page. The page displays the string.
> What am I doing wrong ... again?
>

<...SNIP CODE...>

Read the PHP manual page for header() again, carefully...

--
Oli
Reply With Quote
  #3 (permalink)  
Old 03-22-2006
Jean Pierre Daviau
 
Posts: n/a
Default Re: imagegammacorrect

I tried this

if (!extension_loaded('gd')) {
if (!dl('gd.so')) {
print '<P>gd.so:False<BR>';
}
}else
print '<P>gd.so:True<BR>';

Answer: true.

and a bunch of text
-------------------------------------------
trueJFIF>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default
quality C    $.' ",#(7),01444'9=82<.342C 
2!!222222222222222222222222222222222222222222222 22222I"
ĵ}!1AQa"q2'#BR$3 br, %
----------------------------------------------


Reply With Quote
  #4 (permalink)  
Old 03-23-2006
Jean Pierre Daviau
 
Posts: n/a
Default Re: imagegammacorrect

I tried this without success:

<html>
<head>
<title> New Document </title>
</head>
<body>
<IMG SRC="makeImg.php" >
</body>
</html>


Reply With Quote
  #5 (permalink)  
Old 03-25-2006
Jean Pierre Daviau
 
Posts: n/a
Default Re: imagegammacorrect

header sending problem


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:39 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0