• Resolved gshaupert

    (@gshaupert)


    Short version: Why does WordPress try to display the medium (400×300) size generated image in the “Edit Image” page for the Media Library, and how do I make it display the actual image file?

    Long version: When I try to use “Edit Image” in either the Media Library or under “Gallery” when inserting images into Posts, no image shows up for editing. What I get is something that looks very similar to the screenshots in this post:
    https://www.ads-software.com/support/topic/edit-image-image-does-not-show-up

    I’ve determined that, for some images, WordPress tries to find the medium-size image generated during upload. For other images it uses the original image. For the images that don’t show up, in Firefox, no image shows – with Safari and IE, a “broken image” placeholder shows. I think this might be a “feature” introduced with a relatively recent upgrade because newer images seem to have this problem but older images don’t (no, I haven’t gone through all 900+ images on my site).

    Using various plugins and a few function.php tricks I’ve found online, my WordPress installation automatically resizes original images to 640×480, creates a small thumbnail (150 max height/width) and doesn’t generate the medium or large images. I don’t want anything more than the two images but I’d like to be able to occasionally use the online editing tool.

    Where I’m stuck is trying to figure out WHY (and where in the code) WordPress is trying to use the medium image and how to make it just look for the original image for all images. I’ve grovelled through the forums, bug listings and code to the best of my ability but I think I’m in over my head…

    I’ve found the generated URL for one of the images with problems, and if I put that directly into the Address bar, I get an error message like this:

    Warning: imagecreatefromjpeg(/my-website-location-munged/wp-content/uploads/2012/07/IMG_1517-400×300.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /my-website-location-munged/wp-admin/includes/image.php on line 385
    -1

    Note how the error message specifically references “IMG_1517-400×300.jpg” – the medium sized image. If I briefly rename one of the images that does display in “Edit Image”, I get a similar error message but the link references the original image, not a resize.

    I’ve done all the usual recommendations – deactivated plugins, temporarily renamed the plugin folder via FTP, set all the resized media settings to 0, reset my theme to the default – and uploaded new images between each step as tests and nothing seems to change WordPress’s desire to display the medium size images in the image editor. I don’t know if I should be looking through the database to remove references to the intermediate file sizes or modifying something in the php code that displays the image.

    Thank you for any explanations or pointers toward solutions!

Viewing 4 replies - 1 through 4 (of 4 total)
  • have you tried re-uploading all wordpress folders except wp-content? Also, did you try another theme? I have a feeing this has something to do with your theme or possibly core edits.

    Thread Starter gshaupert

    (@gshaupert)

    Thank you for getting me starting down another path that may lead to a solution! So far I’ve not figured out what exactly is happening BUT I have found that TwentyEleven seems to be part of the problem. Photos uploaded when it is the active theme display this problem but photos uploaded with other themes (tested with TwentyTen and Toolbox) do not. So there is something within that theme that makes the 300×400 featured image the “default” when dealing with the Edit Image page.

    Still grovelling through stuff but getting closer. I really need to sit down and learn how to write my own theme…

    I haven’t been able to tweek twenty eleven very well either. However what you are describing doesn’t sound like normal behaviour for that theme. Did you leave your plugins disabled when checking both themes? Could be a plugin only effecting twenty eleven. Also, I thought somewhere you had mentioned editing something in twenty eleven..? if so, try a fresh copy.

    Thread Starter gshaupert

    (@gshaupert)

    Sorry for the delay but here’s a summary of what worked for me to solve this immediate problem, plus customize the functionality of my site more to my liking. I realize my preferences are pretty specific but maybe this summary will help others on the path towards a solution if not provide an immediate fix. Thanks to deepbevel for assistance and inspiration on my quest…

    #1 Created a child theme for Twenty Eleven with a functions.php file that prevents generation of the default WordPress image sizes “medium” and “large”, and the Twenty Eleven custom image sizes “post-thumbnail”, “large-feature” and “small-feature”. Information from https://www.studiograsshopper.ch helped me figure out how to do this.

    #2 Temporarily switched to a theme that didn’t use any custom image sizes, for me specifically Toolbox by Automattic.

    #3 Used the “Additional image sizes (zui)” plugin to delete unwanted image sizes. In some cases, this seemed to just delete the reference to the image size in the database where I’d physically deleted the corresponding image from my server via FTP.

    #4 Switch to my custom child theme.

    For now, none of my site’s images use the “medium” size as the display image for the “Edit Image” page and I’m not getting blank areas or error messages when using “Edit Image”. I’ve not gone through all 950+ images but in a random sampling everything works. Also, the custom child theme prevents the creation of the sizes I don’t want.

    I’m using the “Imsanity” plugin to limit image dimensions to 640 pixels, so I end up with two versions of each uploaded image – a 150 pixel maximum dimension thumbnail and the original image resized to a maximum of 640 pixels. Just how I want it!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Edit Images – Image not displaying’ is closed to new replies.