Let us get started with implementing our custom photo gallery using Zend Framework 2. Since we have already implemented a file management interface, we will use a similar interface to implement a photo gallery.
The schema for a photo gallery will be similar to the Upload
entity; additionally, we will have a field to store the thumbnail
filename, which is generated during upload. Both the images and the generated thumbnails will be stored in the <Module>\data\images
folder. We will use a custom action to display the images in the browser.
Before we get started, let's quickly review some of the important methods that are supported by WebinoImageThumb
:
resize ($maxWidth = 0, $maxHeight = 0)
: This function resizes the image to the specified height and width; if either of the values is set to0
, that dimension will not be considered as a limiteradaptiveResize ($width, $height)
: This function attempts to get the image as close to the provided dimensions as possible...