14 Replies Latest reply on Feb 14, 2014 8:01 AM by jbante

    Small container fields render black bar that is not part of image data

    jbante

      Summary

      Small container fields render black bar that is not part of image data

      Product

      FileMaker Pro

      Version

      13

      Operating system version

      Mac OS X 10.9.1

      Description of the issue

      Some images are rendered with a thin black bar at the bottom of the image when they are rendered in a small container field. When the exact same container field is enlarged, the black bar disappears. This does not happen for all images. The same phenomenon occurs in FileMaker Go. I uploaded a sample file with images that behave this way here: https://www.dropbox.com/s/kxo7fqjm05dvcrl/Container%20Bug%20Demo.fmp12.zip

      Steps to reproduce the problem

      Place an image in a small container field.

      Expected result

      The image should be rendered faithfully.

      Actual result

      A thin black bar is displayed at the bottom of the image.

      Exact text of any error message(s) that appear

      None.

      Workaround

      Making the container field object larger will often make FileMaker re-draw the image without the thin black bar, but the same resizing will not fix the issue for all images.

      Container_Bug_Screenshot.png

        • 1. Re: Small container fields render black bar that is not part of image data
          philmodjunk

               What options have been selected on the Inspector's data tab for this field?

               Might "Maintain proportions" be specified for this field?

          • 2. Re: Small container fields render black bar that is not part of image data
            jbante

                 The format is "Reduce image to fit", the "Maintain original proportions" option is selected, the image is aligned center both vertically and horizontally, and the container is optimized for images. All 4 position anchors are on in the bug demo file, but the issue appears to be independent of the anchor settings.

            • 3. Re: Small container fields render black bar that is not part of image data
              TSGal

                   Jeremy Bante:

                   Thank you for your post.

                   Under Windows 7, a black line, although not as thick, appears at all times for each image.  Under Mac OS X 10.9.1, the black line disappears when the size is increased.  This occurs in both FileMaker Pro 12 and FileMaker Pro 13.

                   I have forwarded your post along with my findings to our Development and Testing departments for review.  When I receive any feedback, I will let you know.

                   TSGal
                   FileMaker, Inc.

              • 4. Re: Small container fields render black bar that is not part of image data
                TSGal

                     Jeremy Bante:

                     Our Testing department sees that the link is already in the image.  If you export the field contents, the thumbnail of the resulting file shows the black line.  Our Testing department would like to see the original image, and also know where it came from.  Send the file to the same address posted in the private message.

                     TSGal
                     FileMaker, Inc.

                • 5. Re: Small container fields render black bar that is not part of image data
                  jbante

                       The image in the container field is the original image. A FileMaker script created a base 64 string that was set to the container field using the Base64Decode function. I no longer have the original base 64 for any of these images, but I could try to generate more if the testing department thinks that would be useful.

                  • 6. Re: Small container fields render black bar that is not part of image data
                    TSGal

                         Jeremy Bante:

                         I"ve sent your comments back to the tester.  If the tester still wants a file (or files), I will let you know.

                         TSGal
                         FileMaker, Inc.

                    • 7. Re: Small container fields render black bar that is not part of image data
                      jbante

                           I managed to recreate a handful of additional images showing this behavior, but I saved the source base 64 encoding used to generate the images this time. https://www.dropbox.com/s/ly39j9emdrwp289/Container%20Bug%20Demo%202.zip

                           I also attempted a tweak to some of the scripts generating the base 64 that results in images that are identical, except that FileMaker (and Preview) do not display the thin black line. I included these images in the file I'm linking to in this post.

                           Both sets of images are compressed, using one scan line of literal image bytes, followed by LZ77 length-distance pairs to fill-out the rest of the image as possible. In the images that FileMaker renders with a thin black line at smaller sizes, the script generating them may include one or two more literal image bytes at the end if there are not enough image bytes left over (≥3) to represent with another LZ77 length-distance pair. In the images that FileMaker renders without the thin black bar, the script generating them will reduce the length of the second-to-last LZ77 length-distance pair so that there will never be fewer than 3 image bytes left over to be represented and there never need to be any literal image bytes at the end.

                           Despite FileMaker's rendering behavior, I don't have reason to believe the first method creates invalid PNGs. Indeed, Preview renders them fine, and FileMaker also renders them fine at larger sizes. But I hope the different rendering behavior from using different methods might help find the issue.

                           Based on my workaround, I suspected that problems might be happening in images where the last 2 image bytes were in fact represented as literal image bytes, i.e., where the following calculation returns 1 or 2:

                                Let ( [
                                _width = GetContainerAttribute ( Get ( ActiveFieldContents ) ; "width" ) ;
                                _height = GetContainerAttribute ( Get ( ActiveFieldContents ) ; "height" )
                                ] ;
                                Mod ( ( _width + 1 ) * ( _height - 1 ) ; 257 )
                                )
                                 
                                (1 is added to the image width to include the PNG pre-compression filter flags byte at the beginning of each scan line. 1 is subtracted from the image height because the first scan line is always represented with literal image bytes rather than LZ77 length-distance pairs. The Mod is 257 because that is the maximum length used in the LZ77 length-distance pairs by the scripts generating these images.)
                            
                           None of the sample images I have that FileMaker renders with the thin black line return 1 or 2 for this calculation.
                      • 8. Re: Small container fields render black bar that is not part of image data
                        TSGal

                             Jeremy Bante:

                             I downloaded your file.  Thank you.

                             After opening the file, I click the "Bug Image" tab.  I then select the field, pull down the Edit menu and select "Export Field Contents...".  I do this for all five records, and the resulting thumbnail in the Finder shows the black line at the base for all five records.  See the screenshot below.

                             TSGal
                             FileMaker, Inc.

                        • 9. Re: Small container fields render black bar that is not part of image data
                          jbante

                               I tried the same thing, and I got the same behavior. And then I opened each image in Preview, and there was no black line across the bottom of the image in Preview.

                          • 10. Re: Small container fields render black bar that is not part of image data
                            philmodjunk

                                 An entry in the Known Bugs List has been linked to this Issue Report. Any Comments/Questions/Suggested Corrections should be posted here or in a new thread. Please do not post such comments to the Known Bugs List thread.

                            • 11. Re: Small container fields render black bar that is not part of image data
                              TSGal

                                   Jeremy Bante:

                                   I can confirm that the black line doesn't appear in Preview, but the thumbnail shows it exists.  I have sent the new file to Testing for review.

                                   TSGal
                                   FileMaker, Inc.

                              • 12. Re: Small container fields render black bar that is not part of image data
                                jbante

                                     The thumbnail shows that small container field objects in FileMaker and whatever engine renders the thumbnails react the same way to the same image. The behavior of Preview and larger FileMaker container field objects rendering the same image calls the source of the line into question. Whether it be the images themselves or the rendering engines' interpretations of them at different sizes cannot be determined from these observations alone.

                                • 13. Re: Small container fields render black bar that is not part of image data
                                  TSGal

                                       Jeremy Bante:

                                       When I opened some of the images in Preview and resized the window, it either freezes or crashes Preview.  Also, opening in Preview and resizing (Tools -> Adjust size) will also freeze or crash Preview.  The tester has also confirmed this issue, and a developer says the images are invalid.

                                       In Terminal, entering the command:

                                       sips -Z 100 <filename>

                                       ... generates a similar thumbnail with black line and warns that the image has problems.  "sips[11157] <Error> ImageIO: PNG incorrect data check”

                                       Like the way the thumbnail appears in the Finder,  FileMaker Pro will also render the thumbnail in a Container field when it is set for half-width or height of the original image.

                                       TSGal
                                       FileMaker, Inc.

                                  • 14. Re: Small container fields render black bar that is not part of image data
                                    jbante

                                         Now that sounds more conclusive. Thanks!