1 (edited by NigelS 2010-08-02 15:18:51)

Topic: USB Photo Widget script installation

This post is to provide the installation of the supporting script for the USB Photo Widget.

Simplified install as follows.

1. Download this zip file from photosinstall.zip

2. Unpack it on to root of a USB stick

3. Put the USB stick in you Chumby

4. Reboot the Chumby and wait for it to show the control panel

5. When finished you can remove files from your USB stick

That's it - install the widget, put some imahes on a USB and off you go.

A few comments

1. Widget load time depends on number of files on the USB stick.

2. One of the configuration parameters is a file filter using grep. For those that understand regular expressions here is the Chumby grep help.

If you don't understand regular expressions just leave the filter blank.

Usage: grep [-HhrilLnqvsoeFEABC] PATTERN [FILEs...]

Search for PATTERN in each FILE or standard input

Options:

        -i      Ignore case distinctions
        -l      List names of files that match
        -L      List names of files that do not match
        -v      Select non-matching lines
        -e      PATTERN is a regular expression
        -F      PATTERN is a set of newline-separated strings
        -E      PATTERN is an extended regular expression

The full image file name syntax is  ./usb/<USB ROOT>

Hope you enjoy and would appreciate any comments (good or bad).

cheers

Nigel

smile smile smile

Re: USB Photo Widget script installation

Can you edit your post to have [ code ] and [ /code ] tags around the code... that will make it easier to copy and paste. (I added spaces around the brackets so they'd show up in this message.)

3 (edited by NigelS 2010-01-14 12:35:09)

Re: USB Photo Widget script installation

unwiredben wrote:

Can you edit your post to have [ code ] and [ /code ] tags around the code... that will make it easier to copy and paste. (I added spaces around the brackets so they'd show up in this message.)

Unwiredben,
     thanks - I have put them in.

cheers

Nigel

smile  smile  smile

Re: USB Photo Widget script installation

I was answering in the thread about USB playback of FLV files - http://forum.chumby.com/viewtopic.php?pid=26441#p26441 - and wondered if the widget could be expanded to also request .flv files with the appropriate MIME type, since it looks like the script here could already serve them.

Re: USB Photo Widget script installation

Nice work NigelS.  You should remove the statement that BMP images are supported since they are not supported by FlashLite and actually cause your widget to stumble a bit if found on the usb.

The photo interval control will be a nice addition.  Another control setting to perhaps consider is to not stretch images (only shrink if necessary to fit 320x240).

Re: USB Photo Widget script installation

unwiredben wrote:

I was answering in the thread about USB playback of FLV files - http://forum.chumby.com/viewtopic.php?pid=26441#p26441 - and wondered if the widget could be expanded to also request .flv files with the appropriate MIME type, since it looks like the script here could already serve them.

Hi unwiredben,
   I saw the post too and wondered the same. Its basically a one line change to add in the new type so will see what I can do. Only issue I can see is the current hard coded timing - wil flv finish in time. Will send a post to the thread and advise.

cheers

Nigel

smile  smile  smile

Re: USB Photo Widget script installation

djchumby wrote:

Nice work NigelS.  You should remove the statement that BMP images are supported since they are not supported by FlashLite and actually cause your widget to stumble a bit if found on the usb.

The photo interval control will be a nice addition.  Another control setting to perhaps consider is to not stretch images (only shrink if necessary to fit 320x240).

djchumby,
   thanks for the feedback - didn't know about BMP just tested it and it seemed to work - will put in a disclaimer.

On the not stretching front I struggled with this for a while (shallow AS knowledge) and in the end just set the movie wdth to 320 and height to 240 and mostly it seems to work.

I am not quite sure how tp do te logic - do I have to find the ratios of original width to 320 and height to 240, see which is the most limiting and then scale both equally e.g. 315, 240 or 320 210 etc. I have an loadinit type event so could do this. Any advise most welcome.

cheers

Nigel

smile smile smile

Re: USB Photo Widget script installation

I've used the following logic for scaling/stretching.  The boolean var _configEmbiggen would correlate to the user's setting for "stretch image to fill screen, but still preserve height/width ratio"

            var mcWidth:Number = mc._width;
            var mcHeight:Number = mc._height;
            trace("original width: " + mcWidth);
            trace("original height: " + mcHeight);
            var widthRatio:Number =  mcWidth / _maxWidth;
            var heightRatio:Number = mcHeight / _maxHeight;
            trace("widthRatio: " + widthRatio);
            trace("heightRatio: " + heightRatio);
        
            var scale:Number = Math.max( widthRatio, heightRatio );
            trace("scale: " + scale);
            // if scale > 1, then image is too large and we MUST scale (shrink) the img
            // if scale < 1, then image is too small and we defer to _configEmbiggen setting
            if ( scale > 1 ) {
                trace("downscaling to fit on screen");
                mc._width = mcWidth / scale;
                mc._height = mcHeight / scale;
            }
            else if ( (scale < 1) && _configEmbiggen ) {
                // accept a scale < 1
                trace("upscaling to fill the screen");
                mc._width = mcWidth / scale;
                mc._height = mcHeight / scale;
            }
            else {
                // scale == 1; keep original img dimensions
                // dont allow upscaling; keep original img dimensions
                trace("preserving original img dimensions");
            }
            
            // positioning
            mc._x = ( _maxWidth - mc._width ) / 2;
            mc._y = ( _maxHeight - mc._height) / 2;

9 (edited by spunk_ 2010-01-19 09:40:57)

Re: USB Photo Widget script installation

NigelS wrote:

2. Make the script executable (in WinScp change properties for the file)



seems to be silly question: but which properties?
how do they have to be?



yeah -  i startet now first time Winscp and it works.
just one error

Command "groups" failed with return codes 127 and error message
-ash: groups: not found

what does this mean and how can i change this?

Re: USB Photo Widget script installation

spunk_ wrote:
NigelS wrote:

2. Make the script executable (in WinScp change properties for the file)



seems to be silly question: but which properties?
how do they have to be?



yeah -  i startet now first time Winscp and it works.
just one error

Command "groups" failed with return codes 127 and error message
-ash: groups: not found

what does this mean and how can i change this?

Hi Spunk_ (why do i feel strange saying that ?),
   re your questions. In WinScp right click on the photos.pl file on the chumby and select proprties. You should see tick box options for "executable" for various user types - tick them all.

Don't worry about the error message - i get it all the time - just reflects no groups being setup on Chumby.

Enjoy

Cheers

Nigel

smile smile smile

Re: USB Photo Widget script installation

djchumby wrote:

I've used the following logic for scaling/stretching.  The boolean var _configEmbiggen would correlate to the user's setting for "stretch image to fill screen, but still preserve height/width ratio"

            var mcWidth:Number = mc._width;
            var mcHeight:Number = mc._height;
            trace("original width: " + mcWidth);
            trace("original height: " + mcHeight);
            var widthRatio:Number =  mcWidth / _maxWidth;
            var heightRatio:Number = mcHeight / _maxHeight;
            trace("widthRatio: " + widthRatio);
            trace("heightRatio: " + heightRatio);
        
            var scale:Number = Math.max( widthRatio, heightRatio );
            trace("scale: " + scale);
            // if scale > 1, then image is too large and we MUST scale (shrink) the img
            // if scale < 1, then image is too small and we defer to _configEmbiggen setting
            if ( scale > 1 ) {
                trace("downscaling to fit on screen");
                mc._width = mcWidth / scale;
                mc._height = mcHeight / scale;
            }
            else if ( (scale < 1) && _configEmbiggen ) {
                // accept a scale < 1
                trace("upscaling to fill the screen");
                mc._width = mcWidth / scale;
                mc._height = mcHeight / scale;
            }
            else {
                // scale == 1; keep original img dimensions
                // dont allow upscaling; keep original img dimensions
                trace("preserving original img dimensions");
            }
            
            // positioning
            mc._x = ( _maxWidth - mc._width ) / 2;
            mc._y = ( _maxHeight - mc._height) / 2;

djchumby,
     thanks for the code - the logic is fine but I do still have a problem that I cant find an answer for - was hoping I could prevail on your expertise to see if there is some trick I am missing.

my question then

In my photo widget I have 2 movies - one is being displayed while the other loads and every 15 seocnds or so they switch - pretty simple stuff. Each move has an event handler for loadinit, which is where I do the image rescaling and centring (your code above). The problem I have is that the movie width and height are often incoorect in the loadinit routine. Mostly they are okay but sometimes they are just weird. My understanding was that the loadinit event triggered when enough of the movie was loaded to understand the images size etc. Is there something i am missing here (trick of the trade etc).

cheers

Nigel

smile smile smile

Re: USB Photo Widget script installation

NigelS wrote:

Enjoy

i tried. but its not very easy to use. i hope in future you will face it to make it automatically installed.


till then i will use the facebook photo viewer
(upload all photos to a private place there and link the chumby.
1 minute and it works.

Re: USB Photo Widget script installation

hmm maybe try a line like this right before all of the scaling code?

mc._xscale = mc._yscale = 100;

Re: USB Photo Widget script installation

spunk_ wrote:
NigelS wrote:

Enjoy

i tried. but its not very easy to use. i hope in future you will face it to make it automatically installed.


till then i will use the facebook photo viewer
(upload all photos to a private place there and link the chumby.
1 minute and it works.

Hi spunky_
   I can see your point but I have a different perspective.

  I can install the script in about 2 minutes
  It takes days if not weeks too load all phiotos on facebook and uses vey large amounts of bandwidth
  I dont trust my photos being on line - e.g. recentl facebook changes that makde lots of content public

In terms of automated install - thats not possible due to the way Chumby works - widgets can't access hardware.

Hope facebook works for you though.

cheers

Nigel


smile smile smile

Re: USB Photo Widget script installation

Hi all, I'm totally new to Chumby and one of mi interest is using it as a Photo Frame.

After looking for the available widgets I agree with NigelS in that I don´t like my photos to be online so I've decided to use USB Photo.

The problem is that after following the instructions the widget only shows the text saying that it needs a script.

I'm Unix skilled, so I haven't had any trouble uploading the script to the Cumby via scp and setting the permissions.

It even seems to be working cos the photos.tmp file is created and contains the photos list but nothing more than the text shows in the Chumby screen.

The Chumby is a Chumby One and the files are all jpg.

Do I need to scale them?

Has any one had this situation? What else can I try?

Any help would greatly appreciated.

Thanks all in advance.

Re: USB Photo Widget script installation

Can't really help you with the USB Photo, but why are you against uploading them to the internet?  PicasaWeb, for example, has a setting that makes the photo album completely private, so nobody can see them but whoever you invite.

Re: USB Photo Widget script installation

Obnates wrote:

Can't really help you with the USB Photo, but why are you against uploading them to the internet?  PicasaWeb, for example, has a setting that makes the photo album completely private, so nobody can see them but whoever you invite.

Hi Obnates, the photos are mostly of my little daugther and I don't simply want them to be online.

Have you ever read the full license agreement of any of those services? O even worst, do you really think they are bullet proof?

Some of them pretend to grant rights on your photos after you close your account and even VISA numbers have been stolen from online banks :-)

For my own use, with my children photos and in my house I don't need an online photo service, I prefer a "local" service. Thats all.

Thanks anyway for your answer.

Re: USB Photo Widget script installation

Fair enough -- and it's certainly true, for your own use and your own photos, there's really no need to upload pics.  It really should be easier to play photos on the Chumby, but hopefully that's down the road.

(For what it's worth, no, I don't believe they're bulletproof and I have read the EULA, but I guess I'm the type of person who listens too much to probabilities -- what are the chances that, of the billions of photos online, that someone is going to either stumble onto or intentionally select to use one of mine?  Given that I only have ~100 photos online at any one point in time, it just seems highly unlikely.  But you do have a fair point and I hope you get the USB photo thing working.)

Re: USB Photo Widget script installation

francisperea wrote:

Hi all, I'm totally new to Chumby and one of mi interest is using it as a Photo Frame.

After looking for the available widgets I agree with NigelS in that I don´t like my photos to be online so I've decided to use USB Photo.

The problem is that after following the instructions the widget only shows the text saying that it needs a script.

I'm Unix skilled, so I haven't had any trouble uploading the script to the Cumby via scp and setting the permissions.

It even seems to be working cos the photos.tmp file is created and contains the photos list but nothing more than the text shows in the Chumby screen.

The Chumby is a Chumby One and the files are all jpg.

Do I need to scale them?

Has any one had this situation? What else can I try?

Any help would greatly appreciated.

Thanks all in advance.

Hi francisperea,
  will be happy to help but at moment on holidays - will be back next week. In the meantime i would suggest keeping the number of files (not just images all files) on the usb low (speed has an impact).

Will get back to you next week.

cheers

Nigel

smile smile smile

Re: USB Photo Widget script installation

NigelS wrote:

Hi francisperea,
  will be happy to help but at moment on holidays - will be back next week. In the meantime i would suggest keeping the number of files (not just images all files) on the usb low (speed has an impact).

Will get back to you next week.

cheers

Nigel

smile smile smile

Hi again NigelS and thanks for your reply.

Just to let you know that finally I found my error. I didn't copy all the code and reviewing the script I found that I lost the last brace :-(

It was my mistake, but perhaps you could upload the file for some other not having to copy and paste ;-)

Thank again for your work.

PD Have a nice holidays!

Re: USB Photo Widget script installation

Obnates wrote:

PicasaWeb, for example, has a setting that makes the photo album completely private, so nobody can see them but whoever you invite.

But I think you have to make the album public in order to access it with the Chumby Picasa Viewer widget.
Please correct me if I'm wrong, because I'd use the widget a lot more if the albums didn't have to be public. I don't mind photos of my pets being in public albums, but I'm not so keen on family photos being out there.

Re: USB Photo Widget script installation

steelpaw wrote:

But I think you have to make the album public in order to access it with the Chumby Picasa Viewer widget.
Please correct me if I'm wrong, because I'd use the widget a lot more if the albums didn't have to be public. I don't mind photos of my pets being in public albums, but I'm not so keen on family photos being out there.

Well, Picasa has 3 levels of security:  Public, Unlisted, and Sign-In.

Public allows anyone browsing through Picasa to find your photos.
Unlisted requires someone to know the link to the album in order to view the photos.
Sign-In is the most secure, allowing only the people you invite to see the pictures.

The Chumby Picasa Viewer will work with either the Public or Unlisted settings.  I use the Unlisted setting and just don't tell anyone what the album link is, thus (in theory) nobody should be able to find my album.  The link then gets uploaded to the Chumby widget.

I realize there's always the possibility of being hacked (either through Chumby or Picasa), but the probability of that is fairly low, so I'm happy with the amount of security present.  For me it doesn't really matter anyway, because I use it for photos of landscapes/nature from the places I've been (travel a lot).

23 (edited by spunk_ 2010-01-22 14:30:13)

Re: USB Photo Widget script installation

steelpaw wrote:

But I think you have to make the album public in order to access it with the Chumby Picasa Viewer widget.
Please correct me if I'm wrong,

it works for private album also.

BUT:
you have to change the domain... the album domain-link always is like

http://picasaweb.google.de/NAME/album?a … 12345dfgsd

it has to be changed manually in

http://picasaweb.google.com/NAME/album? … 12345dfgsd

Re: USB Photo Widget script installation

Looking at the Picasa API, it looks like it would be possible for the widget to do additional authentication to get to private photo collections.  However right now, it's just using RSS feeds from the site to get pictures.

I'm going to be releasing a drop.io viewer widget soon that does nice things with pictures and supports a true privacy mode -- you can setup a drop so it can't be viewed at all without a guest or admin password, and the widget supports using a password to get to hidden content.

Re: USB Photo Widget script installation

Hello,
I am new to both flash and script, but I am quite interested this USB Photo Widget.
Would you please explain the function of this script, and how the flash calls this script,if it does.
Thank you so much