seperating imagick module paths

This commit is contained in:
Pogodaanton 2020-07-19 17:58:57 +02:00
parent 3208fc16f8
commit f2c1023cc3
2 changed files with 12 additions and 13 deletions

View File

@ -47,12 +47,13 @@ $table_prefix = "shadis_";
$upload_directory = dirname(__FILE__) . "/../uploads/";
/**
* Path to ImageMagick executable
* Make sure the given path is really the right one.
* Paths to ImageMagick executables
* You can often find these paths in the FAQs of hosting providers.
*
* Since the binary is called differently on macOS
* than on other platforms, you also need to append
* the name of the executable.
*
* At some hosters ImageMagick's modules are seperated in multiple executables,
* that's why you can assign a different path for each module. A good indication
* for this is if you can't find the executable "magick", but you can access
* "convert" or "identify" as standalone executables.
*/
$imagick_path = "/usr/local/bin/magick";
$imagick_path_convert = "/usr/local/bin/magick convert";
$imagick_path_identify = "/usr/local/bin/magick identify";

View File

@ -55,8 +55,7 @@ function generate_thumbnail(string $destination, string $image_path, string $mim
// Using an array to make this part more readable
$exec_array = array(
$GLOBALS["imagick_path"],
"convert",
$GLOBALS["imagick_path_convert"],
$image_path,
"-filter Triangle",
"-define " . $type,
@ -79,7 +78,7 @@ function generate_thumbnail(string $destination, string $image_path, string $mim
exec(implode(" ", $exec_array));
// Setting the thumbnail_height according to the newly generated image
return exec($GLOBALS["imagick_path"] . " identify -ping -format '%h' " . $destination);
return exec($GLOBALS["imagick_path_identify"] . " -ping -format '%h' " . $destination);
}
/**
@ -92,8 +91,7 @@ function generate_gif(string $destination, string $image_path)
{
// Using an array to make this part more readable
$exec_array = array(
$GLOBALS["imagick_path"],
"convert",
$GLOBALS["imagick_path_convert"],
$image_path,
"-colorspace RGB",
"-ordered-dither o8x8,8,8,4",
@ -106,5 +104,5 @@ function generate_gif(string $destination, string $image_path)
exec(implode(" ", $exec_array));
// Setting the thumbnail_height according to the newly generated image
return exec($GLOBALS["imagick_path"] . " identify -ping -format '%wx%h' " . $destination);
return exec($GLOBALS["imagick_path_identify"] . " -ping -format '%wx%h' " . $destination);
}