Question

I am developing a new project in CodeIgniter (CI), and would like to find a CI solution to this current issue. I've got one image, which resembles a picture frame. I would like for uploaded images to be modified to have this frame in their background.

Example:
alt text http://www.sampsonresume.com/projects/visit-creation/vc-process.jpg

The first picture is the frame. The second is the uploaded image (after resizing/cropping), and the third is the combination of both, which I would like to accomplish.

Was it helpful?

Solution

If the images are going to be shown on your own website, it would probably be easier to simply use CSS (especially if your bottom image simply gives a border...). Of course, if you want people to be downloading these files with the frame, that's a different story.

I don't think CI has a built in method in the Image Manipulation class. But, that class is simply abstracts typically-used features from one of the three major PHP image libraries (GD, ImageMagick, and NetPBM). If you know what library you are using (I normally use GD for basic things like this...), then you'll just have to use their proprietary ways of doing this stuff.

You can even make your own library or extend the Image Manipulation class to add your own special features.

Also, there may be ways to do this in Zend (not sure, I'm not going to look it up either). But, there are easy ways to include Zend components into CI if you do find something.

Good luck man!

OTHER TIPS

Agreed with Kyle -- your best bet is to extend the libraries already there. Take a look at ImageMagick "composite" command.

composite -gravity center smile.gif rose: rose-over.png

http://www.imagemagick.org/script/composite.php

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top