• Resolved Jerry

    (@jierry)


    I am getting the following error whenever I try to crop any image while uploading the header image: ‘There has been an error cropping your image.’

    I have been facing this issue for quite some time now. I checked this issue online but I was not able to understand the solutions as it was too technical for me given that I am just a beginner.

    Please help!

Viewing 14 replies - 1 through 14 (of 14 total)
  • Theme Author Andrew Misplon

    (@misplon)

    Hi jierry

    Thanks for reaching out.

    If you’re adding your image via a theme setting in the Customizer, perhaps try going to Media > Add New in your main WordPress menu. Does the issue persist when adding and cropping in that location?

    Theme Author Andrew Misplon

    (@misplon)

    Let me know once you’ve run this quick test. Looking at the existing support topics on this issue, it sounds like it’s most likely a server configuration issue but it’s worth eliminating the above test and perhaps one or two others before moving onto the more technical troubleshooting steps.

    Thread Starter Jerry

    (@jierry)

    Yes, I am adding the image via the Customizer. The image that I want as my header is already added in the media library. So I don’t need to add it again. It’s just that when I upload it as a header image I want it to be cropped which is when I get this error. Is there any way around this?

    I tried to add it as a header image without cropping as well but now I get a very small image in the header. I have also uploaded my logo but it is nowhere to be seen on the header. I have added below a screenshot of the header area of my website which shows both the issues. Please help.

    https://drive.google.com/open?id=1TYfJd0xQk8c7O0o-c8_14vqJ8BSHcyu3

    Theme Author Andrew Misplon

    (@misplon)

    Thanks for the update.

    Ultra originally had its own logo setting before the core WordPress logo setting was added. Please, check Appearance > Customize > Theme Settings > Header: Logo. Either make use of the core WordPress logo setting or the theme logo setting. If both are used, only one of the settings will display which is most likely what’s happening here.

    Ultra doesn’t have a header background setting in the free version. However, you can add a header background image using Custom CSS. Go to Appearance > Custom CSS (if using a Custom CSS plugin) or Customize > Additional CSS and add:

    .site-header {
        background-image: url(https://demo.purothemes.com/ultra/wp-content/uploads/sites/3/2016/07/a-starry-night.jpg);
        background-position-x: 50%;
        background-position-y: 50%;
        background-repeat: no-repeat;
        background-size: cover;
    }

    Replace my URL https://demo.purothemes.com/ultra/wp-content/uploads/sites/3/2016/07/a-starry-night.jpg with yours. You can get the image URL from your Media Library. Go to Media, locate the image, click on it and use the “Copy Link” URL from the right panel.

    Because the header is thin and wide, many images might not be suitable. You can use the background-position-x and background-position-y values to change the part of the image that is in view.

    Hopefully, the above helps, let me know how it goes.

    Thread Starter Jerry

    (@jierry)

    Hi Andrew! Which test are you talking about?

    I assume it was using the Media Library from the main WordPress menu. I did try to crop my image from there as well but now I get this error:

    https://drive.google.com/open?id=1qTxOLSHWIi0LeNzcxHWTRwTA4lAQyTqN

    Theme Author Andrew Misplon

    (@misplon)

    Thanks.

    To confirm, we’re discussing two topics now. My advice regarding the logo and header background stands as its own point.

    The error you’re seeing in the Media Library is the other point of discussion. Before we move onto more technical troubleshooting, please, try:

    1. Temporarily switch to a default theme like Twenty Nineteen.
    2. Temporarily deactivate all plugins. If you’re using an optimisation or caching plugin, clear it before deactivating all plugins.

    Once the above is completed, check to see if the issue persists. This quick test will let you know if a plugin or the theme is causing the problem.

    Thread Starter Jerry

    (@jierry)

    Thanks a lot Andrew! It worked. I am facing another issue now. When I scroll down the page, the header stays affixed on the screen with a reduced size and it becomes completely white with the logo in the middle.

    I don’t want my header to be seen on top of the page when I scroll down. Any way to disable this?

    Theme Author Andrew Misplon

    (@misplon)

    Sure, Customize > Theme Settings > Header: Disable the Sticky Header setting.

    Thread Starter Jerry

    (@jierry)

    Oh yes! Missed that option. Thanks again!

    Regarding the issue with cropping images, it still persists. I deactivated all the plugins and tried cropping on three different themes but I get the same error message every time.

    What shall I do next?

    Theme Author Andrew Misplon

    (@misplon)

    Does the issue also persist if you deactivate all plugins and switch to a default theme like Twenty Nineteen?

    Thread Starter Jerry

    (@jierry)

    I didn’t use Twenty Nineteen or other WordPress themes as I didn’t see any option for the header image upload. I was able to upload the logo though with cropping.

    But I am facing this issue mainly when I am cropping my image for the header. I tried other themes where I faced this issue. My plugins were also deactivated.

    Theme Author Andrew Misplon

    (@misplon)

    Thanks

    The purpose of switching to Twenty Nineteen is just to run the Media Library test. You can try adding an image and cropping it. It’s possible to crop an image in the Media Library by editing it, it can be done without a header image upload setting. This test will let you know if Ultra is causing the error or not. It’s a method of ruling out the theme as the cause, just as we did with the plugin conflict test. Once the test is complete, you can change back to the theme you were using. If the error persisted using other themes then that’s a good confirmation that the theme isn’t the cause of this issue.

    Here is a topic explaining a bit about what might causing this problem https://wordpress.stackexchange.com/questions/302291/there-has-been-an-error-cropping-your-image-when-cropping-image. If you’d like to try the advice from this link go to Plugins > Add New, search for a plugin called Code Snippets. Once activated go to Snippet > Add New, name the snippet as you’d like and insert in the snippet body:

    function wpse303391_change_graphic_editor( $array ) {
    	return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
    }
    add_filter( 'wp_image_editors', 'wpse303391_change_graphic_editor' );

    Enable the option to run the snippet in the administration area and then click Save and activate (not just save, you must save and activate).

    I don’t know if this will help, I’m just passing on the info from that support topic.

    If the above isn’t helpful you can try contacting your hosts, ask them if Imagick and/or GD are installed.

    Thread Starter Jerry

    (@jierry)

    It worked! Thanks a ton! Can’t stress enough how useful this was as I was struggling with this issue for a long time.

    I had read the same kind of articles that you had mentioned here regarding this issue but being a beginner I had no idea what people were talking about. It was too technical for me.

    As you mentioned, I also understood that it may be because Imagick and/or GD are not installed. But I still didn’t know what they were.

    I will anyways try contacting my host. You mean the company that is hosting my website right? Will they be able to solve this issue? If they could do it that would be great as I don’t want to slow down my site with unnecessary plugins in the future.

    Theme Author Andrew Misplon

    (@misplon)

    Super, I’m glad to hear you’re making progress.

    Sure, you could still ask your host if Imagick or GD are installed on your server. I’m not familiar with this area of WordPress. Perhaps Imagick isn’t installed and this function resolved the issue by including GD in the list of editors to check? I wouldn’t think that this would cause performance issues but you can perhaps ask your hosts.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Error while cropping image’ is closed to new replies.