link config(command=handlerwidth=sizeheight=sizelink pack(side=leftexpand=yessavephotos append(photobutton(wintext='quit'command=win quitbg='beige'pack(fill=xreturn winsavephotos if __name__ ='__main__'imgdir (len(sys argv and sys argv[ ]or 'imagesmainsave viewer(imgdirkind=tkmain mainloop(figure - shows the results of applying fixed size to our buttonsall are the same size nowusing size taken from the images themselves the effect is to display all thumbnails as same-size tiles regardless of their shapeso they are easier to view naturallyother layout schemes are possible as wellexperiment with some of the configuration options in this code on your own to see their effect on the display figure - fixed-size thumbnail selection guirow frames scrolling and canvases (aheadthe thumbnail viewer scripts presented in this section work well for reasonably sized image directoriesand you can use smaller thumbnail size settings for larger image collections perhaps the biggest limitation of these programsthoughis that the thumbnail windows they create will become too large to handle (or display at allif the image directory contains very many files tkinter tourpart