forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: nambroque on March 02, 2016, 09:23:34 am
-
At the moment, in the config area it is possible to set the maximum width or height for uploaded pictures.
It would be very useful to have also the possibility of setting the minimum width or height... would it be possible?
Thanks
(My gallery: http://fotometeo.ame-web.org/index.php (http://fotometeo.ame-web.org/index.php))
-
What exactly should happen if a file undercuts that value? Should it be rejected or upscaled?
-
What exactly should happen if a file undercuts that value? Should it be rejected or upscaled?
I would prefer them to be rejected
Thanks!
-
Open include/picmgmt.inc.php, find
if ($CONFIG['read_iptc_data']) {
and above, add
$CONFIG['min_upl_width_height'] = 400;
$lang_db_input_php['err_fsize_too_small'] = 'The size of file you have uploaded is too small (it needs to be at least %s x %s)!';
if (min($imagesize[0], $imagesize[1]) < $CONFIG['min_upl_width_height']) {
@unlink($uploaded_pic);
$msg = sprintf($lang_db_input_php['err_fsize_too_small'], $CONFIG['min_upl_width_height'], $CONFIG['min_upl_width_height']);
return array('error' => $msg, 'halt_upload' => 1);
}
Please report if it works as expected. I think I'll add this as hidden feature later in cpg1.5.x and it will probably be a config option in cpg1.6.x.
-
I have checked and it seems to work right
It would be great that this is add to cpg1.6x. I suppose the option of setting the minimum will appear in the admin config menu
I mark this topic as solved...