diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-05-12 22:27:34 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-12 22:27:34 +0000 |
commit | 0864d7ca650e6b7210d8fac695cd1a2985846577 (patch) | |
tree | e9197a51a0d47fa40cb38c7160d559a17c5028a8 | |
parent | 7c6276adb95ef664307d22a13c6ec7d024c8a00a (diff) |
Allow configurable padding options
-rw-r--r-- | core/helpers/graphics.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php index e591e465..22a9c750 100644 --- a/core/helpers/graphics.php +++ b/core/helpers/graphics.php @@ -188,9 +188,15 @@ class graphics_Core { } /** - * Overlay an image on top of the input file. Valid options are file, mime_type, position and - * transparency_percent. - * position is one of northwest, north, northeast, west, center, east, southwest, south, southeast + * Overlay an image on top of the input file. + * + * Valid options are: file, mime_type, position, transparency_percent, padding + * + * Valid positions: northwest, north, northeast, + * west, center, east, + * southwest, south, southeast + * + * padding is in pixels * * @param string $input_file * @param string $output_file @@ -204,7 +210,7 @@ class graphics_Core { list ($width, $height) = getimagesize($input_file); list ($w_width, $w_height) = getimagesize($options["file"]); - $pad = 10; + $pad = isset($options["padding"]) ? $options["padding"] : 10; $top = $pad; $left = $pad; $y_center = max($height / 2 - $w_height / 2, $pad); |