Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

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

0 Members and 1 Guest are viewing this topic.

nambroque

  • Coppermine regular visitor
  • **
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 88
    • 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: 88
    • 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: 88
    • 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.022 seconds with 19 queries.