Skip to content

Commit

Permalink
Remove MagickWand support
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Eshom <[email protected]>
  • Loading branch information
Oldiesmann committed Nov 11, 2023
1 parent 91f50c8 commit a86dfac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
18 changes: 5 additions & 13 deletions Sources/Actions/Admin/ACP.php
Original file line number Diff line number Diff line change
Expand Up @@ -1512,20 +1512,12 @@ public static function getServerVersions($checkFor)
}

// Why not have a look at ImageMagick? If it's installed, we should show version information for it too.
if (in_array('imagemagick', $checkFor) && (class_exists('Imagick') || function_exists('MagickGetVersionString')))
if (in_array('imagemagick', $checkFor) && class_exists('Imagick'))
{
if (class_exists('Imagick'))
{
$temp = new \Imagick();
$temp2 = $temp->getVersion();
$im_version = $temp2['versionString'];
$extension_version = 'Imagick ' . phpversion('Imagick');
}
else
{
$im_version = MagickGetVersionString();
$extension_version = 'MagickWand ' . phpversion('MagickWand');
}
$temp = new \Imagick();
$temp2 = $temp->getVersion();
$im_version = $temp2['versionString'];
$extension_version = 'Imagick ' . phpversion('Imagick');

// We already know it's ImageMagick and the website isn't needed...
$im_version = str_replace(array('ImageMagick ', ' https://www.imagemagick.org'), '', $im_version);
Expand Down
2 changes: 1 addition & 1 deletion Sources/Actions/Admin/Attachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ public static function attachConfigVars(): array
Lang::$txt['basedirectory_for_attachments_warning'] = Lang::$txt['basedirectory_for_attachments_current'] . Lang::$txt['basedirectory_for_attachments_warning'];

// Perform a test to see if the GD module or ImageMagick are installed.
$testImg = get_extension_funcs('gd') || class_exists('Imagick') || get_extension_funcs('MagickWand');
$testImg = get_extension_funcs('gd') || class_exists('Imagick');

// See if we can find if the server is set up to support the attachment limits
$post_max_kb = floor(Config::memoryReturnBytes(ini_get('post_max_size')) / 1024);
Expand Down
6 changes: 3 additions & 3 deletions Themes/default/languages/Admin.english.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
$txt['attachmentPostLimit'] = 'Max attachment size per post';
$txt['attachmentSizeLimit'] = 'Max size per attachment';
$txt['attachmentNumPerPostLimit'] = 'Max number of attachments per post';
$txt['attachment_img_enc_warning'] = 'Neither the GD module nor the IMagick or MagickWand extensions are currently installed. Image re-encoding is not possible.';
$txt['attachment_img_enc_warning'] = 'Neither the GD module nor the IMagick extension are currently installed. Image re-encoding is not possible.';
$txt['attachment_ini_max'] = 'Maximum allowed by php.ini: %1$s';
$txt['attachment_image_reencode'] = 'Re-encode potentially dangerous image attachments';
$txt['attachment_image_paranoid_warning'] = 'The extensive security checks can result in a large number of rejected attachments.';
Expand Down Expand Up @@ -459,9 +459,9 @@
$txt['avatar_max_width_upload'] = 'Maximum width of uploaded avatar';
$txt['avatar_max_height_upload'] = 'Maximum height of uploaded avatar';
$txt['avatar_resize_upload'] = 'Resize oversized large avatars';
$txt['avatar_resize_upload_note'] = '(requires GD module or ImageMagick with IMagick or MagickWand extension)';
$txt['avatar_resize_upload_note'] = '(requires GD module or ImageMagick with IMagick extension)';
$txt['avatar_download_png'] = 'Use PNG for resized avatars';
$txt['avatar_img_enc_warning'] = 'Neither the GD module nor the Imagick or MagickWand extensions are currently installed. Some avatar features are disabled.';
$txt['avatar_img_enc_warning'] = 'Neither the GD module nor the Imagick extensions are currently installed. Some avatar features are disabled.';
$txt['avatar_external'] = 'External avatars';
$txt['avatar_upload'] = 'Uploadable avatars';
$txt['avatar_server_stored'] = 'Server-stored avatars';
Expand Down
2 changes: 1 addition & 1 deletion Themes/default/languages/Help.english.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@
$helptxt['avatar_server_stored'] = 'This allows your members to pick from avatars stored on your server itself. By default they are stored in the "avatars" directory.<br>As a tip, if you create directories in that folder, you can make "categories" of avatars.';
$helptxt['avatar_external'] = 'With this enabled, your members can type in a URL to their own avatar. The downside of this is that, in some cases, they may use avatars that are overly large or portray images you don\'t want on your forum.';
$helptxt['avatar_download_external'] = 'With this setting enabled, external avatars will be downloaded from the URLs given by the users. On success, the avatars will be treated like uploaded avatars.';
$helptxt['avatar_action_too_large'] = 'This setting lets you reject images (from other sites) that are too big, or tells the user\'s browser to resize them, or to download them to your server.<br><br>If users put in very large images as their avatars and resize in the browser, it could cause very slow loading for your users - it does not actually resize the file, it just displays it smaller. So a digital photo, for example, would still be loaded in full and then resized only when displayed - so for users this could get quite slow and use a lot of bandwidth.<br><br>On the other hand, downloading them means using your bandwidth and server space, but you also ensure that images are smaller, so it should be faster for users. (Note: downloading and resizing requires either the GD library, or ImageMagick using either the Imagick or MagickWand extensions)';
$helptxt['avatar_action_too_large'] = 'This setting lets you reject images (from other sites) that are too big, or tells the user\'s browser to resize them, or to download them to your server.<br><br>If users put in very large images as their avatars and resize in the browser, it could cause very slow loading for your users - it does not actually resize the file, it just displays it smaller. So a digital photo, for example, would still be loaded in full and then resized only when displayed - so for users this could get quite slow and use a lot of bandwidth.<br><br>On the other hand, downloading them means using your bandwidth and server space, but you also ensure that images are smaller, so it should be faster for users. (Note: downloading and resizing requires either the GD library, or ImageMagick using the Imagick extension)';
$helptxt['avatar_upload'] = 'This setting is much like &quot;external avatars&quot;, except that you have better control over the avatars, a better time resizing them, and your members do not have to have somewhere to put avatars.<br><br>However, the downside is that it can take a lot of space on your server.';
$helptxt['avatar_download_png'] = 'PNGs are larger, but offer better quality compression. If this is unchecked, JPEG will be used instead - which is often smaller, but also of lesser or blurry quality.';

Expand Down

0 comments on commit a86dfac

Please sign in to comment.