6 Replies Latest reply on Mar 11, 2011 9:22 AM by philmodjunk

    store photo from camera to container field

    pv

      Title

      store photo from camera to container field

      Post

      Using fm 11 adv. on windows (xp, vista, 7) network.

      Looking thru the posts, I could find no way to take a photo from a webcam (logitech zoom), rename the file to lastname firstname fields, move to a different computer on network (folder where all member photos are stored, as there are 2 different computers that take pictures) and then store the newly named picture as a reference in a container field.

      I did download the 360 scriptmaster file (seems like a wonderful thing) and now using "move or rename file".

      So currently,  I am using the script Insert Picture (not as a  reference)(with the path set to logitechs default path &  filename),and then I move/rename it. (to my "server" photo folder)

      I was thinking about using 360's Get File As Container, but it doesn't look like it has an option to store as reference.

      I dont even know if it would matter to embed all the photos in the file.  Currently, its a 2 file system, with my data file being about 2000kb  and my application file being about 5000 kb. Each picture is about 10kb  and I will insert about 2000 of them. Therefore, my data file should go  up to about 22,000 kb?. right?

      Would that slow down things, or is that nothing?

      Thanks for any more input

        • 1. Re: store photo from camera to container field
          philmodjunk

          Not sure how the "store by reference" option affects system performance here. If you are dealing with the photos one on one, the data in the image file has to be piped from the server to the client machine either way so I don't really know how much difference it makes. Maybe another forum member has experimented with this and can post their experiences here.

          I do know that you can insert a picture into a container field and then use just a FileMaker script to both export it to a new location such as your folder on your server and you can then re-insert the picture by reference from this new location. You can't create new folders if that's an issue, but the rest doesn't require a plug in to do.

          • 2. Re: store photo from camera to container field
            pv

            Phil,

            Its like hitting the jackpot when you answer (there are alot of jackpot winners out there) (now if I can get Mr. Vodka and Super Ninja to reply, it would be a tri-fecta)

            So I would click my webcam button to take a picture, then insert picture (not as ref.), then export field contents (to my networked drive), then insert picture again (as ref.)

            The only problem is I want to rename the picture to the fields lastname & firstname & ".jpg" and I don't see how to do that. When I specify output file, it wants the name of a current file,

            not firstname & lastname.jpg and then again the same problem with inserting that renamed picture.

            Any more thoughts

            Thanks

            Frank

            • 3. Re: store photo from camera to container field
              philmodjunk

              Export Field Contents permits you to name the file and specify the location. This doesn't move the file from its current position, but rather copies it to the new one.

              You can use set Variable to compute filepath and name and then use the variable to specify the location and file name to which you want to export the image.

              • 4. Re: store photo from camera to container field
                pv

                I didn't know you could put a variable name in place of a real filename in the file path, very nice, the export field contents & insert picture work great.

                1 problem left, if I can't move or delete the original picture file (w/o using a delete file plugin), then the next time I take a picture it will be called picture 3, then picture 4 and so on,

                so my 1st insert picture wont be able to find the picture I just took. I will also be taking pictures from 2 different computers, so some sort of counter wouldn't work unless I could tell which computer I am currently taking the picture from (or I could save the pictures taken from any computer to the same shared network folder, but I don't think you can make a counter to keep track of what photo you are currently on for different users on differnet computers to see) (or, another thought just hit me, let the picture filenames keep progressing (picture 2, picture 3...), then in my script, make a loop trying to open picture 2, then picture 3 and so on, when it returns an error, then I know to reopen the previous picture and wa-laa, problem solved??) Or is there another way?

                my script so far: (after taking the picture)

                set variable ($name;value:contacts::lastname & contacts::namefirst $ ".jpg")

                go to field (contacts::pic1)

                insert picture ("Picture 2.jpg)

                export field contents (contact:pic1;$name)

                insert picture(Reference;$name)

                • 5. Re: store photo from camera to container field
                  pv

                  That last thought worked, but instead of using the Open File command, I used the Insert Picture command.

                  but of course, 1 problem left (but its with logitech), just when I thought each filename would be 1 higher, sometimes it seems to jump (so now I have a gap between numbers), I think depending on if I switch users.

                  • 6. Re: store photo from camera to container field
                    philmodjunk

                    Here's a possible way to use your counter to compute the file name:

                    We have a situation here where we have multiple cashiers each with their own computer and printer printing out NCR invoices with preprinted invoice numbers. Each time a cashier prints an invoice the script has to assign the correct invoice number to the invoice. I thus keep a table of printer counter records and each computer is assinged a unique user name in preferences.

                    My script then uses get ( UserName ) to figure out which counter record to increment and then which value to assign as an invoice number.

                    I think the same basic method could be used to access the next picture you take so that you don't have to use Insert Picture with a dialog to find and insert the next new picture. (You can use Insert File with a computed filepath variable instead.)