Thumbnail blobs are blurred

Vote:
 

I have a class that extends 'ImageData'. There I have defined few thumbnail Blob properties for the different sizes. 

{
[ContentType(GUID = "0a89e464-56d4-449f-aea8-2bf774ab8730")]
[MediaDescriptor(ExtensionString = "jpg,jpeg,jpe,ico,gif,bmp,png")]
public class ImageMedia : ImageData
{
public virtual string AltText { get; set; }
public virtual string TitleText { get; set; }

/// 
/// Gets or sets the generated thumbnail for this media.
/// 
[ImageDescriptor(Width = 160, Height = 160)]
public Blob Thumbnail160X160
{
get { return base.Thumbnail; }
set { base.Thumbnail = value; }
}


}
}

Then I can request the particular image thumbnail in the URL. My problem is this generated thumbnail images look blurred than the original. Even the original image is with high resolution.  
Why is that happening and how to fix it?

#115021
Jan 08, 2015 9:28
Vote:
 

That happens because you are creating a thumbnail based on the thumbnail which is only 48x48 (if that makes sense).

Change your code to:

        [ImageDescriptor(160,160)]
        public virtual Blob  MyNewThumbnail{ get; set; }

The new blob will then be created from the source file, and not from the Thumbnail property.

#115035
Jan 08, 2015 11:54
Vote:
 

Also, remember to run the "clear thumbnail properties" scheduled job, so that you will reset those properties that have already been generated

#115042
Jan 08, 2015 13:14
Vote:
 

I actually tried this first place but it also gives a blurred thumbnail. According to your answer I did run the "clear thumbnail properties" scheduled job too. Still getting the same blurred thumbnail.  

#115151
Jan 12, 2015 6:39
Vote:
 

That sounds strange. Are you sure it's not cached? What happens if you create a new property with a different name?

#115152
Jan 12, 2015 9:09
Vote:
 

Yes. Checked with browser cache cleared. Also created a completely new property with different width and height. still getting a blurred thumbnail. 

#115155
Jan 12, 2015 10:12
Vote:
 

Does it happen with every image?

#115163
Jan 12, 2015 11:06
Vote:
 

Just tested with jpg, png and gif. It seems like only jpg images get blurred. This is not a huge quality drop but a slight different is visible in jpg images. 

#115164
Jan 12, 2015 11:23
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.