Posts: 9
Thanks received: 3
Thanks given: 0
Joined: Aug 2016
Hi,
While procrastinating on my random video player, I made a random slideshow player.
This dirty script run on Python 3.
You just need to change the path to your picture folder. The script will scan it and then display the pictures on a window.
Here it is :
https://pastebin.com/5847He0C
Feel free to use, share and modify it 😉
Hope that someone find it useful.
Greetings,
gryxo
Posts: 26,760
Thanks received: 13598
Thanks given: 7231
Joined: Jul 2006
18 Oct 2018, 22:14
(This post was last modified: 18 Oct 2018, 22:17 by Like Ra.)
Need to check what tkinter and PIL do.
Quick question: does Image.open add the path only or the whole binary?
Edit: how do you install tkinter?
Posts: 26,760
Thanks received: 13598
Thanks given: 7231
Joined: Jul 2006
18 Oct 2018, 22:29
(This post was last modified: 18 Oct 2018, 22:31 by Like Ra.)
OK, for Linux
o- Tkinter
o- Python v2 and not v3
o- pip install Pillow (PIL is for Windows only)
o- the folder must end up with /
And it still does not like some pictures:
File "slideshow-01.py", line 28, in <module>
photo = ImageTk.PhotoImage(image)
. . .
IOError: image file is truncated (1 bytes not processed)
mmmm....
Posts: 26,760
Thanks received: 13598
Thanks given: 7231
Joined: Jul 2006
Switched to another directory with pics and it works now!
Can be used for subliminals as well 😉
Posts: 9
Thanks received: 3
Thanks given: 0
Joined: Aug 2016
Tkinter is the basic GUI for Python. It sometimes comes in the basic package with Python.
PIL is used to work with images.
Sadly, Image.open is loading the whole picture in Ram, not only the path. But It's the only way I found to make it work (I'm a noob, there must be a better way to do it...).
Sorry about linux, I only used Windows to debug it 😟
I'm sure it works on JPG and PNG. And normally it would not crash when a bad picture is opened.... It need some tweaking, but it is a little bit out of my scope....
If someone can improve it, it would be awesome !
Posts: 9
Thanks received: 3
Thanks given: 0
Joined: Aug 2016
(18 Oct 2018, 22:34 )Like Ra Wrote: Switched to another directory with pics and it works now!
Can be used for subliminals as well 😉
Cool ! The video part is still in the pipe, coming soon !
Posts: 26,760
Thanks received: 13598
Thanks given: 7231
Joined: Jul 2006
18 Oct 2018, 23:48
(This post was last modified: 19 Oct 2018, 00:24 by Like Ra.)
(18 Oct 2018, 22:39 )gryxo Wrote: Image.open is loading the whole picture in Ram
What allows the program to show them much faster, what can be used as a foundation for subliminals 😉
Posts: 26,760
Thanks received: 13598
Thanks given: 7231
Joined: Jul 2006
Posts: 26,760
Thanks received: 13598
Thanks given: 7231
Joined: Jul 2006
Posts: 9
Thanks received: 3
Thanks given: 0
Joined: Aug 2016
(18 Oct 2018, 23:48 )Like Ra Wrote: (18 Oct 2018, 22:39 )gryxo Wrote: Image.open is loading the whole picture in Ram
What allows the program to show them much faster, what can be used as a foundation for subliminals 😉
Exactly !
Wow ! This site is so great ! Didn't know about it....