image resize

images php coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 6
Joined: Thu Jul 18, 2002 11:56 pm

Wed Jul 24, 2002 4:38 am

Hello everyone.
I am trying to change the width and height of an image.
This is how i am trying to do it.:

Code: Select all

function HandlePix($pic,$CountNum){

   $upload_path = "q/"; 
   $filearray = explode(".",$pic);
   $extension = end($filearray);
   $pictn = $CountNum.'tn.'.$extension;
   $tmptn = $CountNum.'tmp.'.$extension;

//   copy($upload_path.$pic,$upload_path.$pictn);
   $size = getimagesize($upload_path.$pic);

   $tmppath = $upload_path.$tmptn;
   $tnpath = $upload_path.$pictn;
   $bgpath = $upload_path.$pic;

   system("djpeg $bgpath >$tmppath");

    system("pnmscale -xy 250 200 $bgpath | cjpeg -smoo 10 -qual 50 >$tnpath");

It creates a temp image with no size.
I am using php 4.2.2, winnt and apache 1.3
(For some reason imagecopyresized returns an error : function undefiend.
This is the reason I am trying to do it this way)

New php-forum User
New php-forum User
Posts: 8
Joined: Fri Sep 27, 2002 4:01 am

Sat Nov 23, 2002 2:52 am

At file php.ini open library GL for use this function

Sergey Booyny
AlarIT programmer

Post Reply