Trongate Docs
switch to dark modeswitch to dark mode
»
»
A Closer Look At Picture Settings

A Closer Look At Picture Settings

For the purposes of clarity and for reference purposes, let's take a moment to consider how picture settings work for (single picture) uploader builds.

Your ultimate goal, when you're building a picture uploader, is to call Trongate's upload_picture() method.  However, when you call the upload_picture() method, you are required to pass in an array of data that represents your picture configuration options.  Typically, this will result in a line of code that looks like this:

$this->upload_picture($config);

The table below shows all of the configuration options that can be passed into the upload_picture() method:

Property Description Required
destination the name of the directory where pictures should be uploaded to yes
max_width the maximum allowed width of uploaded pictures, in pixels yes
max_height the maximum allowed height of uploaded pictures, in pixels yes
thumbnail_dir the name of the directory where thumbnails should be uploaded to no (this property is optional)
thumbnail_max_width the maximum allowed width of thumbnails, in pixels no (this property is optional)
thumbnail_max_height the maximum allowed height of thumbnails, in pixels no (this property is optional)

Just To Let You Know
The max_width and max_height settings, as described above, have nothing to do with form validation!  Instead, these values represent the dimensions that uploaded pictures will be resized down to, if necessary.

Top Tip
Trongate comes with some pre-built form validation tests to assist with picture uploading situations.  For full details, please refer to the file validation helper



HELP & SUPPORT

If you have a question or a comment relating to anything you've see here, please goto the Help Bar.

 
×