Thank you. Take any photo editing software you like (gimp, photoshop, pixelmator...) and resize the image so that either the vertical or the horizontal side fits the required resolution AND the other one is larger or equal. Then crop the picture so that the other side fits. E.g. if you have a 2500x1500 photo and your target resolution is 1280x1024, resize it to 1701x1024 and crop it to 1280x1024 cutting out the most unimportant part of the image.