Image Crop Editor Doesn't Work

I have a problem in the WordPress admin area where images are not cropped in WP "edit image" for the site I am creating, and I do not know what the reason is.

I read a few similar topics, but nothing gets in the way. I deactivated all the plugins and checked the server, but everything seems to be configured just fine.

Can someone direct me in the right direction on how I can get it to work or what could be causing the problem?

+17
source share
16 answers

This should solve your problem:

  • Remove all empty lines and spaces in /wp-content/themes/name/functions.php + include files.
  • Remove all empty lines and spaces in the /wp-config.php file
  • Make sure php5-gd installed.
  • Permissions changed to 777 for testing /wp-content/upload/ + subfolders
  • Remove the closing ( ?> ) Php tags in /wp-content/themes/name/functions.php + include files.
  • Turn off all plugins.
  • Rename your theme and change to the default theme.
+5
source

I had the same problem, but there was no GD library in this problem, https://www.digitalocean.com/community/questions/installing-the-gd-image-library

To install (Linux / Apache2):

 sudo apt-get update sudo apt-get install php5-gd sudo service apache2 restart 
+18
source

I ran into the same problem and got it solved. This may be a very late answer, but may be useful to other people facing this problem. Here is how I solved it:

Check your functions.php file. See if you have a closing tag at each end of the file.

 ?> 

removing this tag solved my problem. You can also check this link . Hope this helps!

+9
source

Keep in mind that the interface is not intuitive, and it is easy to forget that the [Save] button is still deactivated if you follow these steps:

  1. Press the crop button.
  2. Select the area you want.

You must do the opposite.

  1. Select the area you want.
  2. Press the crop button.
+7
source

You may be missing the GD library.

To check if it is installed on the server, try php -me on the command line. Scan for the GD module.

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

+2
source

None of the above helped me. Therefore, to return after so much has been taken from stackoverflow, here is what I did:

Sometimes during the installation process in IIS, a URL rewrite rule was created. I disabled this rule, and then cropping the image worked!

+1
source

After eliminating several reasons (PHP modules, memory limitations), trying to get useful information about debugging and transferring the site to another hosting, I found that the problem was caused by rewriting rules in the .htaccess file.

In this case, the rules were added by the All In One WP Security plugin. Perhaps a newer version of the plugin would fix it, but I replaced it with another security plugin a while ago.

Having removed all the rules from .htaccess and gradually re-entering them, I found that the specific block of lines in .htaccess causing the problem was:

 # 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> 
+1
source

I found that on my WordPress OVH server, version 4.7.5, imagemagick not installed and is required for this function to work correctly:

 sudo apt-get install imagemagick sudo service apache2 restart 
+1
source

If someone is trying to do this in an AWS Linux environment, these commands work for me:

 yum install php71-pecl-imagick.x86_64 

Of course, you can find the appropriate imagemagick package for your environment:

 yum search imagemagick 

later do not forget to do:

 service httpd restart 

for the changes to take effect on your WP

+1
source

I saved the functions.php file with UTF-8 encoding again. It worked for me. (Windows 10)

0
source

I tried everything here, but nothing helped. In the end, I found an article that mentioned granting IIS_IUSRS permissions to the WP folder. And finally, a cropping tool was launched.

0
source

If your WordPress installation is hosted on Amazon Red Hat, do the following:

 sudo yum install php-gd 

For additional verification here .

0
source

I also could not crop the images. The area where the cropping should be displayed was simply empty, instead I received an error message:

Preview image cropping area. Mouse interaction required.

Now there were other suspicious things: there were no thumbnails in the image library. When activating developer mode in a browser, I noticed that some Wordpress resources could not load.

Solution: access rights to /wp-content were violated, Apache could no longer read files. In my case, the recursive change of permissions to the wp-content folder to rwxr-x--- solved this problem.

0
source

If you tried almost everything, but none of the suggestions worked, read on.

I encountered this problem on only one site in my development environment, where all other sites worked fine. In the end, it was the only file included with the UTF-8 specification header. Removed it and voila!

0
source

I had this problem because Media Previewer / Cropper was trying to extract images from http instead of https, and my server kept reporting 400 error while trying to extract the original images, because I am not currently setting up traditional non-ssl HTTP.

IE: I work on an alternate port and use https: // server: 9090 . When I try to crop the image, it tries to download the image via non-SSL http: // server: 9090 / path / to / image.png . It does not use the correct protocol, and the server responds with a 400 error, so the cropper cannot load the image and continue.

In my case, this happened in the "Settings" section of the "Themes" section. When using the multimedia library, the image was correctly loaded using the SSL protocol. However, I cannot change the image in the customizer without enabling http.

0
source

I had the same problem, but for me the solution was pretty simple. All I had to do was remove the image from the media page and then download it again.

Hope this helps someone else

0
source

Source: https://habr.com/ru/post/970329/


All Articles