The MU forums have moved to WordPress.org

Image Editor Issues (14 posts)

  1. petebekisz
    Member
    Posted 4 years ago #

    Hello,

    I'm having an interesting issue with the image editor, and I'm not sure if it's an issue with WP or if I'm misunderstanding what the image editor does.

    I'm having issues inserting the changed image. When I crop an image, it saves the cropped image on the server, but I can't figure out how to insert it into the post. If I click "Insert into Post" on the bottom, the dimensions are correct, but it uses the original photo JPG's URL, not the URL to the JPG it just saved.

    Any thoughts on this?

    - Pete

  2. agreda
    Member
    Posted 4 years ago #

    I have been struggling with the same issue. The image editor functions and previews the edited image properly. Checking the blog's files directory reveals that the image is indeed getting saved. When selecting Insert Image, however, the original un-edited version gets inserted. Have tried suggestions from the WP forums including deactivating plugins to troubleshoot, but I cannot get edited images to insert into posts.

    Anyone else having this trouble?

    PHP version: 5.2.11
    Graphic Library GD Version: bundled (2.0.34 compatible)

  3. petebekisz
    Member
    Posted 4 years ago #

    I've tried disabling all of the plugins I'm running and I still can't get it to work.

    I wonder if there's anything similar between our two installations. Are you running any MU-specific plugins? We're running WP-LDAP and wp-super-cache.

  4. agreda
    Member
    Posted 4 years ago #

    No cache plugins here, but plenty of other MU stuff in the works...

    MU-PLUGINS
    Admin Ads*
    Avatars*
    Comment Indexer*
    Post Indexer*
    Custom Content Dashboard Widget*
    Dashboard Feeds*
    Limit Revisions
    Toggle Admin Menus
    First Comment*
    Friends*
    Invites
    Logout Redirect
    MU WP Footer HTML
    Personal Welcomes
    Random Blog Redirect
    Simple Sitemaps*
    Signup Blog Description*
    Signup Terms of Service*
    Supporter*
    Anti-Splog Beta 1*
    Recent Global Posts Feed*
    Recent Global Comments Feed*
    Recent Global Posts*
    Recent Global Comments*
    List-All
    New User

    *WPMU Dev Premium

    PLUGINS
    cforms (Blog ID 1 Only)
    NextGEN Gallery (Blog ID 1 Only)
    Simple:Press Forum (Blog ID 1 Only)
    Unfiltered MU (Blog ID 1 Only)
    Text Link Ads (Blog ID 1 Only)
    TypePad AntiSpam (All Blogs)
    Flash Photo Gallery (Supporters Only)
    All in One SEO Pack (Supporters Only)
    Subscribe To Comments (Supporters Only)
    Viper's Video Quicktags (Supporters Only)
    WP-SpamFree (Supporters Only)

    I've painstakingly tried to troubleshoot conflicts without any success. Edited images are getting saved and preview fine in the Media Library of various different blogs, but the original file still gets inserted. :-\

    Glad to hear it's not just me, but hard to believe there aren't others reporting the same issue. Can anyone verify successful use of the new image editor in WPMU 2.9.1?

  5. petebekisz
    Member
    Posted 4 years ago #

    We're not running any of the same plugins, period. I tried deactivating all of them with no luck.

    That's the same thing that's happening to me -- files are saving fine, but it's inserting the original.

  6. agreda
    Member
    Posted 4 years ago #

    Just bumping this topic for anyone else out there after confirming that the editor is functioning properly on one of our our plain WP installs, while it still inserts original images in WPMU, with or without plugins activated, regardless of theme.

    Any and all feedback welcome. Thanks!

  7. agreda
    Member
    Posted 4 years ago #

    Update: Been doing some further testing after following this WP forums Image Editor issues topic.

    I also just confirmed the Image Editor is working on our standard WP install. Even with all plugins deactivated, however, these symptoms continue under WPMU 2.9.1 -- images inserted at full size (or thumbnail), only get stretched (if scaled) with no cropping effects. All effects apply correctly on images inserted at Medium size.

  8. tomdebruin
    Member
    Posted 4 years ago #

    I'm having the same problem here. I have nothing more to add to that comment. Hopefully an update will fix it soon.

  9. ssandison
    Member
    Posted 4 years ago #

    I am also having this problem on WPMU 2.9.1. Is there any news when it will be fixed? The same bug also seems to be present in trunk (3.0 alpha).

  10. DeannaS
    Member
    Posted 4 years ago #

    It's at least partly fixed in the 2.9 branch - but Donncha needs testers before he can tag and go live with that. The more testers, the faster the turn around will be on this one.

    http://mu.wordpress.org/forums/topic/16830?replies=13

  11. ssandison
    Member
    Posted 4 years ago #

    I have created a ticked in trac and fixed this:

    http://core.trac.wordpress.org/ticket/12330

    I guess this fix is only useful for standalone users (until WP 3.0 at least).

    I'm not sure if I am treading on Donncha's toes a little here but the bug appears to still be in the MU codebase. I have a diff file for MU if thats any help?

  12. DeannaS
    Member
    Posted 4 years ago #

    Have you read this thread:
    http://mu.wordpress.org/forums/topic/16830?replies=22

    Are you still seeing the error using that version of the code? (WPMU trac is different than WP trac - the newest code is in the branch, not trunk.)

  13. ssandison
    Member
    Posted 4 years ago #

    I have now lol. I took a look in the 2.9 branch and it doesn't look to be fixed to me. It looks like a few lines of code that had been commented out that break in MU have been un-commented out:

    /* Breaks WordPress MU image upload path
    elseif ( false !== strpos($file, 'wp-content/uploads') )
    	$url = $uploads['baseurl'] . substr( $file, strpos($file, 'wp-content/uploads') + 18 );
    else
    	$url = $uploads['baseurl'] . "/$file"; //Its a newly uploaded file, therefor $file is relative to the basedir.
    */

    has become:

    elseif ( false !== strpos($file, 'wp-content/uploads') )
    	$url = $uploads['baseurl'] . substr( $file, strpos($file, 'wp-content/uploads') + 18 );
    else
    	$url = $uploads['baseurl'] . "/$file"; //Its a newly uploaded file, therefor $file is relative to the basedir.

    This seems to me like re-introducing an old bug. The fix I have made I believe addresses the problem by fixing those lines to work under MU correctly. Of course there could be a very good reason that it is now ok to un-comment these lines that I am unaware of and I would be happy to be told that I have misunderstood something. I am new to delving into the core code (but very keen!) so I'd appreciate the feedback. I have rewritten the wp_get_attachment_url() code slightly to the following:

    function wp_get_attachment_url( $post_id = 0 ) {
    	$post_id = (int) $post_id;
    	if ( !$post =& get_post( $post_id ) )
    		return false;
    
    	$url = '';
    	if ( $file = get_post_meta( $post->ID, '_wp_attached_file', true) ) { //Get attached file
    
    		// Files path
    		$uploads = wp_upload_dir();
    		$file_path = explode('wp-content', $uploads['basedir']);
    		$file_path = 'wp-content' . $file_path[1];
    
    		if ( $uploads && false === $uploads['error'] ) { //Get upload directory
    			if ( 0 === strpos($file, $uploads['basedir']) ) //Check that the upload base exists in the file location
    				$url = str_replace($uploads['basedir'], $uploads['baseurl'], $file); //replace file location with url location
    			elseif ( false !== strpos($file, $file_path) )
    				$url = $uploads['baseurl'] . substr( $file, strpos($file, $file_path) + strlen($file_path) );
    			else
    				$url = $uploads['baseurl'] . "/$file"; //Its a newly uploaded file, therefor $file is relative to the basedir.
    
    		}
    	}
    
    	if ( empty($url) ) //If any of the above options failed, Fallback on the GUID as used pre-2.7, not recomended to rely upon this.
    		$url = get_the_guid( $post->ID );
    
    	if ( 'attachment' != $post->post_type || empty($url) )
    		return false;		
    
    	return apply_filters( 'wp_get_attachment_url', $url, $post->ID );
    }
  14. Sinatra
    Member
    Posted 4 years ago #

    When I crop an image and then choose that cropped image to be the "Page Image" the thumbnail that shows up on the published page is a thumbnail of the full image, not a thumbnail of the cropped image. Anyone else having this problem and is there a fix? Thanks.

About this Topic

  • Started 4 years ago by petebekisz
  • Latest reply from Sinatra