[mythtv-users] Progress bar on import images

Les Gondor les at totalgraphix.ca
Fri Mar 11 18:44:52 UTC 2005


Kevin,

It doesn't use the mythtv theme, but here is a quick and dirty script 
that uses gphoto2 to import images from a USB-attached camera (A Canon 
Powershot A30 in my case). Just add it to the import path in the 
mythgallery settings page.

Cheers,
Les Gondor

Kevin Barsby wrote:
>>Unless someone else put it in sometime after I coded
>>it, no.  (I haven't looked at the code in a while)
> 
> 
> Ok, how easy would it be to add something like this in? I've been
> thinking about cutting my teeth on a small piece of myth coding for a
> while, and this would seem to be an oppotunity.
> 
> 
>>How do you intend to send a message from your script
>>to MythGallery?  As I recall, scripts just run
>>from a system() call.
> 
> 
> That was the plan, given I'm scripting in perl it should be possible to
> send messages back using some form of IPC.
> 
> Any thoughts / suggestions would be welcome.
> Cheers
> Kev
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
-------------- next part --------------
#!/bin/bash

if [ ! -d "$1" ]
then
	echo "Usage: $0 dest-dir"
	exit 1
fi

cd "$1"

NUMP=`gphoto2 -L 2>/dev/null |grep -c image`
if test "$NUMP" -eq 0
then
	exit 1
fi

gphoto2 --get-all-files --quiet 2>&1 >/dev/null |perl -n -e "\$|=1;chomp;printf \"%d\\n\", 100*(\$.-1)/$NUMP;"|zenity --progress --auto-close --text "Downloading images"

exit 0


More information about the mythtv-users mailing list