Support » Fixing WordPress » Edit Media Preview shows broken image

  • Resolved hexified

    (@hexified)


    After updating to 3.6 every time I upload an image using the media uploader it shows a broken image when you click on edit media.

    I’ve disabled all plugins and am using the default theme. Still no dice.

    I’ve noticed that the path to the image doesn’t exist upon using the inspector. It’s as if wordpress isn’t saving the original file and filename into my uploads folder but instead appends dimensions to the filename – causing a broken link.

    Any thoughts/solutions?

Viewing 8 replies - 1 through 8 (of 8 total)
  • esmi

    (@esmi)

    Forum Moderator

    Have you tried:

    – deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    – switching to the default theme to rule out any theme-specific problems.

    resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    – re-uploading all files & folders – except the wp-content folder – from a fresh download of WordPress. Make sure that you delete the old copies of files & folder before uploading the new ones.

    Yes, I’ve tried all that.

    The media upload only seems to properly show the thumbnail image if you upload a large resolution image that it crops and appends the dimensions to the filename.

    If I upload a small resolution image, it doesn’t seem to automatically crop it and it shows a broken image in the edit media window.

    ie: if I upload an image 600px wide, the preview shows a broken image. if I upload the same image 1000px wide, it shows the preview fine.

    I’ve noticed the the small resolution image doesn’t get uploaded to the media library folder at all under it’s original filename which causes the broken link (it only shows multiple versions that have been resized with dimensions appended to the name but not the original file itself).

    if I upload the large resolution image, wordpress automatically sizes down the image and appends the dimension to the filename in the media library folder and links it properly.

    This also happens under the default theme with all plugins disabled. I’m running a multi-site as well if that makes a difference.

    After a ton of investigation, I narrowed it down to my web.config. This is the only way I’ve managed to get my subdirectory multisites to show up properly but it apparently breaks my media library in the main site.

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name=”WordPress Rule 1″ stopProcessing=”true”>
    <match url=”^index\.php$” ignoreCase=”false”/>
    <action type=”None”/>
    </rule>
    <rule name=”WordPress Rule 2″ stopProcessing=”true”>
    <match url=”^wordpresstest/([_0-9a-zA-Z-]+/)?wp-admin$” ignoreCase=”false”/>
    <action type=”Redirect” url=”{R:1}wp-admin/” redirectType=”Permanent”/>
    </rule>
    <rule name=”WordPress Rule 3″ stopProcessing=”true”>
    <match url=”^” ignoreCase=”false”/>
    <conditions logicalGrouping=”MatchAny”>
    <add input=”{REQUEST_FILENAME}” matchType=”IsFile” ignoreCase=”false”/>
    <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” ignoreCase=”false”/>
    </conditions>
    <action type=”None”/>
    </rule>
    <rule name=”WordPress Rule 4″ stopProcessing=”true”>
    <match url=”^wordpresstest/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)” ignoreCase=”false”/>
    <action type=”Rewrite” url=”wordpresstest/{R:1}”/>
    </rule>
    <rule name=”WordPress Rule 5″ stopProcessing=”true”>
    <match url=”^wordpresstest/([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$” ignoreCase=”false”/>
    <action type=”Rewrite” url=”wordpresstest/{R:2}”/>
    </rule>
    <rule name=”WordPress Rule 6″ stopProcessing=”true”>
    <match url=”.” ignoreCase=”false”/>
    <action type=”Rewrite” url=”index.php”/>
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

    Figured out the issue finally…

    Apparently the Rule #3 was causing for some reason ONLY small resolution jpgs to not show up in the editor properly. Once I removed that rule, it fixed the issue.

    I have been dealing with this issue for months only to uninstall and reinstall wordpress 100000 billion times on one account and change dedicated server providers.

    Fix: Make sure you are able to see hidden files in either cpanel (When using File Manager, you cannot see these files and folders unless you select the option to show hidden files.) or your ftp program.

    Find the .htaccess file and delete everything in it or if you have made added stuff to it, delete the part defining the upload directory.

    WPyogi

    (@wpyogi)

    Forum Moderator

    @mininimbus – please stop posting this duplicate post in outdated posts that are resolved and totally unrelated to your issue/solution.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Edit Media Preview shows broken image’ is closed to new replies.