Reply to Problem with rezising images ...

Problem with rezising images ... new!
by Stefan, 16 years ago
Colin, I have successfully got it to upload files to the server, but when I'm trying to crop and rezise I got into some trouble ... Maybe u can help me out?

I have one file on the server: pic400px_original.jpg
It is width: 400px and height: 495px

Now I need to crop and rezise it.
Crop is working, but file is saved in the crop size, say 363px by 363px
and not 400px by 400px as I need it rezised to ...
( Later I also need 128px by 128px and 48px by 48px ... When this works ;) )

So, can you check my code below and see if you can tell me where I messed up?

$ul_handle = new upload($fname_original);  // members/profileimg/0000001_0000500/0000001/pic400px_original.jpg
if ($ul_handle->uploaded) {
 $px_filename = "pic400px";
 $ul_handle->image_x = 400;
 $ul_handle->image_y = 400;
 $ul_handle->file_overwrite = true;
 $ul_handle->file_auto_rename = false;
 $ul_handle->image_ratio_crop = true;
 $ul_handle->file_new_name_body = $px_filename;
 $ul_handle->image_convert = "jpg";  // Make sure I always get jpg files: png, jpg, gif, bmp
 $ul_handle->image_crop = array(34, 0, 98, 37);
 $ul_handle->Process($upload_path);  // members/profileimg/0000001_0000500/0000001
}
Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important