A few months ago I discovered a simple technique that significantly reduced the size of a database that included many container field images.

I used a couple of FileMaker script steps to copy the container field to the clipboard and then paste the clipboard directly back into the field. I looped through the records to perform this operation for all records.

Go to Record/Request/Page [First]
Loop
If [Length(CONTACTS::Photo)>0]
  Copy [Select; CONTACTS::Photo]
  Paste [Select; CONTACTS::Photo]
End If
Go to Record/Request/Page [Next; Exit after last]
End Loop

The resulting stored information as reported by the Length() function of each FileMaker container field was up to 10 times smaller! I performed my tests on Mac OS 10.6.4 with FileMaker 11. I had one database that went from 1.2 GB to around 400 MB after performing this operation on many records. This is significant…especially for speed when accessing these fields over the WAN. It also makes the file much easier to backup.
There seems to be no down side to this method. It is possible that many of these container fields were populated in previous versions of FileMaker which may have stored information in the container in a different manner. My theory is that there may have been additional preview images stored or cross platform versions in PICT/WMF and that the clipboard operation removes them and only leaves the native JPG which displays fine across Windows or Mac.
Notes:

  • This technique most likely will not work with other types of data like sounds or PDF files that are stored in container fields and I did not do any testing of those data types.
  • Sometimes this technique can actually increase the size of the stored image. I’m not sure under what circumstances this occurs. It’s important to test and use the Length(Image) function to see how big the actual stored image is.

At this point, what I know is that it worked for me and this particular database. Your mileage may vary…but if it helps, it will significantly improve the performance of your database.
If anyone understands what is going on here underneath the hood I’d love to know more and see if there would be any disadvantages to using this technique.

2024 tim headshot 5 no smile grey

Tim Cimbura – CEO, CFO and Software Engineer

Tim is an expert in creating custom business solutions that make businesses more effective, productive, and profitable. He specializes in rapid application development with the Claris platform including FileMaker, Laravel, and WordPress. He also knows Apple macOS technology inside and out.