Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Dynamic slideshow with IrfanView


  • Please log in to reply
3 replies to this topic
PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
In another forum (on deviantART where I spent lot of time now), somebody asked for a slideshow software able to update automatically their list of displayed images whenever a new file is added to a folder.
The original intent was to send photos taken with a camera or phone to the PC via Bluetooth. It can also apply to fetching images from Internet via RSS feed or page scrapping, watching a network folder, etc.

I first looked at the image viewers I have: IrfanView and XnView. Both have good slideshow functions, but they request to fill a list of files before running it. :( Even if they can automatically fill the list with a given folder, they won't update it while running the show.
Then I looked at MyAlbum. A good image cataloger also able to run slideshow. Same limitation, but one interest is that it is scriptable!
I found a hack to run a function on each displayed image. This function scans the directory and if it find an unknown image, it adds it to the album.
Problem: newly added images are displayed in a flash, I found no way to change this. :(
If somebody is interested, I can show the script anyway.

So I fall back on my initial idea: IrfanView can display images in full screen view, and go to next image when hitting space. It can also be setup to loop on first image after the last one of the folder. But it doesn't update automatically the list of files. No problem, if I hit F5 before each next file command, it refreshes the list.
So I made an AutoHotkey script to automate all this: running IrfanView on the designed folder, wait a bit, send refresh and next image.
Exit on Escape.
Of course, you have to modify the script to change the path to the folder to scan, the path to IrfanView and the slideshow delay (see comments).

/*
SlideShow.ahk

Slideshow with IrfanView which auto-refreshes.

// by Philippe Lhoste <PhiLho(a)GMX.net> http://Phi.Lho.free.fr - http://PhiLho.deviantART.com
// File/Project history:
 1.00.000 -- 2008/05/20 (PL) -- Creation
*/
/* Copyright notice: See the PhiLhoSoftLicence.txt file for details.
This file is distributed under the zlib/libpng license.
Copyright (c) 2008 Philippe Lhoste / PhiLhoSoft
*/
PATH = E:\Temp	; Change the path to the folder that will be udpated
IV_PATH = C:\Program Files\UMedia\IrfanView\i_view32.exe	; Where you installed IrfanView

Loop %PATH%\*.jpg	; Just take the first image file in the folder, for starting
	file := A_LoopFileFullPath
Run %IV_PATH% %file% /fs/one/bf
Loop
{
	Sleep 1000	; Adjust this value for slideshow speed: 1000 = 1s, 5000 = 5s, etc.
	Send {F5}{Space}	; Next image
}

Esc::
	Send !{F4}	; Close full screen view
	Sleep 500
	WinClose ahk_class IrfanView
	ExitApp
Also available at <!-- m -->https://ahknet.autoh...o/SlideShow.ahk<!-- m -->
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

BoBo²
  • Guests
  • Last active:
  • Joined: --
Hi PhiLho, always a pleasure to know you're back, alive & kicking :D

Erm, what about to let AHK do the thing via an IE-kiosk-mode session, OR a frameless fullscreen AHK-GUI which could be updated with adding any 'newcomer' to its img-index variable??

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
Hi BoBo.
I just went the easy and fast way... IrfanView just understands lot of image formats, is reasonably fast, has lot of options (center image, resize it if too big, etc.), and well, as long as the job is done...
It was mostly a quick hack to answer a request, I don't plan to go further.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

jjjames
  • Members
  • 36 posts
  • Last active: Feb 18 2013 09:26 PM
  • Joined: 09 Aug 2009
Cool idea...did you ever get it pulling images from an rss feed? I would love to see that script!
Thanks