472,981 Members | 1,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,981 software developers and data experts.

Image Resize does not work

I am trying to change the size of a drawing so they are all 3x3.

the script below is what i was trying to use to cut it in half ... I
get errors.

I can display the normal picture but not the results of the picture
half the size. The PHP I have installed support 1.62 or higher. And
all I would like to do is take and image and make it fit a 3x3.

Any suggestions to where I should read or look would be appreciated.

TIA

############### code ####################################
<?
$i = "$image.jpg";
echo "<br>my working file is $i";

$src = ImageCreateFromJPEG($i);
$width = ImageSx($src);
$height = ImageSy($src);
$x = $width/2;
$y = $height/2;
$dst = ImageCreateTrueColor($x,$y);
ImageCopyResampled($dst, $src, 0,0,0,0,$x,$y,$width,$height);
ImagePNG($dst);
?>

#################### error #########################################
Warning: imagecreatefromjpeg: Unable to open '13727.jpg' for reading
in /var/www/html/viewer.php on line 75

Warning: imagesx(): supplied argument is not a valid Image resource in
/var/www/html/viewer.php on line 76

Warning: imagesy(): supplied argument is not a valid Image resource in
/var/www/html/viewer.php on line 77

Warning: imagecreatetruecolor(): requires GD 2.0 or later in
/var/www/html/viewer.php on line 80

Warning: imagecopyresampled(): requires GD 2.0 or later in
/var/www/html/viewer.php on line 81

Warning: imagepng(): supplied argument is not a valid Image resource
in /var/www/html/viewer.php on line 82
// Larry
Jul 16 '05 #1
3 23427
Sandwick wrote:

#################### error #########################################
Warning: imagecreatefromjpeg: Unable to open '13727.jpg' for reading
in /var/www/html/viewer.php on line 75


Error messages can be your greatest friend. Is the file 13727.jpg in
/var/www/html? That's where it's probably looking, since that's where
the PHP script is and you didn't provide an absolute path in the file
name. You should probably do that, something like:

$IMG_BASE = "/var/www/html";
$FullImgName = "$IMG_BASE/$image.jpg";

Jul 16 '05 #2
Joshua Ghiloni <jd***@SPAM.ME.AND.DIE.cwru.edu> wrote in message news:<bd**********@eeyore.INS.cwru.edu>...
Sandwick wrote:

#################### error #########################################
Warning: imagecreatefromjpeg: Unable to open '13727.jpg' for reading
in /var/www/html/viewer.php on line 75


Error messages can be your greatest friend. Is the file 13727.jpg in
/var/www/html? That's where it's probably looking, since that's where
the PHP script is and you didn't provide an absolute path in the file
name. You should probably do that, something like:

$IMG_BASE = "/var/www/html";
$FullImgName = "$IMG_BASE/$image.jpg";


thanks for the input that eliminated 3 of the errors !

I now have the file identified, but it will still not display the
picture in half. It now complains about the following?

It looks like I do not have the right version, but my phpinfo() tells
me I have 1.62 or higher support.

See error below.
####################### Error ##############################
Warning: imagecreatetruecolor(): requires GD 2.0 or later in
/var/www/html/viewer.php on line 83

Warning: imagecopyresampled(): requires GD 2.0 or later in
/var/www/html/viewer.php on line 84

Warning: imagepng(): supplied argument is not a valid Image resource
in /var/www/html/viewer.php on line 85
// Larry
Jul 16 '05 #3
Sandwick wrote:
Joshua Ghiloni <jd***@SPAM.ME.AND.DIE.cwru.edu> wrote in message news:<bd**********@eeyore.INS.cwru.edu>...
Sandwick wrote:

#################### error #########################################
Warning: imagecreatefromjpeg: Unable to open '13727.jpg' for reading
in /var/www/html/viewer.php on line 75


Error messages can be your greatest friend. Is the file 13727.jpg in
/var/www/html? That's where it's probably looking, since that's where
the PHP script is and you didn't provide an absolute path in the file
name. You should probably do that, something like:

$IMG_BASE = "/var/www/html";
$FullImgName = "$IMG_BASE/$image.jpg";


thanks for the input that eliminated 3 of the errors !

I now have the file identified, but it will still not display the
picture in half. It now complains about the following?

It looks like I do not have the right version, but my phpinfo() tells
me I have 1.62 or higher support.

See error below.
####################### Error ##############################
Warning: imagecreatetruecolor(): requires GD 2.0 or later in
/var/www/html/viewer.php on line 83


Am I missing something? You have 1.62 or higher. The error message says you need 2.0. Presumably, you have
something between 1.62 and 2.0. You'll need to upgrade.

Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jay | last post by:
Hi guys, trying to fix a problem with an image resize routine. The code posted below uploads and resizes a jpeg, probablem is, the outlook can look a bit bitty becuase of teh samller size...is...
1
by: Dave | last post by:
Hi all, I was trying to make an image submit button with a rollover and discovered to my suprise that there is no way to access a form element of the "image" type. I tried specifying it by name...
4
by: vunet.us | last post by:
Hello, What is the best image resizing tool is out there? I want to resize images in ASP page when users upload them into some directory. Your recommendations are super welcome. Thank you.
12
by: Shawn Northrop | last post by:
Ive been searching for an image resize tutorial for a while now and found this code which worked nicely. I was unable to find the full source code but i think i pieced together the code from the...
2
by: Dominic Vella | last post by:
Hi, I know I seem to have the really complicated questions, but I guess that's why I'm here. This is a little verbose, only because I've been trying to crack this for a week now. Your help...
8
by: infoseekar | last post by:
Image Resize & Rotation Hi I have 2 scripts, one for Image rotation and other image resize and they both are working. Image resize scripts load the picture and resize it and Image rotation...
2
by: Noorain | last post by:
Hi, another problem. i upload width=800 pixels image in database through. this image resize by thumb image & bis image. thumb image width is 100 pixel & big image width is 400 pixel. 800 pixel image...
3
by: Noorain | last post by:
Sir i want to resize image. Following script working in my local server. But This coding doesn't work in php 2.6.0. please help me <form action="<?php echo $_server; ?>" method="post"...
22
by: simon2x1 | last post by:
i have an image which width is 213 and height is 200 when i echo the image and i resize it echo "<img src='company/$present' width='70' height='68'/>"; the image was not as clear as when it was...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.