Skip to content

CodeIgniter Image Manipulation Class

Derek Jones edited this page Jul 5, 2012 · 6 revisions

Wiki Categories

Category:Libraries::Image Manipulation::Tutorials

Introduction

CodeIgniter has a class called Image Manipulation Class. This class enables you to manipulate the followings. * Image Resizing * Thumbnail Creation * Image Cropping * Image Rotating * Image Watermarking
I read an artticle at http://d.hatena.ne.jp/dix3/20081021/1224552638 and I translated its notes to English.
This will show you how to use Image Manipulation Class. It covers all the functions and some of preferences in the user guide. I changed a font, image and some of details from the original article. All the credit goes to the author dix3.

Environment

I am using XAMPP for this and there is no .htaccess file. My application directory is the same level as system directory.

Font

I downloaded a free TTF font called Aller from http://www.fontsquirrel.com/. Unzip it and I saved the font in system/fonts directory.

Image

If you don't have image directory, then create it as the same level as system and application. I call it img. Add a sample image called photo.png. The size is 700 x 466px, but it does not matter.

Controller

Create a file controlles/imglist.php and add the following code. Please read explanations in the code. ...

(I pasted codes, but it does not show it correctly, so please read it in my blog)

READ MORE at http://www.okadadesign.no/blog/?p=316

Results

imagemani
Clone this wiki locally