We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Best way to create thumbnails from images on file system (outside of EE)?

Development and Programming

MCB Web Design's avatar
MCB Web Design
3 posts
14 years ago
MCB Web Design's avatar MCB Web Design

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?

       
OrionesqueLtd's avatar
OrionesqueLtd
23 posts
14 years ago
OrionesqueLtd's avatar OrionesqueLtd

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();
 }
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.