]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
cleaned up the names of ImageMagick functions
authorCash Costello <cash.costello@gmail.com>
Sat, 3 Oct 2009 18:28:36 +0000 (18:28 +0000)
committerCash Costello <cash.costello@gmail.com>
Sat, 3 Oct 2009 18:28:36 +0000 (18:28 +0000)
actions/create_thumbnails.php
actions/upload.php
lib/resize.php
lib/watermark.php

index 3fefb4f0d85d876e2d86282a3342ee6edb3ba221..3869e2dcfe9e8b65f2be9d05685638e6d08e95f0 100644 (file)
        \r
        if ($image_lib == 'ImageMagick') { // ImageMagick command line\r
                \r
-               if (tp_create_imagick_cmdline_thumbnails($image, $prefix, $filestorename) != true) {\r
+               if (tp_create_im_cmdline_thumbnails($image, $prefix, $filestorename) != true) {\r
                        trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick command line', E_USER_WARNING);\r
                        echo "Failed to create thumbnails";\r
                }\r
                \r
-       } else if ($image_lib == 'ImageMagickPHP') {  // ImageMagick PHP \r
+       } else if ($image_lib == 'ImageMagickPHP') {  // imagick PHP extension \r
                \r
                if (tp_create_imagick_thumbnails($image, $prefix, $filestorename) != true) {\r
                        trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick PHP', E_USER_WARNING);\r
index 209d8e17de6a47430af16cebc2b1900fd196117b..228253ddda5c177606ef531aa04995af27108929 100644 (file)
                // resize photos to create thumbnails\r
                if ($image_lib == 'ImageMagick') { // ImageMagick command line\r
                        \r
-                       if (tp_create_imagick_cmdline_thumbnails($file, $prefix, $filestorename) != true) {\r
+                       if (tp_create_im_cmdline_thumbnails($file, $prefix, $filestorename) != true) {\r
                                trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick command line', E_USER_WARNING);\r
                        }\r
                        \r
-               } else if ($image_lib == 'ImageMagickPHP') {  // ImageMagick PHP \r
+               } else if ($image_lib == 'ImageMagickPHP') {  // imagick php extension \r
                        \r
                        if (tp_create_imagick_thumbnails($file, $prefix, $filestorename) != true) {\r
                                trigger_error('Tidypics warning: failed to create thumbnails - ImageMagick PHP', E_USER_WARNING);\r
index 803cb8fa7601172ddc3a6e31f87cf659cb73ae21..9f4ecd4bc1a9112bf698d73ea3825092520f215d 100644 (file)
 \r
 \r
        /**\r
-        * Create thumbnails using PHP ImageMagick Library\r
+        * Create thumbnails using PHP imagick extension\r
         *\r
         * @param ElggFile holds the image that was uploaded\r
         * @param string   folder to store thumbnail in\r
 \r
        \r
        /**\r
-        * Resize using PHP ImageMagick Library\r
+        * Resize using PHP imagick extension\r
         *\r
         * Writes resized version of an already uploaded image\r
         * \r
         * @param string   name of the thumbnail\r
         * @return bool    true on success \r
         */\r
-       function tp_create_imagick_cmdline_thumbnails($file, $prefix, $filestorename)\r
+       function tp_create_im_cmdline_thumbnails($file, $prefix, $filestorename)\r
        {\r
                $image_sizes = get_plugin_setting('image_sizes', 'tidypics');\r
                if (!$image_sizes) {\r
                // tiny thumbnail\r
                $thumb->setFilename($prefix."thumb".$filestorename);\r
                $thumbname = $thumb->getFilenameOnFilestore();\r
-               $rtn_code = tp_imagick_cmdline_resize(  $file->getFilenameOnFilestore(),\r
-                                                                               $thumbname,\r
-                                                                               $image_sizes['thumb_image_width'],\r
-                                                                               $image_sizes['thumb_image_height'], \r
-                                                                               true);\r
+               $rtn_code = tp_im_cmdline_resize(       $file->getFilenameOnFilestore(),\r
+                                                                                       $thumbname,\r
+                                                                                       $image_sizes['thumb_image_width'],\r
+                                                                                       $image_sizes['thumb_image_height'], \r
+                                                                                       true);\r
                if (!$rtn_code)\r
                        return false;\r
                $file->thumbnail = $prefix."thumb".$filestorename;\r
                // album thumbnail\r
                $thumb->setFilename($prefix."smallthumb".$filestorename);\r
                $thumbname = $thumb->getFilenameOnFilestore();\r
-               $rtn_code = tp_imagick_cmdline_resize(  $file->getFilenameOnFilestore(),\r
-                                                                               $thumbname,\r
-                                                                               $image_sizes['small_image_width'],\r
-                                                                               $image_sizes['small_image_height'], \r
-                                                                               true); \r
+               $rtn_code = tp_im_cmdline_resize(       $file->getFilenameOnFilestore(),\r
+                                                                                       $thumbname,\r
+                                                                                       $image_sizes['small_image_width'],\r
+                                                                                       $image_sizes['small_image_height'], \r
+                                                                                       true); \r
                if (!$rtn_code)\r
                        return false;\r
                $file->smallthumb = $prefix."smallthumb".$filestorename;\r
                // main image\r
                $thumb->setFilename($prefix."largethumb".$filestorename);\r
                $thumbname = $thumb->getFilenameOnFilestore();\r
-               $rtn_code = tp_imagick_cmdline_resize(  $file->getFilenameOnFilestore(),\r
-                                                                               $thumbname,\r
-                                                                               $image_sizes['large_image_width'],\r
-                                                                               $image_sizes['large_image_height'], \r
-                                                                               false); \r
+               $rtn_code = tp_im_cmdline_resize(       $file->getFilenameOnFilestore(),\r
+                                                                                       $thumbname,\r
+                                                                                       $image_sizes['large_image_width'],\r
+                                                                                       $image_sizes['large_image_height'], \r
+                                                                                       false); \r
                if (!$rtn_code)\r
                        return false;\r
                $file->largethumb = $prefix."largethumb".$filestorename;\r
                \r
                \r
-               tp_imagick_cmdline_watermark($thumbname);\r
+               tp_im_cmdline_watermark($thumbname);\r
                \r
 \r
 \r
         * @param true|false $square If set to true, will take the smallest of maxwidth and maxheight and use it to set the dimensions on all size; the image will be cropped.\r
         * @return bool\r
         */\r
-       function tp_imagick_cmdline_resize($input_name, $output_name, $maxwidth, $maxheight, $square = false, $x1 = 0, $y1 = 0, $x2 = 0, $y2 = 0) {\r
+       function tp_im_cmdline_resize($input_name, $output_name, $maxwidth, $maxheight, $square = false, $x1 = 0, $y1 = 0, $x2 = 0, $y2 = 0) {\r
                \r
                \r
                // Get the size information from the image\r
index e28194b18615d0710a75c5f32ea28c93135e59c5..896be72fad90e916871fa216af1ab09455d1187c 100644 (file)
@@ -90,7 +90,7 @@ function tp_imagick_watermark($filename) {
        return true;
 }
 
-function tp_imagick_cmdline_watermark($filename) {
+function tp_im_cmdline_watermark($filename) {
        
        $watermark_text = get_plugin_setting('watermark_text', 'tidypics');
        if (!$watermark_text)