There is a way to accept only images with a minimum height and a minimum width?
Thanks
@Doals Please try autoResize plugin.
I had already seen the plugin but only accepts maxWidth and maxHeight. What I am looking for is to avoid uploading images if it is too small (example: smaller than 200x250px). And in this case an error message (The image is too small to be uploaded)
@Doals I done. You can try with nigtly build of elFinder.
connector's bind option
'bind' => array(
'upload.presave' => array(
function($thash, $name, $src, $elfinder, $volume) {
$imageType = null;
$srcImgInfo = null;
if (extension_loaded('fileinfo') && function_exists('mime_content_type')) {
$mime = mime_content_type($src);
if (substr($mime, 0, 5) !== 'image') {
return false;
}
}
if (extension_loaded('exif') && function_exists('exif_imagetype')) {
$imageType = exif_imagetype($src);
if ($imageType === false) {
return false;
}
} else {
$srcImgInfo = getimagesize($src);
if ($srcImgInfo === false) {
return false;
}
}
if ($srcImgInfo === null) {
$srcImgInfo = getimagesize($src);
}
if ($srcImgInfo) {
if ($srcImgInfo[0] < 200 && $srcImgInfo[1] < 250) {
return array('error' => array(elFinder::ERROR_UPLOAD_FILE, $name, 'The image is too small to be uploaded.'));
}
}
}
)
)
Great, thanks!