how to create image viewer using python

preview_player
Показать описание
In this video, we will create image viewer using python or we can say python image viewer GUI . we will use Tkinter to create this image viewer. this python project can be beneficial for those who are intermediate want to have a good grip on python GUI, we will also use pillow (PIL) to handle our image processing
Рекомендации по теме
Комментарии
Автор

Thanks!
To solve the problem of 'list index out of range' we can use the modulo operation:
-> for next picture: n = (n + 1) % len(items_list)
-> for previous picture: n = (n - 1) % len(items_list)

whitebird
Автор

There is another bug you may not be aware of. ??
Try changing your root background color to black or something.
You'll see that as you go from image to image it creates a white space blow the preview image and continues as you browse through images.... is there a fix for that?

KnightRiderGuy
Автор

Thanks a lot for your video
I tried the below code to solve the problem of "list index out of range"
In Next()
if i < len(image_list)-1:
i += 1
else:
i = 0
In Rrevious()
if i > 0:
i -= 1
else:
i = len(image_list) - 1

maowarisa
Автор

I'm getting error for Label(root, image=' ') in resize_image().
Can i get any solution?

prashantkushwah
Автор

Don't use string concatention to generate file paths. And your image viewer isn't keeping the aspect ratio of images so it's not that good at viewing them.

piotrmalinski
Автор

I have an error..can you help me?
Like that:

AttributeError: ‘PhotoImage’ object has no attribute ‘_PhotoImage__photo’

im_the_raymond