Skip to content

Instantly share code, notes, and snippets.

View awtprod's full-sized avatar

Andrew Ryan awtprod

  • New York, NY
View GitHub Profile
/**
* Place watermark on image
*
* Options:
* - 'input' Input file (path or gd resource)
* - 'output' Output path. If not specified, gd resource is returned
* - 'watermark' Watermark file (path or gd resource)
* - 'quality' Output image quality (JPG only). Value from 0 to 100
* - 'compression' Output image compression (PNG only). Value from 0 to 9
* - 'chmod' What permissions should be applied to destination image
<?php
class Photo extends AppModel {
var $name = 'Photo';
var $actsAs = array(
'Upload.Upload' => array(
'image'=> array(
'fields' => array(
'dir' => 'photo_dir',