SmartImage Plugin
Welcome to the demo page of the SmartImage Plugin for the Nucleus CMS. Here I'll try to show you what the possibilities are of the plugin by showing some examples.
SmartImage Plugin ( bytes, download 0x)






Quite a large amount of time has been spent creating this plugin. If you use it in your projects, then please consider donating. Donating helps ensure continued support, development and availability.
Please note that you don’t need to become a member of PayPal to donate... only a credit card is required. Thank you. Your support is appreciated.
Donations can also be sent directly to luytenwesley@gmail.com via PayPal!
SmartImage Plugin ( bytes, download 0x)
First load the plugin class by using the manager
global $manager, $DIR_MEDIA;
$smartimage = $manager->getPlugin('NP_SmartImage');
$smartimage = $manager->getPlugin('NP_SmartImage');

Original jpg image 540x404
$smartimage->resize(200, 250, $DIR_MEDIA.'kaya.jpg', $DIR_MEDIA.'kaya2.jpg');

Resized 200x250
Note: resizing is a combination of scaling and cropping
$smartimage->scale(300, 1000, $DIR_MEDIA.'kaya.jpg', $DIR_MEDIA.'kaya3.jpg');

Scaled max width 300
$smartimage->bgcolor = '#FFF';
$smartimage->round(20, array(1, 1, 1, 0), $DIR_MEDIA.'kaya.jpg', $DIR_MEDIA.'kaya4.jpg');
$smartimage->round(20, array(1, 1, 1, 0), $DIR_MEDIA.'kaya.jpg', $DIR_MEDIA.'kaya4.jpg');

Rounding with radius 20
$smartimage->quality = 100;
$smartimage->read($DIR_MEDIA.'kaya.jpg');
$smartimage->crop(200, 50, 150, 150);
$smartimage->sharpen();
$smartimage->save($DIR_MEDIA.'kaya5.jpg');
$smartimage->read($DIR_MEDIA.'kaya.jpg');
$smartimage->crop(200, 50, 150, 150);
$smartimage->sharpen();
$smartimage->save($DIR_MEDIA.'kaya5.jpg');

Cropped & sharpened
Note: it is also possible to excecute multiple actions on the image by using the read and save methods.
$smartimage->rotate(90, 'http://farm2.static.flickr.com/1248/842241516_bbcd606511_m.jpg', $DIR_MEDIA.'image6.jpg');

Remote image rotated 90 degrees
Note: the plugin uses curl to access the remote image.
Quite a large amount of time has been spent creating this plugin. If you use it in your projects, then please consider donating. Donating helps ensure continued support, development and availability.
Please note that you don’t need to become a member of PayPal to donate... only a credit card is required. Thank you. Your support is appreciated.
Donations can also be sent directly to luytenwesley@gmail.com via PayPal!