I’ve created my first Chumby Widget, a photo viewer for pictures hosted on your web server. They can be located either in a directory on a public server or a private one inside your personal network, so you can use the widget to display private images without having to publish them or upload them to a third-party image hosting service. With a little more effort, it is also possible to store the images on a USB drive plugged into your Chumby - go here first if that’s what you prefer.
Otherwise, here’s how to set it up:
1) On your web server, create a directory and place your images (jpg or png) inside. If they are larger than 320x240, the widget will scale them down automatically, but you might want to consider scaling them down manually to save space and network traffic.
2) Create a file called “images.xml” inside that directory, containing a list of the images in the following fashion:
<images>
<image filename="image1.jpg" />
<image filename="image2.jpg" />
<image filename="image3.jpg" />
</images>
If you only have images in JPEG format, running this simple shell script inside the directory will create the XML file for you:
#!/bin/sh
echo "<images>" > images.xml
for files in *.jpg
do
echo " <image filename=\"$files\" />" >> images.xml
done
echo "</images>" >> images.xml
3) Place a file called “crossdomain.xml” inside the root of your web server with the following content:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*.chumby.com" />
</cross-domain-policy>
This will allow the flash code of the widget to access data on your web server (more information on this can be found here). Apparently, this is also required on a local server.
4) Install the widget as usual via the Chumby Network.
5) Use the configuration widget to set the delay (i.e. the duration in milliseconds you want each image to stay on screen) and the URL to the directory you created in step one, without the trailing slash (for example, “http://www.example.com/chumby/images”). If you don’t want to have the current file name displayed, simply type “no” into the third text field.
6) If you like, you can download the source code here; the script and example crossdomain.xml mentioned above are included as well; the license is GPL (version 2 or later).
Troubleshooting:
If PhotoFrame doesn’t display any images, point a web browser to one of them; if you get an error, check the URL and the files’ permission settings. If it’s being displayed correctly, check your images.xml for syntax and make sure that the crossdomain.xml is valid and sitting at the root directory of your web server.
For testing, you can point the widget to the following URL:
“http://www.discarded-ideas.org/files/photoframe-test”
Enjoy!
Comments
Update
Thanks for all your comments so far; I’m really glad that my widget is useful to you!
I’ve made a small update that a few of you requested: The file name display bar at the top can now be turned off. Simply type “no” in the text field labeled “Display file names” in the configuration widget.
The update should be available as soon as it has been reviewed by Chumby Industries. More requested changes will follow.
Just a few tips and
Just a few tips and comments 1) Remember to name your log files otherwise lighty won’t start LOL!
2) Tried it using 7MP jpg’s, and the screen was just blank just changing the filenames it tried to display (about 3MB+ for each file). Reduced them to the appropiate pixel size and everything was fine.
3) Would be nice to choose the kind of randomness!
4) Can it play music in the background? Don’t know if the chumby natively supports it or if there has to be some kinda streaming in the flash app
Thank you for the app!
Load In Background & Remove Title Bar
Hey,
1) Would it be possible to have it pre-load files in the background while the previous image is being displayed? That way the next image is usually available immediately.
2) Could an option be added so you can hide the semi-transparent title bar that is displayed over the top of the images?
Helper application
I have created a helper application for this wonderful little widget. It runs under Windows (2000/XP/Vista) what it does is copy your entire photo collection and resize it for optimal loading on the chumby it also generates the images.xml file you can download it through my blog: The Rothman Report. Enjoy
Problems
I have tried both: rserver.rothman.dnsalias.com/chumby and http://rserver.rothman.dnsalias.com/chumby with no success on either. I can load the xml in a web browser http://rserver.rothman.dnsalias.com/chumby/images.xml no problem but still no picures (I can show them individually as well. Any thoughts?
Problems
This is often a problem caused by Flash access restrictions; check your crossdomain.xml for correctness and make sure it’s in the root directory of your web browser. I’ve added a troubleshooting section to the article including an example URL for testing. Try pointing the widget on your Chumby to that - if you can see a bunch of demo images, it’s most likely a server-side issue.
How many photos can your widget cope with
Seems to work fine if I keep the number of photos to a maximum of 100 or so but not beyond that. If you would like try pointing a chumby at http://rserver.rothman.dnsalias.com/chumby
How many photos can your widget cope with
I’ve tested it with ~50 pictures on an external web server, ~200 pictures on a server inside my local network and ~850 pictures on a USB drive and I haven’t had any problems with either configuration. The images were mostly scaled down to 320x240 pixels and between 50-100KB in size.
I’m currently testing it with your pictures, no problems so far.
By the way, having the images spread across different subdirectories should work fine if this is properly reflected in the images.xml file. I haven’t tried it, though.
Seems to be a slow down in the chumby at around the 5000 mark
So I left the chumby alone with the xml file for about 10 minutes and it loaded 4750 images. Trying now with 6600 (the number I have). The subdirectory thing works fine. My comment re subdirectories was with regards to the sample script you gave for generating the the images.xml file. Hence my little Windows App. Thanks for your assistance. I am trying to understand the inner workings of the chumby and flash and messing with this has been a real help.
Not Working
Hi there,
I love the idea here but just can’t get it working (just get the default photo).
I’ve got the 2 XML files (and can see them from remote PC’s) so there isn’t a permissions issue but nothing appears.
Text is as per your instructions (can post here apparantly).
it just sits on Loading http:///chumby/images.xml which is correct.
Any help greatly appreciated.
Richard