Reply to Why cropping does not work

Why cropping does not work new!
by Ivan, 4 years, 7 months ago
Greetings. I can’t figure out why cropping does not work with this code, where the coordinates of TRBL are transmitted. It is either not what is needed or something is cut out, depending on the position of the selected area in the image.

$handle = new upload(WAY . '/files/covers/' . $msg['filename'], 'ru_RU');
if ($handle->uploaded) {
    $handle->file_new_name_body = 'cover-' . $cover['url'];
    $handle->file_overwrite = true;
    $handle->image_precrop = array($msg['t'], $msg['r'], $msg['b'], $msg['l']);
    $handle->image_resize = true;
    $handle->image_ratio_crop = true;
    $handle->image_x = 300;
    $handle->image_y = 400;
    $handle->image_convert = 'jpg';
    $handle->jpeg_quality = 80;
    $handle->process(WAY . 'files/covers/');
    if ($handle->processed) {  
        $msg['cover'] = str_replace('\\', '', $handle->file_dst_pathname) . '?r=' . rand(0000, 99999);
        $handle->clean();
        $msg['status'] = TRUE;
    } else {
        $msg['errors']['cover'] = $handle->error;
    }
}

I will be glad to any tipsReply

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