9 Replies Latest reply on Aug 15, 2017 12:34 PM by justinc

    "GetThumbnail()" malfunctioning if 'Containers->Store thumbnails' is disabled

    justinc

      The problem is that the 'getthumbnail()' function appears to be behaving differently, and I believe it is failing to do it's job, if the 'Store Thumbnails' option is disabled in the File -> Manage -> Containers -> Thumbnails dialog.

       

      This issue was originally mentioned in a comment on another thread ( GetThumbnail Not Working? ), but never elevated to a Product Issue.  I spoke with Clay (FMI Server guru - now head of Server Dev with Jon's leaving) and he said that he felt that this was a bug.  So I'm reporting it as such.

       

      That original comment was also for an older version of FMPA.  I have also just confirmed that this issue still applies in FMPA 16.02.

      Running on OS X 10.11.6.

      This was a local file (i.e. not hosted on FMS); not sure it matters.

       

      I have attached a demo file.

       

      Message was edited by: Justin Close     Updated demo file attached; the original problem statement wasn't exactly clear, so read the responses below.  The short version is that it was the failure of the function to alter the Size of the image, not that it didn't output an image at all.  It does return the original image (un-sized) even if the 'Generate and Store Thumbnails' option is turned off.

       

      Message was edited by: Justin Close     Modified and re-uploaded the demo file.  This is v3 now.

       

      Message was edited by: Justin Close     Re-worded Title and initial description of the problem a bit.  It's not 'completely disabled', it just fails to function correctly.

        • 1. Re: GetThumbnail() not functional if 'Containers->Store thumbnails' is disabled
          TSGal

          justinc:

           

          Thank you for your post and file.

           

          Using your file, I am unable to reproduce the issue.  If I turn off the thumbnail storage, GetThumbnail continues to work.  I have turned off thumbnail storage, closed the file, quit FileMaker Pro 16.0.2, and restarted.  If I either insert, drag and drop, or copy and paste and image into the Container field, the GetThumbnail calculation correctly displays the thumbnail.

           

          Let me know what else I can do to reproduce the issue.

           

          TSGal

          FileMaker, Inc.

          • 2. Re: GetThumbnail() not functional if 'Containers->Store thumbnails' is disabled
            justinc

            I guess it's not an issue of displaying a resulting image, it's an issue of whether or not the function transforms the image.

             

            The AE calc is set to resize the image to specific maximums.  If you turn off the setting, then you still get an image, but it will be at the original size.  If you turn on the setting, then the image will correctly be resized to the specified maximum dimensions.

             

            Here are the two results that I get.  Notice the different 'size' values for the two states (highlighted in the red square).  The first screenshot is a successful transformation of the input image.  The second screenshot shows the

             

            Successful_result.pngFailed_result.png

             

            I redid my example file a little bit - the functionality isn't any different, I just added a new 'Info' field to show the size of the image that was input, repositioned things, and added some text to try and make the issue clearer.  (I'll try and edit my original post to attach the new file - if I can't, I'll attach it to a new reply.)

            • 3. Re: GetThumbnail() not functional if 'Containers->Store thumbnails' is disabled
              TSGal

              justinc:

               

              The function is working correctly.  When you don't store thumbnails, the image information is taken from the original image.  If you store thumbnails, then the reduced image is taken from the thumbnail.  The Width and Height will be different, but as you can see from your screenshots, the image displays in the available space.

               

              TSGal

              FileMaker, Inc.

              • 4. Re: GetThumbnail() not functional if 'Containers->Store thumbnails' is disabled
                justinc

                I guess I don't see the delineation.  To me, there's a difference between storing and displaying.  I'm not just interested in whether or not there is an image in the container, and how big it is on the layout - I'm attempting to alter the file itself that is being stored.

                 

                The smaller display field is a static container field (i.e. non-global, non-unstoredcalc...OK, it's not 100% static because it will change based on the input field.  It is static in that it is stored in the DB file and persists between openings.  Perhaps "non-global" is a better term.  But that's not always the term I used here - sorry for the inconsistency).  The AE calc is supposed to take an input image (pasted into the global-field on the left side), resize that image, and store the result in the static/non-global container.  According to the meta data associated with that static field, the image has not been resized.

                 

                This is an issue about storage space and WAN performance, not just about displaying an image.  I want to store images in a much reduced file size, hence converting it to smaller dimensions.  The "getthumbnail()" function is returning two different results, depending on whether or not the 'Generate and Store Thumbnails' setting is turned on or not.  If the function were working then I would expect to get the same results from using it regardless of what that setting is.

                 

                (Of course, the tool I use to measure those results, and thus determine if it's working or not, could be wrong.  I'm using another FM function to return the meta data about the container.  Perhaps it's giving me inaccurate data.)

                 

                Here are some additional screenshots.  I modified the demo file again.  The two containers on the layout are the same size.  I have turned off the 'reduce to fit' options on both of these container objects, setting it to 'crop to frame' instead.  You can see that the image in the auto-enter static field (on the right) is not the same in the two cases.

                 

                And in the meta-data results I have highlighted the file-size that FM reports back for the container.  When the function is working (i.e. the 'Generate and store...' option is ON), the resulting file size (~119Kb) is significantly smaller than the original size ( ~1.4MB).

                 

                And you can also see that in the two cases the resulting image stored in the container is a different size, visually.

                 

                Setting OFF - image not resized ("getthumbnail()" not doing what's described on the tin)

                Result1_Off.png

                 

                Setting ON - image is resized ("getthumbnail()" is doing what's described on the tin)

                Result2_on.png

                 

                 

                I will edit the original posting and upload my tweaked demo file again.

                 

                Thanks,

                Justin

                • 5. Re: GetThumbnail() not functional if 'Containers->Store thumbnails' is disabled
                  TSGal

                  justinc:

                   

                  If you want to store image files in a smaller size, then you must turn on temporary thumbnails for storage.  Then, once the thumbnail is generated, you can export the thumbnail and insert it back into the original Container field.

                   

                  If you want the original image file stored in the file and a thumbnail to display, then turn on permanent thumbnails for storage so that the thumbnail isn't generated every time the file is opened.

                   

                  TSGal

                  FileMaker, Inc.

                  • 6. Re: "GetThumbnail()" malfunctioning if 'Containers->Store thumbnails' is disabled
                    justinc

                    Yes, that's what I have said:  you have to turn on the 'Generate and Store thumbnails' option in order for the GetThumbnails() function to work correctly.  And that's the bug - that function doesn't say that it requires that option to be turned on; the option doesn't say that it affects this function; the system does not indicate that the function is disabled when the option is turned off (e.g. ghosted out in pickers or lists...but I guess it doesn't ever do this for functions, just script steps).

                     

                    The function should work regardless of the setting of this option, or it should be documented that it does not work when that option is turned off.  (I would vote for the former.)

                     

                    Why would I need to export/reimport the thumbnail?  The function works perfectly well as an auto-enter calc - when the "Generate..." Option is enabled at least.

                    • 7. Re: "GetThumbnail()" malfunctioning if 'Containers->Store thumbnails' is disabled
                      TSGal

                      justinc:

                       

                      I've sent your posts to the manager of Product Documentation so that made clearer in future documentation.

                       

                      TSGal

                      FileMaker, Inc.

                      • 8. Re: "GetThumbnail()" malfunctioning if 'Containers->Store thumbnails' is disabled
                        TSGal

                        justinc:

                         

                        Development agrees you should be able to generate a thumbnail regardless of the setting.  This has been opened as an issue and is being investigated.

                         

                        TSGal

                        FileMaker, Inc.