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.
Can someone possibly steer me in the right direction on how I can get it to work or what might be causing the issue?
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:
You must do the opposite.
I had the same issue but the problem was missing the GD library, https://www.digitalocean.com/community/questions/installing-the-gd-image-library
To install (Linux/ Apache2):
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!
This should solve your problem:
/wp-content/themes/name/functions.php
+ the including files./wp-config.php
filephp5-gd
is installed./wp-content/upload/
+ sub folders?>
) php tags in/wp-content/themes/name/functions.php
+ the including files.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!
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
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:If someone is trying to accomplish this in an AWS Linux Environment, these commands worked for me:
Of course, you can search for the corresponding
imagemagick
package for your environment:later, don’t forget to do a:
for the changes to take effect on your WP
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 Idiscovered that the specific block of lines in
.htaccess
causing the problem was:I was not able to crop images, too. The area, where the cropping should show was just blank, instead I got the error message:
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 ofwp-content
folder torwxr-x---
did solve it.If your WordPress installation hosted on Amazon Red hat, please, do the following:
For more check here.
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.I re-saved the
functions.php
file with file encodingUTF-8
. It worked for me.( Windows 10 )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!
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.
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
My problem was because I was uploading an SVG, so it could not crop it :D.
It worked after I saved it as an
.png