1. Go to this page and download the library: Download hypejunction/cropper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// in your form
echo elgg_view('input/file', array(
'name' => 'avatar',
'use_cropper' => true,
));
// in your action
$coords = get_input('crop_coords');
// in your form
echo elgg_view('input/file', array(
'name' => 'cover',
'use_cropper' => array(
'name' => 'cover_crop_coords',
'ratio' => 16/9,
'src' => '/uri/image.jpg', // previously uploaded file
'x1' => 100,
'y1' => 100,
'x2' => 260,
'y2' => 190,
),
));
// in your action
$coords = get_input('cover_crop_coords');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.