Use the convert program to convert between image formats as well as resize an image. It has ability to crop, change aspect ratio of image etc. Resizing image to exact size:
convert <input_img> -resize 300x200^ -gravity center -extent 300x200 <output_img>