sewpafly / post-thumbnail-editor

Wordpress Plugin to manually edit post thumbnails
http://wordpress.org/extend/plugins/post-thumbnail-editor/
32 stars 18 forks source link

Blank screen #99

Closed perceptions closed 10 years ago

perceptions commented 10 years ago

When trying to use the PTE, I just get a blank screen. I'm trying from both the post edit and the media library. I've disabled all plugins, so I don't believe it is a conflict of any sort. Attached is a screenshot of the errors in my console. I don't see any errors in the server logs. screen shot 2014-05-05 at 1 08 43 pm

perceptions commented 10 years ago

By the way... I just realized that the Github version may be different from the one that I'm running (downloaded from the repository). I'll install the latest here and see if that makes a difference.

perceptions commented 10 years ago

Installed and tested the version from Github, and have the same problem. Attached is a console screenshot (the same errors appear both from the media library and in the post editor). screen shot 2014-05-05 at 3 55 06 pm

sewpafly commented 10 years ago

Ok, post_width needs to be set to the value of the current image that you're modifying, so let's see if we can track it down.

Try enabling debugging from Settings → Post Thumbnail Editor, and then reloading the editor. You should be able to see information in the file log. (The link for this is on the settings page as well).

Output should look like:

[DEBUG  ][2014-05-05T20:36:26+00:00][PTE-VERSION: 2.3.0
USER-AGENT:  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
WORDPRESS:   3.9]

Also to see what post_width is being set to, open the editor from 'Media Library' -> then click an the 'Thumbnails' option that appears when you hover over an image. (There is actually a better way that removes all the wordpress sidebars, the URL resembles this: http://wordpress/wp-admin/admin-ajax.php?action=pte_ajax&pte-action=iframe&pte-id=83 where you have to change the pte-id to the id of the image you want to modify)

Next, view source (ctrl+u in firefox/chrome).

There should be a section like this:

<script type="text/javascript" charset="utf-8">
   var post_id     = 83 
     , post_width  = 1680 
     , post_height = 1050 
     , pteI18n     = {"no_t_selected":"No thumbnails selected","no_c_selected":"No crop selected","crop_problems":"Cropping will likely result in skewed imagery","save_crop_problem":"There was a problem saving the crop...","cropSave":"Crop and Save","crop":"Crop","fitCrop_save":"Save","fitCrop_transparent":"Set transparent","transparent":"transparent\/white"};
var ajaxurl = "http://wordpress/wp-admin/admin-ajax.php";</script>

Do you see something different?

perceptions commented 10 years ago

OK, now that I've turned on debugging, things seem to be working fine (no more blank screen, cropping is working). Here's the log file: http://cathex.staging.wpengine.com/wp-content/uploads/ptetmp/log.txt

I see the javascript section that you're talking about. I looked at the page source for a couple of images, and it looks like the post_width is being set to whatever the width of my original image is.

perceptions commented 10 years ago

Another quick update: I turned on debugging on the live site to see if that was the difference (I know, stupid to think that would affect anything, but hope springs eternal). I noticed that the editor is working on some images, but not on others. So here is what I noticed:

On the images that were working, the media entry had set dimensions for the image. The others only had file sizes. When I tried to edit the images that had no dimensions, I got the following error message: "Image data does not exist. Please re-upload the image." I imagine the lack of image data is affecting the thumbnail editor – the post_width probably just isn't there. Do you know of anyone that has run into this before? Is this a limitation on the hosting side of things (I'm thinking that perhaps the images missing the data were too large)?

sewpafly commented 10 years ago

I haven't seen this before. Wordpress is supposed to put that information there when an image is uploaded.

Was there any more information with that error message? I can't find that error message in my plugin anywhere. I was hoping to find the context, to see if I could fallback to opening the raw file myself.

Update I read your post closer to see you were using the wordpress image editor. It sounds to me that the best path forward is to discover why those images don't have the metadata. (That would fix wordpress). I could add some hacks to open the raw image file and get the size in that case as well.

perceptions commented 10 years ago

No, no more information. But I did a search for the error message and found that quite a lot of people have had this problem. Mostly it seems related to the size of the image uploaded, and I noticed in one case it was a WP Smushit issue, which is a plugin we were using. My host said this plugin has been a problem for other people (although not specifically in this circumstance). I've deactivated that on the live site and will monitor it over the next day as the editor adds new stuff. If there are no more issues with the image data, I have to assume it was that plugin causing the problem.

On Tue, May 6, 2014 at 2:48 PM, Brent notifications@github.com wrote:

I haven't seen this before. Wordpress is supposed to put that information there when an image is uploaded.

Was there any more information with that error message? I can't find that error message in my plugin anywhere. I was hoping to find the context, to see if I could fallback to opening the raw file myself.

— Reply to this email directly or view it on GitHubhttps://github.com/sewpafly/post-thumbnail-editor/issues/99#issuecomment-42342832 .