Image Crop Editor Not working

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.

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.

Read More

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

Related posts

Leave a Reply

17 comments

  1. 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.

    You must do the opposite.

    1. Select the area you want.
    2. Click the crop button.
  2. 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.php file. See, if you have the closing tag at the every end of the file.

    ?>
    

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

  3. 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.php file
    • Check that php5-gd is 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.
  4. 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:

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

  5. You may be missing the GD library.

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

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

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

    sudo apt-get install imagemagick
    sudo service apache2 restart
    
  7. If someone is trying to accomplish this in an AWS Linux Environment, these commands worked for me:

    yum install php71-pecl-imagick.x86_64
    

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

    yum search imagemagick
    

    later, don’t forget to do a:

    service httpd restart
    

    for the changes to take effect on your WP

  8. 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 .htaccess file.

    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.

    With removing all rules from the .htaccess and gradually reintroducing them I
    discovered 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>
    
  9. I was not able to crop images, too. The area, where the cropping should show was just blank, instead I got the error message:

    Image crop area preview. Requires mouse interaction.

    Now, there was also other suspicous things: the media image library showed no thumbnails. When activating developer mode in the browser, I noticed some resources of WordPress could not load.

    Solution: the access rights to /wp-content were broken, Apache was no longer able to read the files. In my case, recursively changing the access rights of wp-content folder to rwxr-x--- did solve it.

  10. I tried everything here, but nothing helped. Eventually, I found an article which mentioned giving IIS_IUSRS permissions to the WP folder. And that finally got the crop tool working.

  11. If you’ve tried just about everything but none of the suggestions work, read on.

    I was experiencing this issue on just one site in my dev environment where all other sites were working fine. It ended up being a single included file with UTF-8 BOM header. Removed it and voila!

  12. I was having this issue because the Media Previewer/Cropper was attempting to pull the images from http instead of https and my server kept reporting an error 400 when attempting to pull the source images because I do not currently expose traditional non-ssl HTTP.

    IE: I’m running on an alternate port and using https://server:9090. When I attempt to crop an image, it tries to load the image via non-ssl http://server:9090/path/to/image.png. It doesn’t use the correct protocol and the server responds with a 400 error, thus the cropper is unable to load the image and continue.

    In my case, this was happening in the “Customize” section under “Themes”. When using the Media Library, it loaded the image correctly over SSL. However, I can’t change the image in the customizer without enabling http.

  13. I had the same problem, but for me the solution was quite easy. All I had to do was to remove the image from the media page and then upload it again.

    Hope this helps someone else