Welcome Guest, Not a member yet? Register   Sign In
Timthumb for CodeIgniter
#1

[eluser]ThatsJustMe[/eluser]
Hello,

Is there anything similar or Timthumb version for Codeigniter? Well basically I need to only specify the size for image and cropping, I don't need to create another file (thumbnail), since I'm taking images from image server that is on different server, than website is.
#2

[eluser]pickupman[/eluser]
You can use a simple image controller to do this with the [url="http://ellislab.com/codeigniter/user-guide/libraries/image_lib.html"]Image Library[/url]. I have done something like this:
Code:
class Image extends CI_Controller
{
  public function index($width = 100, $height = 100, $image_path)
  {
     $config['image_library'] = 'gd2';
     $config['source_image'] = $image_ath;
     $config['dynamic_output'] = TRUE;
     $config['maintain_ratio'] = TRUE;
     $config['width'] = $width;
     $config['height'] = $height;

     $this->load->library('image_lib', $config);
     echo $this->image_lib->resize();
  }
}

//Call from view
<img src="image/100/100/my-image.jpg" alt="" />

Using the image class is pretty simple to write a resize or crop image handler.
#3

[eluser]Alexandru[/eluser]
check out imageMoo !
#4

[eluser]Mat-Moo[/eluser]
Like ^^ Smile




Theme © iAndrew 2016 - Forum software by © MyBB