Thumbnail Action Helper

Thumbnail Action Helper

Released 6 years ago , Last update 6 years ago

A thumbnail creation / display action helper for the Zend Framework

An action helper for the Zend Framework for easy resizing of images into file thumbnails or for direct display.

Features:

  • Very simple, one-line resizing!
  • Supported formats include JPG, GIF and PNG
  • Supports transparency
  • Automatic proportion resizing if given only one of the dimensions (height or width)
  • Uses the GD library (note: must be enabled on the server to run)

Pricing

14 day 14-day money-back guarantee

$11.99

Personal License

  • Perpetual license

  • 1 site, unlimited servers

  • No distribution (hosted use only)

  • Commercial use

Setup and usage

In order to use this action helper you must add the 'Razor' namespace to your application autoloader namespaces. Add the following line it in your application.ini :

autoloaderNamespaces[] = "Razor_"

In order to automatically load all the helpers inside the directory Razor/Controller/Action/Helper, add the following line to the configuration as well :

resources.frontController.actionHelperPaths.Razor_Controller_Action_Helper = "Razor/Controller/Action/Helper"

Copy the 'Razor' library inside your library folder - your application tree will looks like something like this :

-- application 
   -- configs
   -- controllers
   -- models
   -- views
-- library
   -- Zend
   -- Razor

The action helper accepts four parameters :

  1. ( mandatory ) The full path of the source image
  2. ( optional ) The destination path of the resized image
  3. ( optional ) The resized image width
  4. ( optional ) The resized image height

If the second parameter is omitted or empty, the image in rendered directly and not saved on the filesystem.

If you specify both width and height you will get a new image of the specified width and height. If you omit both, the result image is the same width and height of the source. If you specify only width OR only height the dimension not specified is automatically calculated to maintain proportions.

Sample usage #1 - Image is rendered straight to the browser

$imageToMinify = // Your image fullpath
$this->_helper->Thumbnail( $imageToMinify );

Sample usage #2 - Image is saved to a destination and height is calculated by the helper

$imageToMinify = // Your image fullpath
$destination = // Your resized image destination
$width = 640; // width of the new image
$this->_helper->Thumbnail( $imageToMinify, $destination, $width );
2 licenses, starting from From » $11.99 View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.


Or enter your name and Email
No comments have been posted yet.