Generating thumbnails – resizing

Obviously having the functionality to generate thumbnails is a useful thing to do. Most web developers have had the requirement to create thumbnails of images they are currently uploading, or images previously uploaded, from time to time. Usually that processing would have been done directly with PHP or whichever programming language you may have been using; but CodeIgniter gives you the ability to create thumbnails easily, and this is how you do it.

Getting ready

We're going to use a library of our own for this. If you haven't already done so (in the other recipes in this chapter), create the following file:

  • /path/to/codeigniter/application/libraries/image_manip.php
  1. Ensure that the Image_manip library class is defined ...

Get CodeIgniter 2 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.