WordPress.org

Ready to get started?Download WordPress

Forums

Image editor, doesn't show preview image (11 posts)

  1. saas
    Member
    Posted 11 months ago #

    Hi,
    Recently I had to do some image size adjustments on a project I am working currently, I noticed a strange issue, its not showing preview image on image editor screen.

    /wp-admin/post.php?post=646&action=edit&image-editor

    and it looks similar to this question,

    http://wordpress.org/support/topic/edit-image-image-does-not-show-up?replies=10

    and same image as this one

    http://tinypic.com/view.php?pic=23i9ym9&s=5

    So please let me know how I can trace this issue, as I have reviewed debug log I don't see any errors (apart from notices etc not related to this issue).

  2. Media X
    Member
    Posted 11 months ago #

    So did you switch to the default theme? (it helped to a user in the topic you posted)
    Also, did you check functions.php?

  3. saas
    Member
    Posted 11 months ago #

    Yes I did change theme, and used default "Twenty Twelve" theme, and if I am using default theme and its not working means there is no point in checking functions.php.

    Also I am noticing issue with my image sizes list, as when I am inserting image into the post, its no longer showing me all sizes (default and custom) as a list in the media manager. Like bellow image shows

    http://postimg.org/image/ohn581xir/

    Its only showing me full size, but no other sizes, according to solve this first I debugged code and found no trace of cause then I re-did all the site (re-created posts etc) and it was fine but today when I went to modify image sizes noticed this issue again.

    But when I review source I can see all the size listed there like:

    <# if ( 'undefined' !== typeof data.sizes ) { #>
    	<label class="setting">
    	<span>Size</span>
    	<select class="size" name="size"
    	data-setting="size"
    	<# if ( data.userSettings ) { #>
    	data-user-setting="imgsize"
    	<# } #>>
    	<#
    	var size = data.sizes['thumbnail'];
    	if ( size ) { #>
    	<option value="thumbnail" >
    	Thumbnail &ndash; {{ size.width }} &times; {{ size.height }}
    	</option>
    	<# } #>
    	<#
    	var size = data.sizes['medium'];
    	if ( size ) { #>
    		<option value="medium" >
    	Medium &ndash; {{ size.width }} &times; {{ size.height }}
    	</option>
    	<# } #>
    	and so on.......................
    									</select>
    			</label>
    		<# } #>
  4. saas
    Member
    Posted 11 months ago #

    Several hours ago I updated wordpress to 3.6, and activated twenty thirty theme and de-activated all the plugins and I still can't make both work.

    1) Preview Image on cropping area (image editor)
    2) Showing all the image sizes on media manager "Insert Image" section.

    both mentioned above :(.

  5. esmi
    Forum Moderator
    Posted 11 months ago #

    Site url?

  6. saas
    Member
    Posted 11 months ago #

    Sorry @esmi I can't provide url here.

    But the problem is in backend (wp-admin -> dashboard) what good it will be to have url?

  7. saas
    Member
    Posted 11 months ago #

    I just did some debugging again and here is the data,

    Request:
    action=query-attachments
    &post_id=some-id
    &query%5Borderby%5D=date
    &query%5Border%5D=DESC
    &query%5Bposts_per_page%5D=40
    &query%5Bpaged%5D=1
    Response:
    {
        "success": true,
        "data": [{
            "id": some-id,
            "title": "some-title",
            "filename": "some-title.png",
            "sizes": {
                "full": {
                    "url": "http://mysite.com/wp-content/uploads/2013/07/some-title.png",
                    "height": 373,
                    "width": 1043,
                    "orientation": "landscape"
                }
            },
            "height": 373,
            "width": 1043,
        }]
    }

    I am debugging more, but maybe you could help me how I can proceed further.

    Note: according to this response, its only fetching single size (full) so need to know why not all sizes.

    Note: I am also using "Simple Image Sizes" plugin, maybe it has screwed something, but I also tried deactivating and still same issue.

    Note: this is partial response data, I can't show all the data here.

  8. WPyogi
    Volunteer Moderator
    Posted 11 months ago #

    I am also using "Simple Image Sizes" plugin

    Yes, you need to test this by turning off ALL plugins and switching to the default theme.

  9. saas
    Member
    Posted 11 months ago #

    @WPyogi I have done this

    Yes, you need to test this by turning off ALL plugins and switching to the default theme.

    with wordpress 3.5.2 and did it again with 3.6 no luck.

  10. saas
    Member
    Posted 11 months ago #

    I just finished another phase of debugging core, and so far this is my analysis.

    I have narrowed it down to

    wp-includes/media.php

    function wp_prepare_attachment_for_js($attachment);

    and
    foreach ($possible_sizes as $size => $label) {}

    if I dump this $possible_sizes it shows all my custom sizes, but

    if ($downsize = apply_filters('image_downsize', false, $attachment->ID, $size)) {}

    this doesn't seem to work????

    So anybody?????

  11. saas
    Member
    Posted 11 months ago #

    One more thing I am noticing,

    I have cloned live site to my local server (WAMP) and I added new image into media using POST EDIT screen "Add Media" button it showed me all the custom sizes after uploading.

    But when I do same procedure on live site it only showing me FULL size image :(

    Is there anything related to this functionality which requires PHP libraries or extensions installed which causing wordpress to not show custom sizes.?????

    Note: In local server its also showing preview image on crop & scale screen link:

    wp-admin/post.php?post=714&action=edit&image-editor

    What is this????

Reply

You must log in to post.

About this Topic