3 Replies Latest reply on Aug 15, 2014 9:39 AM by philmodjunk

    Automatic image import

    MarkMartin_1

      Title

      Automatic image import

      Post

           I would like to setup a photo portal for any photo with the beginning of the image name has the "ProductID" in the beginning of the image name, followed by -01, -02 etc ( ie Merlot-01.jpg, Merlot-02.jpg). So when the record Merlot is displayed all the photos are in the portal. I'd like to have this fairly automated, maybe click a button to update it, but not manual import. As new photos are added to the photos folder they would show up in the ProductID record. Hope this makes sense. Trying to make product catalog.

            

        • 1. Re: Automatic image import
          philmodjunk

               The problem is in getting a list of the image files in that folder to compare to the list of files of already imported image files. If you locate your photos folder inside the documents folder, FileMaker can do this via get ( DocumentPathListing ). If you locate this folder anywhere else, you'll need to use a plug in or a system script to get the list--the system script generates a test file and FileMaker imports it.

               But you may want to consider an easier method:

               Use Import Records | Folder to import all records in the folder into container fields in your database. Then use a system script or file plug in to delete all files in this folder. You then only need run a script in FileMaker to pull in all new images after dropping one or more images. With something like the EyeFi SD card that we use in some cameras here where I work or with streaming images from a smart phone, the images can be downloaded to this folder automatically. Accessing a layout or panel in a tab control on the layout can perform the script to import the images.

               And the import can populate a text field with the file name. You can then use the text in that field to link the new image records to the correct product record.

          • 2. Re: Automatic image import
            MarkMartin_1

                 Thank you Phil, if I did an import from a text file with the image names up to say 10 (I don't have a product with more than 10), then do an import records folder method I believe that would work best. All of the images are renamed consistently, so if I added the image to the folder later it should show up if I'm not mistaken.

                  

            • 3. Re: Automatic image import
              philmodjunk

                   Of course, but what I am suggesting simplifies the process by setting up a specific folder as an "inbox". You import all records from this folder and then delete the files from the folder. Your script can then use Export Field Contents to export the files to a different folder and then reinsert with "store a reference" enabled from that new location. And this last part is not necessary if you use FileMaker 12 or newer and specify external storage for the container field as FileMaker will do this part for you.

                   And the "in box" folder can be a folder local to the desktop of every computer where you need to do this.

                   We use a version of this with some EyeFi equipped digital cameras. We're required by law to take pictures of customers that sell us certain types of scrap metal. After they take the picture, the EyeFi SD card automatically uploads the image to the specified "in box" folder via WiFi. The user then clicks a file tab to see a portal listing thumbnails of the recently taken images. Clicking the file tab performs a script to import the records from the in box folder and delete them. There can be more than one camera in operation at a time, so the user looks at the images in the container field and clicks one to link it to the current Purchase Order receipt and remove it from the portal.