Resize and Crop Thumbnail Image

We all know one of the most annoying things in most of the Blogger Template is the thumbnail image distortion due to the adjustment in css. After a period of time to find out I discovered a trick to help resize and crop the image the correct size by tweaking the url. From there I make this jQuery code that automatically adjust thumbnail for any Blogger Template.

Features

  • Resize images without blurring.
  • Crop the image to the correct size.
  • Only works with image uploading in Blogger and Picassa.
  • Works with many elements of the blog.

How to use in Blogger

Login into Blogger choose your blog and go to Template >> Edit HTML. Now in the template coding, search for </head> and just above it paste the following code.
<script type='text/javascript'>//<![CDATA[
$(document).ready(function() {
  var w = 200;
  var h = 150;
  $('#PopularPosts1, #Related-Posts, .Something-Else').find('img').each(function(n, image){
    var image = $(image);
    image.attr({src : image.attr('src').replace(/s\B\d{2,4}/,'s' + w + '-h' + h +'-c')});
    image.attr('width',w);
    image.attr('height',h);
  });
});
//]]></script>
Now to resize and crop images you just have to add the ID or CLASS of the tag so that it could fetch all the images in it and do job. You can add many common IDs and Classes as you like.

If you want to do this for auto readmore with thumbnail, then you should use this ID "#Blog1" and put the above code in this code.
<b:if cond='data:blog.pageType != &quot;item&quot;'>
  <b:if cond='data:blog.pageType != &quot;static_page&quot;'>
    PUT CODE HERE.
  </b:if>
</b:if>
So ít wont resize and crop at post page.

Once everything is done, save the template by pressing that orange “Save” button located at the top of the screen and now the quality of your images won’t let you down.

3 comments

I'm on the fence about this, while more customization is good, I have a feeling this is a "in-progress" update, it just feels incomplete and half-way there.
We use badge layout for apps on design approvals (visual projects), so the image being displayed is important. Old layout "feels like" it had larger images,
maybe because the images were cropped more loosely so it's easier to tell which project it was at quick glance. Now the image is cropped closer, making it
harder to scan thru at quick glance. I find myself needing to click into the project more often than usual. Which makes the whole user experience less
efficient.
I have a couple suggestions that might make it work better:
1. Increase the height of the window the cover image is being displayed.
2. Let us to choose which image to be displayed as "cover" (like how Pinterest handles cover images of each board, was hoping for this for a long time)
3. Let us adjust which part of the image to show and how tight or loose the crop is (with a fixed window, let us move the image around and maybe enlarge or
shrink it to control what shows thru the window. Pinterest does a limited form of this, which is very useful in making the cover image relevant)
4. Allow Cover Image to be ordered in different hierarchy (currently every element can be ordered differently except the Cover Image, it seems to be stuck
in the 2nd spot, would like the option to set it on another spot in the layout. This one seems like an easy fix, since you guys allow that for every other
element already)

for this helpful Blog.
I used a WordPress plugin that I found interesting. So I would like to recommend it.
The Thanks plugin helps me quickly create and customize images before inserting them in my blog post.
Check at: https://getpikiz.com/wordpress-plugin/
It’s free.

We love to hear from you! Leave us a comment.