CI's image class

Now that we have our file uploaded we can use CI's image class to manipulate it. This library works with the three most popular image libraries for PHP—GD/GD2, NetPBM, and ImageMagick. Use phpinfo() to find which of these is supported by your server. Image watermarking only works with GD/GD2, though:

The image manipulation class allows you to perform four basic functions with images:

  • Resize: You may want to fit them into a standard size on your screen or you may want to cut them right down to thumbnail images
  • Crop
  • Rotate
  • Watermark (only available with GD/GD2): This is often used to put a copyright notice on an image so that people can't download it from your site and pass it as their own work

Note

The GD library is always needed in ...

Get CodeIgniter 1.7 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.