1. A computer-implemented method comprising: determining an initial height and an initial width of an image that is associated with a search result, wherein the image is to be displayed in the search result in line with text associated with the search result, and wherein the search result includes an in-line image region for displaying the image in line with the text, and a text region for displaying the text; determining an initial height of the text region of the search result based at least on (i) the text associated with the search result, and (ii) an initial width of the text region; determining an initial width of the in-line image region of the search result based at least on (i) the initial height of the text region of the search result, (ii) the initial height of the image, and (iii) the initial width of the image; determining an adjusted height of the text region of the search result based at least on the initial width of the in-line image region of the search result; determining an adjusted width of the in-line image region of the search result based at least on the adjusted height of the text region of the search result; determining an adjusted height and an adjusted width of the image based at least on the adjusted width of the in-line image region of the search result; scaling at least a portion of the image based at least on the adjusted height and the adjusted width of the image; and outputting the scaled image for display in the search result in line with the text.