Resizing of an original photo

In first, sorry for my english :)

Many CMS engines have the items in admin panel, limiting the size of a image/photo, loaded by the user.

I have been surprised, when have learnt that the Dolphin has no these limitations. Besides, after loading of a image by the user and processing of the sizes of a image, the original image is not deleted from a disk and takes a place... If to consider that users try to load very big photos it can have problems in the future.

 

I not the big expert in PHP, I had no time to understand how it is possible to delete an original photo after loading, but I have found a way to reduce the size of this photo to the necessary sizes...
 

So: \modules\boonex\photos\classes\BxPhotosUploader.php


Find these strings and comment for case, that this will go incorrectly


 $aFileTypes = array(

  'icon'  => array('postfix' => 'ri', 'size_def' => 32),
  'thumb' => array('postfix' => 'rt', 'size_def' => 64),
  'browse'=> array('postfix' => 't', 'size_def' => 140),
  'file'  => array('postfix' => 'm', 'size_def' => 600),
             );


paste new code:
 

   $aFileTypes = array(
                   'icon'  => array('postfix' => '_ri', 'size_def' => 32),
                   'thumb' => array('postfix' => '_rt', 'size_def' => 64),
                   'browse'=> array('postfix' => '_t', 'size_def' => 140),
                   'file'  => array('postfix' => '_m', 'size_def' => 600),
                   'original'  => array('postfix' => '', 'size_def' => 1024)
               );
 

Pay attention to new string - 

'original'  => array('postfix' => '', 'size_def' => 1024)

1024 - these is size in pixels for an original photo


------------------------------

One more string requires change

comment:


$sNewFilePath = $sMediaDir . $iLastID . '_' . $aValue['postfix'] . $sExtension;


and paste 

 $sNewFilePath = $sMediaDir . $iLastID . $aValue['postfix'] . $sExtension; 

Quote · 23 Aug 2013

Thank you for this modification.  With digital cameras today easily having 18 and 20 megapixels, the original image can be quite huge.  This modification will allow the storage of a larger image to complement the smaller display image while at the same time allowing admins control over the sizes of the original images stored on the server.

Geeks, making the world a better place
Quote · 23 Aug 2013

 

Unfortunately, I did not study still  how add original image size to admin panel 

Quote · 23 Aug 2013

This should not be too difficult to add a setting in the admin; although I will wait to see if more experienced module developers come in and answer.

We need to add to the admin panel for photos the selection of size.  We will need to make a field in the database to hold the required size for the original image; which we might decide to relabel since it is not the original photo any more.  Then in the script, it needs to retrieve the desired size from the database and store it in a variable which is then used to resize the original.

Geeks, making the world a better place
Quote · 23 Aug 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.