Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike Sheehan 4 posts 24 karma points
    Jun 16, 2015 @ 22:58
    Mike Sheehan
    0

    Image thumbnails missing from media picker in backoffice

    When browsing images with the media picker in the back office, several of the images are missing a thumbnail preview. If I go to the media section and select one of these images, the width, height and size are set to -1. If I re-save the image the thumbnail is restored.

    I tried republishing the entire site and also deleting the ClientDependency folder along with clearing my cache and I can't figure out how to restore all the missing thumbnails.

  • Mike Sheehan 4 posts 24 karma points
    Jun 17, 2015 @ 00:15
    Mike Sheehan
    0

    Update: Thanks to Paul Sterling, I was able to re-save all images with this code below. The thumbnails are working now.

    -- FROM PAUL STERLING

    Hi Mike -

    Looks like some sort of issue from the initial image Save(). You could do something along these lines to see if the correct values get set when saving for all images:

    var cts = new ContentTypeService(cs, ms); 
    var mediaType = cts.GetMediaType("image"); 
    var allImages = ms.GetMediaOfMediaType(mediaType.Id);
    
    foreach (var image in allImages) 
    { 
    var mediaImage = ms.GetById(image.Id); 
    ms.Save(mediaImage); 
    }
    

    Warning: could be slow!

Please Sign in or register to post replies

Write your reply to:

Draft