I have two questions...
1) Is there anything in the Chronoforms component that automatically validates the dimensions of an image when uploaded? I see that there is something for file size and type. If not, can I use PHP to do so? I've seen scripts out there that do similar things, like this:
2) I see that there's an image resizer. If I leave the height, for instance, blank, will it resize proportionally based off only the width?
The reason I ask these things is that I have clients that will be uploading images of different dimensions, but I want to either validate that their width is to large, or automatically resize the images based on only the width.
1) Is there anything in the Chronoforms component that automatically validates the dimensions of an image when uploaded? I see that there is something for file size and type. If not, can I use PHP to do so? I've seen scripts out there that do similar things, like this:
<?php
$source_image = $_POST('upload_image'); //retrieve image value from form
$w = 410;
$h = 216;
//capture dimension of the uploaded image
list($width, $height) = getimagesize($source_image);
//verification of dimensions
if ( ($width != $w) && ($height != $h)){
return false; //triggers error
}
else
return true;
?>
2) I see that there's an image resizer. If I leave the height, for instance, blank, will it resize proportionally based off only the width?
The reason I ask these things is that I have clients that will be uploading images of different dimensions, but I want to either validate that their width is to large, or automatically resize the images based on only the width.