Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have been trying to size my screenshot.png for my theme to 300x255 without losing aspect ratio. I have been doing this by getting my browser window width on my laptop to a size that is proportional to 300x255 so that I will get a screenshot without distortion but has not worked.

Moreover, I am working with a fixed width layout, that has a central content area and a background. Reducing the browser window will cover the background which is not desirable.

I believe there must be an easier way to do this and would like to know if there are any tools that theme developers use to get this right. I do not have photoshop but do have gimp installed.

I would appreciate any pointers you may have in this regard.

Thanks in advance nav

share|improve this question
2  
You are asking how to resize an image using GiMP? –  s_ha_dum Apr 28 '13 at 15:49
    
It does not matter what image manipulation tool is used what I am looking for is a repeatable process to get a screenshot of the right size. See my answer below. –  navanitachora Apr 30 '13 at 7:05
    
Yes, tools do matter and I like GiMP, but this is a WordPress Q&A site. I don't see how this is in any way WordPress specific. –  s_ha_dum Apr 30 '13 at 13:01
    
Yes in hindsight I probably should not have asked this question here forgive my ignorance. –  navanitachora May 1 '13 at 9:25
add comment

1 Answer 1

up vote -1 down vote accepted

I got around this problem by doing the following steps.

  1. Find out screensize we will call this <screenwidth> and <screenheight> for now.

  2. I made my browser fullscreen. I used Chrome for this as the header bar disappeared and I got the full screen height for my screenshot. This is not necesary however.

  3. If you have got a header subtract it from the screen height. <height> = <screenheight> - <header>.

  4. If you have a vertical scrollbar subtract this width from the width. <width> = <screenwidth> - <scrollbar-width>.

  5. Now in most screens these days especially laptops the width is ample but the height is not in which case we have to find out the width that is proportional to the height.

Therefore, <width-screenshot> = <height>/450 * 600 if you do not get whole number round it to the nearest even number.

  1. Now we have to get an so that we get our website show within the size <width-screenshot>x<height>. To calculate that we do (<screenhieght> - <scrollbar-width> - <width-screenshot>)/2.

  2. Open up and image manipulation program choose the crop function and input the width, height and x-offset values. Then crop and save the image.

  3. Open the saved image and choose the resize option and set the width to 600. The height should automatically become 450. Which is the desired size save the image.

This is a repeatable process and once you have the numbers it is just a question of reuse.

Hope that helps someone. nav

share|improve this answer
2  
What? Of course you have to crop an image to get the aspect ratio you want. You can just resize it down to 300 width and then crop to 255 height, or vice versa. I don't understand the need for all the additional steps. –  Andrew Bartel Apr 30 '13 at 7:20
    
Image manipulation is not something I do regularly so my skills are not obviously up to the mark. But I have learnt a lot from all who have commented. –  navanitachora May 1 '13 at 9:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.