Problem with rezising images ...

See all posts See thread Reply

Re: Problem with rezising images ... new!
by Stefan, 16 years ago
Colin, with 0.27RC1 it works like a charm :)

See my "1 step" code below (and pls give comments if u think it can be done better) :

BTW ... Did u get any confirmation from PayPal about my transaction ?

include("./core/class.upload.php"); // 0.27RC1

$max_width  = "400";
$max_height = "400";

$upload_path = get_profile_image_path($id, $typ, "");

$fname_original = $upload_path."/".$fname;

list($original_width, $original_height, $type, $attr) = getimagesize($fname_original);

$arr_size[] = "400";
$arr_size[] = "256";
$arr_size[] = "128";
$arr_size[] = "048";
$n = count($arr_size);

for ($i=0; $i<$n; $i++) {

 // T R B L
 $top     = $input_top;
 $right   = $original_width - $input_left - $input_width;
 $bottom  = $original_height - $input_height - $input_top;
 $left    = $input_left;

 $file_new_name_body             = "pic".$arr_size[$i]."px";

 // Start - Crop
 $ul_handle = new upload($fname_original);

 if ($ul_handle->uploaded) {
  $ul_handle->image_x             = $arr_size[$i];
  $ul_handle->image_y             = $arr_size[$i];
  $ul_handle->image_resize        = true;
  $ul_handle->jpeg_quality        = 80;
  $ul_handle->file_overwrite      = true;
  $ul_handle->file_auto_rename    = false;
  $ul_handle->image_ratio_crop    = true;
  $ul_handle->file_new_name_body  = $file_new_name_body;
  $ul_handle->image_convert       = "jpg";  // png, jpg, gif, bmp
  $ul_handle->image_precrop       = array($top, $right, $bottom, $left);
  $ul_handle->Process($upload_path);
 }
 // End - Crop
}
Reply
Re: Problem with rezising images ... new!
by colin, 16 years ago
You code looks all good to me.

I haven't received any email from Paypal, it may have gone lost. But the donation itself has arrived. Thanks again.
I therefore don't have your email address. Could you please email me, so I can send you back the license document?Reply
Re: Problem with rezising images ... new!
by Stefan, 16 years ago
Great, and thank's for having a look :-)
I tested some more and it works super fine !!!

I just sent you a mail for the license thing ... Have a look.

Take Care!

/StefanReply