• When I attempt to set the header image under the Appearance > Customize sidebar menu, I get the following error message:

    Error <filename.jpg>
    There has been an error cropping your image.

    This is regardless of theme, image, or image proportions either uploaded to or already existing in the Media Library. I have turned on DEBUG_MODE and WP_DEBUG_LOG but the wp-content/debug.log is not showing anything pertaining to this issue (but I am getting other messages, so I’m pretty sure debugging is configured correctly).

    I have also disabled plugins to rule out that being an issue.

    chown -R apache: <wproot>/* did not fix the issue either, nor did increasing the PHP memory limit.

    The only file that contains that error message ‘There has been an error cropping your image.’ is wp-includes/media.php at line 2985. My WordPress debugging skills are stretching to their current limitations, and I’m looking to see if anyone else has seen this before. Thank you.

Viewing 1 replies (of 1 total)
  • Hi, same here…

    Traced the issue back a bit further:

    'cropError' => __( 'There has been an error cropping your image.' ),

    Searching for occurrence of cropError in the wp directory found these 2 files:

    wp-includes/js/media-views.min.js

    and

    wp-includes/js/media-views.js

    So apparently the error message is being called from a javascript ‘routine’? The function calling the crop error is:

    onError: function() {
                            var filename = this.options.attachment.get('filename');
    
                            this.views.add( '.upload-errors', new media.view.UploaderStatusError({
                                    filename: media.view.UploaderStatus.prototype.filename(filename),
                                    message: _wpMediaViewsL10n.cropError
                            }), { at: 0 });
                    }

    So apparently making an error while uploading the file.

    Changing the dir permissions to 747 for wp-content/uploads dir fixed the error? So apparently the process writing the cropped image is not running as the apache user?.. This eventually lead me to find out permission on the ‘upload’ (and underlying dirs/files) is not correct. Do check your permissions.

    Now working fine for me.

Viewing 1 replies (of 1 total)
  • The topic ‘Error When Changing Header Image’ is closed to new replies.