Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Minimum width or height for uploaded pictures  (Read 3373 times)

0 Members and 1 Guest are viewing this topic.

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Minimum width or height for uploaded pictures
« 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)

 
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Minimum width or height for uploaded pictures
« Reply #1 on: March 02, 2016, 10:44:12 am »

What exactly should happen if a file undercuts that value? Should it be rejected or upscaled?
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Re: Minimum width or height for uploaded pictures
« Reply #2 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!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Minimum width or height for uploaded pictures
« Reply #3 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.
Logged

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 85
    • Galería Fotometeo
Re: Minimum width or height for uploaded pictures
« Reply #4 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...
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.