GD: Elgg requires GD for image resizing. Tidypics uses GD by default for \r
resizing. There are two versions GD and GD2. It generally does not matter \r
which one you are using and it isn't always apparent which one you are\r
-running anyways.\r
+running anyway.\r
\r
ImageMagick: A significantly better image library than GD. It uses less \r
memory during resizing. Use this if it is available.\r
\r
+exec: Calls to ImageMagick command line utilities like convert require that\r
+exec() be available. On some servers it will be for security reasons.\r
+\r
Memory Available to PHP: The amount of RAM available to a single PHP \r
process. This can have an effect on how large an image you can resize\r
(especially if you are running Tidypics with GD). The best place to\r
'tidypics:settings:maxfilesize' => "Maximum image size in megabytes (MB):",\r
'tidypics:settings:quota' => "User/Group Quota (MB) - 0 equals no quota",\r
'tidypics:settings:watermark' => "Enter text to appear in the watermark - ImageMagick Cmdline must be selected for the image library",\r
- 'tidypics:settings:im_path' => "Enter the path to your ImageMagick commands",\r
+ 'tidypics:settings:im_path' => "Enter the path to your ImageMagick commands (with trailing slash)",\r
'tidypics:settings:img_river_view' => "How many entries in river for each batch of uploaded images",\r
'tidypics:settings:album_river_view' => "Show the album cover or a set of photos for new album",\r
'tidypics:settings:largesize' => "Primary image size",\r
}\r
if(substr($im_path, strlen($im_path)-1, 1) != "/") $im_path .= "/";\r
$command = $im_path . "convert \"$input_name\" -resize ".$newwidth."x".$newheight."^ -gravity center -extent ".$newwidth."x".$newheight." \"$output_name\"";\r
- system($command);\r
+ exec($command);\r
return $output_name;\r
\r
}\r
return $size;
}
+ $disablefunc = explode(',', ini_get('disable_functions'));
+ $exec_avail = "Disabled";
+ if (is_callable('exec') && !in_array('exec',$disablefunc))
+ $exec_avail = "Enabled";
ob_start();
<td>Elgg requires the GD extension to be loaded</td>
</tr>
<tr>
- <td>ImageMagick</td>
+ <td>ImageMagick PHP</td>
<td><?php echo (extension_loaded('imagick')) ? 'Enabled' : 'Disabled'; ?></td>
<td></td>
</tr>
+ <tr>
+ <td>exec()</td>
+ <td><?php echo $exec_avail; ?></td>
+ <td>Required for ImageMagick command line</td>
+ </tr>
<tr>
<td>Memory Available to PHP</td>
<td><?php echo ini_get('memory_limit'); ?>B</td>
$action = $vars['url'] . 'action/tidypics/settings';\r
\r
$plugin = find_plugin_settings('tidypics');\r
+ \r
+ \r
+ if (extension_loaded('imagick'))\r
+ $img_lib_options['ImageMagickPHP'] = 'ImageMagick';\r
+ \r
+ $disablefunc = explode(',', ini_get('disable_functions'));\r
+ if (is_callable('exec') && !in_array('exec',$disablefunc))\r
+ $img_lib_options['ImageMagick'] = 'ImageMagick Cmdline';\r
+\r
+ $img_lib_options['GD'] = 'GD';\r
\r
\r
- // Image Library - need to update values!\r
+ // Image Library\r
$image_lib = $plugin->image_lib;\r
if (!$image_lib) $image_lib = 'GD';\r
$form_body = '<p>' . elgg_echo('tidypics:settings:image_lib');\r
$form_body .= elgg_view('input/pulldown', array(\r
'internalname' => 'params[image_lib]',\r
- 'options_values' => array(\r
- 'GD' => 'GD',\r
- 'ImageMagickPHP' => 'ImageMagick',\r
-/* 'ImageMagick' => 'ImageMagick Cmdline', */\r
- ),\r
+ 'options_values' => $img_lib_options,\r
'value' => $image_lib\r
));\r
- $form_body .= '</p>';\r
-/*\r
- // Image Magick Path\r
- $im_path = $plugin->im_path;\r
- if(!$im_path) $im_path = "/usr/bin/";\r
- $form_body .= "<p>" . elgg_echo('tidypics:settings:im_path') . "<br />";\r
- $form_body .= elgg_view("input/text",array('internalname' => 'params[im_path]', 'value' => $im_path)) . "</p>";\r
-*/\r
+ $form_body .= '<br/>Note: If you want to select ImageMagick Command Line, first confirm that it is installed on your server.</p>';\r
+\r
+ if (is_callable('exec') && !in_array('exec',$disablefunc)) {\r
+ // Image Magick Path\r
+ $im_path = $plugin->im_path;\r
+ if(!$im_path) $im_path = "/usr/bin/";\r
+ $form_body .= "<p>" . elgg_echo('tidypics:settings:im_path') . "<br />";\r
+ $form_body .= elgg_view("input/text",array('internalname' => 'params[im_path]', 'value' => $im_path)) . "</p>";\r
+ }\r
+\r
// Tagging\r
$tagging = $plugin->tagging;\r
if(!$tagging) $tagging = "enabled";\r