• Resolved luxurytraveldiary

    (@luxurytraveldiary)


    Hi,
    I’m unable to edit an image using the wordpress image editor despite trying a variety of browsers.

    The ‘Edit Image’ overlay displays fine but displays a missing img icon where the image being edited should sit. Closer inspection shows that the AJAX request to GET the image via admin-ajax.php is returning -1.

    I’ve opened up permissions on the /upload directory and disabled plugins, the problem persists.

    My admin layer and site are both only available under https but I’ve checked and the relevant request to admin-ajax.php returns a 200, i.e. no un-expected redirects.

    I’m using the Twenty Fourteen theme with a child them but the only changes at this stage are to the theme’s style.

    Any pointers as to what could be causing this, gratefully received.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter luxurytraveldiary

    (@luxurytraveldiary)

    Did see that, disabled my child theme and checked the parent functions.php but nothing out of the ordinary in their, just using a vanilla twenty fourteen theme by wordpress so would expect it to be as bullet proof as themes come.

    Grasping at straws I disabled jetpack as python messes about with images, re: caching but no dice.

    Looks like its time to look a bit deeper.

    Thread Starter luxurytraveldiary

    (@luxurytraveldiary)

    The error’s thrown by stream_preview_image() specifically in this check:

    if ( is_wp_error( $img->resize( $w2, $h2 ) ) ) return false;

    Seems to be failing when trying to generate the preview image. I suspect something is lacking in regard to my version of imagick and / or my php install’s inclusion of the lib.

    How do I figure out if WordPress is using imagick, gd or neither? Wouldn’t the WordPress installer of flagged up any problems with the libs mentioned?

    This is my first weekend with wordpress so i’m learning as I’m going…

    do you have a link to your site?

    And you mentioned this is your first weekend, so this is a new wp install?

    I was going to suggest using cPanel to create a subdomain, installing wp again there and uploading a few images and checking if the images are editable there.

    Thread Starter luxurytraveldiary

    (@luxurytraveldiary)

    Direct link not available, issue occurs in the admin layer but site is www. luxurytraveldiary.com.

    Yup fresh install.

    RE: cPanel, pretty confident its not a hosting problem, (noticed some other folks having problems with dreamhost etc), sites hosted on our own server directly behind our firewall – have thought all along that there may be a Apache Rewrite rule messing things up but the virtualhost in question just has a single rule to force https, but am in the process of validating the path class-wp-image-editor.php is using to get the image.

    Hopefully its something as simple as a vhost config mess-up but confused as to why the error should show up in the scenario of editing an image. My money’s on something being wrong with our GD or imagick libs, would make sense as the error is thrown whilst WordPress is trying to generate the initial preview of the image to edit.

    Thread Starter luxurytraveldiary

    (@luxurytraveldiary)

    Little bit more info. Was slightly wrong above, after a bit more debugging seems the error is occurring slightly earlier in stream_preview_image(), when the editor is being set:

    $img = wp_get_image_editor( _load_image_to_edit_path( $post_id ) );
    if ( is_wp_error( $img ) ) {

    //debug
    echo “\n” . $img->get_error_message();

    wp_die( -1);
    return false;
    }

    Checked and the path wp_get_image_editor() is using to read the image is correct – rules out vhost issues.

    The underlying err is “No editor could be selected.” So the issue is that _wp_image_editor_choose( ) fails to choose an editor. i.e. can’t find a lib GD or Imagick that wants to deal with a .png issue occurs with .jpgs and .gifs too.

    That’s it for today!

    Thread Starter luxurytraveldiary

    (@luxurytraveldiary)

    Follow up for anybody that may experience this issue in the future. The problem was my setup lacking the ImageMagick, (my preferred graphics lib), PHP shared object – could of sworn I was already using it elsewhere.

    Resolution, (assumes the use of a PHP / Apache stack):

    1) Make sure your sever has the required underlying libraries, (ImageMagick Linux package, ImageMagick BSD port etc).
    2) Install the required PHP .so using pecl: ‘pecl install imagick’
    3) Add ‘extension=imagick.so’ to your php.ini
    4) Restart Apache

    Rejoice in your new found WordPress image editing functionality!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Image Editing’ is closed to new replies.