forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: nambroque on March 02, 2016, 09:23:34 am

Title: Minimum width or height for uploaded pictures
Post 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))

 
Title: Re: Minimum width or height for uploaded pictures
Post by: Αndré on March 02, 2016, 10:44:12 am
What exactly should happen if a file undercuts that value? Should it be rejected or upscaled?
Title: Re: Re: Minimum width or height for uploaded pictures
Post by: nambroque on March 04, 2016, 10:36:50 pm
What exactly should happen if a file undercuts that value? Should it be rejected or upscaled?

I would prefer them to be rejected
Thanks!
Title: Re: Minimum width or height for uploaded pictures
Post by: Αndré on March 08, 2016, 04:06:07 pm
Open include/picmgmt.inc.php, find
Code: [Select]
if ($CONFIG['read_iptc_data']) {and above, add
Code: [Select]
        $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.
Title: Re: Minimum width or height for uploaded pictures
Post by: nambroque on March 08, 2016, 07:10:19 pm
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...