5 Replies Latest reply on Apr 2, 2013 8:14 AM by philmodjunk

    Container field and Get thumbnail function

    rtolliver

      Title

      Container field and Get thumbnail function

      Post

           I am currently evaluating FileMaker Pro 12 Advanced in an effort to move my MS Access database back to FileMaker Pro.  One of the new features in FM that I'm looking at is the Container field and using the Get Thumbnail function.  My current database has Text fields that are used to hold the path name for images on an external drive.  The path name fields are on a Form that displays two images per record.

           With the eval copy of FM, I'm trying to create two forms, the first will be a continuous list form with a thumbnail of image1 and the second form is single record information that has image1 & image2.

           I was able to create my tables and one form be running into a problem with the use of the GetThumbnail function.  I'm using the example provided in the Reference -> Function reference > Container functions > GetThumbnail.  I've tried both of the Examples and they both failed.  After placing an image into the container field,  the first example  calculation field returns a "0" and the second calculation field returns nothing.

           Can anyone explain the correct use?

            

           Thanks

        • 1. Re: Container field and Get thumbnail function
          philmodjunk

               If you use Import Records | Folder, you can import all the images in a folder into a table with a container field in it in your database. You can add a second container field for the thumbnail and it can be impoarted in the same import.

               How are you using this function?

               If you used it in a set field script step, it might be used like this:

               Set Field [YourTable::ThumbNailContainer ; GetThumbNail ( YourTable::containerField ; //put width in pixels here ; //put height in pixels here ) ]

               The script step would put a thumbnail of the image in YourTable::ContainerField into YourTable::ThumbNailcontainer.

               Both of these fields need to be of type container.

               While I haven't tried it, I would assume that a calculation field with "container" selected as the result type could use:

               GetThumbNail ( YourTable::containerField ; //put width in pixels here ; //put height in pixels here )

               to produce a thumbnail result in this calculation field.

          • 2. Re: Container field and Get thumbnail function
            rtolliver

                 The test database that I've setup has 3 fields, Picture (Container field), Thumbnail1 (Calculation filed), Thumbnail2 (Calculation filed).

            Picture, has an image that I dropped in,

            Thumbnail1, Specify Calculation: GetThumbnail ( Picture ; GetLayoutObjectAttribute ( Picture ; "rectangle"; "width" ); GetLayoutObjectAttribute ( Picture ; "rectangle"; "height" ))

            Thumbnail2Specify Calculation: GetThumbnail ( Pictures::Picture ; GetWidth(Picture)/2 ;GetHeight(Picture)/2)

            • 3. Re: Container field and Get thumbnail function
              philmodjunk

                   You appear to be copy/pasting from help.

                   Get LayoutObjectAttribute only works with objects that have an assigned object name. Did you use the insepector to given the object an object name? This is done by selecting the layout object while in layout mode and typing an object name into the "name" box found on the Inspector's position tab.

                   For Thumbnail1 and Thumbnail2, what result type did you select in the Specify Calculation Dialog?

              • 4. Re: Container field and Get thumbnail function
                rtolliver

                     Took your sugestion, the result type for Thumbnail1 and Thumbnail2 were changed to Container also verifed the object names in the Inspector.

                      

                     Thumbnail2 now has an image but,

                     Thumbnail1 still doesn't

                • 5. Re: Container field and Get thumbnail function
                  philmodjunk

                       "rectangle" seems an unusual object name for a field named "picture", but assuming that this is the case and that you have posted and exact copy of the expression that you are using....

                       Go to Manage | Database | Fields and double click the field to re-open the field definition. Click the storage options button. Select the "do not store..." check box to make this an unstored calculation.