Hello, all. I’m just after a bit of advice on the best way to create thumbnails within ExpressionEngine 2.
I’m developing a property module that takes a third-party feed and populates a database with property entries. Along with these entries, property images are dropped on my server in a ‘feed’ folder in the root of my web server’s directory (and where ExpressionEngine is installed). For example:
/feed /images /system /themes
Does ExpressionEngine have a built-in module or class for manipulating images on the file system? So I can take an image from the file system and generate a thumbnail version that I can use in my templates?
You have access to the CI Image Library, which should be able to handle creating thumbnails for you
http://ellislab.com/codeigniter/user-guide/libraries/image_lib.html
private function create_thumb($image){
$this->load->library('image_lib');
$config['image_library'] = 'gd2';
$config['source_image'] = '/path/to/image/mypic.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 75;
$config['height'] = 50;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
}Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.