Re: Image resize problems
- From: "ctclibby" <hogger@xxxxxxxxxxxxx>
- Date: 31 May 2006 12:48:24 -0700
Hi Mike
I have the same code that is almost identical to what you show. (
variable name(s) are different ). Mine works so I know that the code
is okiedokie. What happens when you $ImageName =
imagecreatefromjpg(filepath/name.jpg), then save it as another
imagejpg($ImageName, filepath/othername.jpg)? Does this work?
Did you remember to load DB.php?
<?php
include_once("DB.php");
hope that helps
todh
mikeyatsony wrote:
Here is the code that I get the error with
<?php
// File and new size
$filename = 'test.jpg';
$percent = 0.5;
// Content type
header('Content-type: image/jpeg');
// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = $width * $percent;
$newheight = $height * $percent;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight,
$width, $height);
// Output
imagejpeg($thumb);
?>
And this is the error I get
<br />
<b>Fatal error</b>: Call to undefined function:
imagecreatetruecolor() in
<b>/tmp/disk/home/webmaster/Files/WWW/image_test.php</b> on line
<b>15</b><br />
.
- References:
- Image resize problems
- From: mikeyatsony
- Re: Image resize problems
- From: ctclibby
- Re: Image resize problems
- From: mikeyatsony
- Image resize problems
- Prev by Date: Re: Excel export problem
- Next by Date: Re: PHP on IIS
- Previous by thread: Re: Image resize problems
- Next by thread: Rotated pix
- Index(es):
Relevant Pages
|