wordpress 图像裁剪编辑器不工作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24043991/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:33:20  来源:igfitidea点击:

Image Crop Editor Not working

wordpressimageeditor

提问by Mixmastermiike

I am having an issue in WordPress admin, where the images are not cropping in WP "edit image" for a site I am creating and I do not know what the cause is.

我在 WordPress 管理员中遇到了一个问题,我正在创建的网站的图像没有在 WP“编辑图像”中裁剪,我不知道原因是什么。

I've read a few similar topics, but nothing seems to make a dent. I've deactivated all plugins and checked the server, but things seem to be set up just fine.

我读过一些类似的主题,但似乎没有任何影响。我已经停用了所有插件并检查了服务器,但一切似乎都设置得很好。

Can someone possibly steer me in the right direction on how I can get it to work or what might be causing the issue?

有人可能会引导我朝着正确的方向前进,让我如何让它工作或可能导致问题的原因是什么?

采纳答案by steffanjj

This should solve your problem:

这应该可以解决您的问题:

  • Remove all blank lines and whitespaces in /wp-content/themes/name/functions.php+ the including files.
  • Remove all blank lines and whitespaces in /wp-config.phpfile
  • Check that php5-gdis installed.
  • Permissions changed to 777 for testing /wp-content/upload/+ sub folders
  • Remove closing ( ?>) php tags in /wp-content/themes/name/functions.php+ the including files.
  • Turn off all plugins.
  • Rename your theme and change to default theme.
  • 删除/wp-content/themes/name/functions.php+ 包含文件中的所有空行和空格。
  • 删除/wp-config.php文件中的所有空行和空格
  • 检查php5-gd是否已安装。
  • 测试权限更改为 777 /wp-content/upload/+ 子文件夹
  • ?>/wp-content/themes/name/functions.php+ 包含文件中删除关闭 ( ) php 标记。
  • 关闭所有插件。
  • 重命名您的主题并更改为默认主题。

回答by Th?nh Ph?m

I had the same issue but the problem was missing the GD library, https://www.digitalocean.com/community/questions/installing-the-gd-image-library

我有同样的问题,但问题是缺少 GD 库,https://www.digitalocean.com/community/questions/installing-the-gd-image-library

To install (Linux/ Apache2):

安装(Linux/Apache2):

sudo apt-get update
sudo apt-get install php5-gd
sudo service apache2 restart

回答by PJ Brunet

Keep in mind, the interface is not intuitive and it's easy to forget that the [Save] button is still deactivated if you do the following:

请记住,界面并不直观,如果您执行以下操作,很容易忘记 [保存] 按钮仍处于停用状态:

  1. Click the crop button.
  2. Select the area you want.
  1. 单击裁剪按钮。
  2. 选择您想要的区域。

You must do the opposite.

你必须做相反的事情。

  1. Select the area you want.
  2. Click the crop button.
  1. 选择您想要的区域。
  2. 单击裁剪按钮。

回答by Fahim Hossain

I faced the same problem and got it solved. This may be a very late response, but can be useful for other people facing this problem. This is how I resolved it:

我遇到了同样的问题并得到了解决。这可能是一个很晚的响应,但对于面临此问题的其他人可能很有用。我是这样解决的:

Check your functions.phpfile. See, if you have the closing tag at the every end of the file.

检查您的functions.php文件。看,如果您在文件的每一端都有结束标记。

?>

removing this tag fixed my problem. Also can check out this link. Hope this helps!

删除此标签解决了我的问题。也可以查看此链接。希望这可以帮助!

回答by Red

You may be missing the GD library.

您可能缺少 GD 库。

To check that the server has it installed, try php -meat the command line. Scan for gd module.

要检查服务器是否安装了它,请尝试php -me在命令行中。扫描 gd 模块。

If it's missing, get it: sudo apt-get install php7.0-gd

如果丢失,请获取: sudo apt-get install php7.0-gd

回答by mracoker

None of the above worked for me. So in an effort to give back after taking so much from stackoverflow, here is what I did:

以上都不适合我。因此,为了在从 stackoverflow 中获得如此多的东西后回馈,这是我所做的:

Sometime during the install process a URL rewrite rule was created in IIS. I disabled this rule and then the image crop worked!

在安装过程中,有时会在 IIS 中创建 URL 重写规则。我禁用了这个规则,然后图像裁剪工作了!

回答by tiemco

After ruling out several causes ( PHP modules, memory limits ), trying to get useful debugging info, and migrating the site to different hosting, I found that the problem was caused by rewrite rules in the .htaccessfile.

在排除了几个原因(PHP 模块、内存限制)、尝试获取有用的调试信息并将站点迁移到不同的主机后,我发现问题是由.htaccess文件中的重写规则引起的。

In this case the rules where added by the security plugin All In One WP Security. Maybe, a newer version of the plugin would have fixed it, but I replaced it with another security plugin some time ago.

在这种情况下,规则由安全插件 All In One WP Security 添加。也许,更新版本的插件会修复它,但我前段时间用另一个安全插件替换了它。

With removing all rules from the .htaccessand gradually reintroducing them I discovered that the specific block of lines in .htaccesscausing the problem was:

通过从 中删除所有规则.htaccess并逐渐重新引入它们,我发现.htaccess导致问题的特定行块是:

# 5G:[QUERY STRINGS]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (\"|%22).*(<|>|%3) [NC,OR]
RewriteCond %{QUERY_STRING} (javascript:).*(\;) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3C).*script.*(>|%3) [NC,OR]
RewriteCond %{QUERY_STRING} (\|\.\./|`|='$|=%27$) [NC,OR]
RewriteCond %{QUERY_STRING} (\;|'|\"|%22).* (union|select|insert|drop|update|md5|benchmark|or|and|if) [NC,OR]
RewriteCond %{QUERY_STRING} (base64_encode|localhost|mosconfig) [NC,OR]
RewriteCond %{QUERY_STRING} (boot\.ini|echo.*kae|etc/passwd) [NC,OR]
RewriteCond %{QUERY_STRING} (GLOBALS|REQUEST)(=|\[|%) [NC]
RewriteRule .* - [F]
</IfModule>

回答by Bruce Schaller

I found that in my OVH WordPress server, version 4.7.5, imagemagickwas not installed and is required for this function to work properly:

我发现在我的 OVH WordPress 服务器中,版本 4.7.5imagemagick没有安装,并且需要此功能才能正常工作:

sudo apt-get install imagemagick
sudo service apache2 restart

回答by Gus

If someone is trying to accomplish this in an AWS Linux Environment, these commands worked for me:

如果有人试图在 AWS Linux 环境中完成此操作,这些命令对我有用:

yum install php71-pecl-imagick.x86_64

Of course, you can search for the corresponding imagemagickpackage for your environment:

当然,你可以搜索imagemagick你的环境对应的包:

yum search imagemagick

later, don't forget to do a:

之后,不要忘记做一个:

service httpd restart

for the changes to take effect on your WP

使更改对您的 WP 生效

回答by Chris D. Emerson

I tried everything here, but nothing helped. Eventually, I found an articlewhich mentioned giving IIS_IUSRSpermissions to the WP folder. And that finally got the crop tool working.

我在这里尝试了一切,但没有任何帮助。最终,我找到了一篇文章,其中提到了IIS_IUSRS授予 WP 文件夹的权限。这最终让裁剪工具开始工作。