for exampleclicking the left and right mouse buttons will resize the image to the display' height and width dimensionsrespectivelyand pressing the and keys will zoom the image in and out in percent increments both resizing schemes allow you to shrink an image too large to see all at onceas well as expand small photos they also preserve the original aspect ratio of the photoby changing its height and width proportionallywhile blindly resizing to the display' dimensions would not (height or width may be stretchedonce resizedimages may be saved in files at their current size pyphoto is also smart enough to make windows full size on windowsif an image is larger than the display pyphoto source code because pyphoto simply extends and reuses techniques and code we met earlier in the bookwe'll omit detailed discussion of its code here for backgroundsee the discussion of image processing and pil in and the coverage of the canvas widget in in shortpyphoto uses canvases in two waysfor thumbnail collections and for opened images for thumbnailsthe same sort of canvas layout code as the earlier thumbnails viewer in example - is employed for imagesa canvas is used as wellbut the pyphotoan image viewer and resizer