473,416 Members | 1,729 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 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 23511
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.