PHP Classes

File: readme.txt

Recommend this page to a friend!
  Classes of Mike Jordan   PHP Image Filter GD   readme.txt   Download  
File: readme.txt
Role: Documentation
Content type: text/plain
Description: Installation and Description
Class: PHP Image Filter GD
Apply image effect filters to remote images
Author: By
Last change: Updated filter description
Date: 9 years ago
Size: 3,904 bytes
 

Contents

Class file image Download
App: PHP Image Filter GD Version: 1.0.1 Author: MT Jordan <mtjo62@gmail.com> Copyright: 2014 License: zlib/libpng License ********************************************************************************** Image Image Filter GD: Image class to apply effects filters to remote images ********************************************************************************** Image Filter GD is PHP class that can apply image effects filters to remotely linked images. The class can be used with CMS's, blogs or other forum applications as a base for BBCode style tags or it can be applied using Javascript. brighten: Lightens a darker image. brush: Adds a slight dabbed, brushed effect to an image. darken: Darkens an overly bright image. edgedetect: Highlights borders between colors on an image. Similar to emboss. emboss: Adds a stamped metal effect to an image. flip: Flips an image vertically. grayscale: Converts color image to black & white. larger: Increase an image dimension by 2x. mirror: Produces a mirrored reflection of an image. negative: Produces a photo negative of an image. pixelate: Pixilates an image. sephia: Adds an aged photo effect to an image. sharpen: Sharpens an blurred image. sketch: Adds a sketched, comic book effect to an image. smaller: Reduces an image dimension size by half. smooth: Slightly blurs an overly sharpened image. ********************************************************************************* Image Filter GD Features: * Effects filters are non destructive to original image. Image Filter GD Restrictions: * Only supports GIF, PNG and JPG/JPEG images. * Only the first frame of animated GIFs are processed. Image Filter GD Requirements: * PHP 5.4+ * Enabled GD extension * Enabled fopen wrappers or cURL extension ********************************************************************************* Installation: 1. Upload image_filter.php and error.png to a readable directory. 2. Download the PHP Image cURL dependency package image_info.php if using the cURL extension and upload to the same directory as step 1. ********************************************************************************* For a standalone img tag Usage: <img src="http://mysite.com/path/to/image_filter.php?filename_gd=http://mysite.com/path/to/image.png&filter_gd=sharpen" alt="" /> ********************************************************************************* For a Smarty Plugin Download function.img_filter.php and upload to the plugins directory of your Smarty installation. Edit the $img_filter_URL variable to the absolute path to image_filter.php. Add the following to your template. {img_filter src='http://mysite.com/path/to/image.png' filter='smaller'} ********************************************************************************* For a BBCode style tag Usage: [img_filter=sharpen]http://mysite.com/path/to/image.png[/img_filter] Use the following as the Regular Expression \[img_filter=(.*?)\](.*?)\[/img_filter\] Use the following as the Replacement. <img src="http://mysite.com/path/to/image_filter.php?filename_gd=$2&filter_gd=$1" alt="$2" /> ********************************************************************************* Using the image_filter.js file and the class name filter and the alt attribute as the effect filter Note: See filter.html for working example Download the image_filter.js file and upload to a readable directory. Open image_filter.js and edit the url variable to: http://mysite.com/path/to/image_filter.php Add the following script include to the footer of your page or template: <script type="text/javascript" src="http://mysite.com/path/to/image_filter.js"></script> Usage: <img src="http://mysite.com/path/to/image.png" class="filter_gd" alt="sharpen" />