Converting and resizing images in FileMaker with pure Javascript instead of GetThumbnail()

FileMaker has a built-in GetThumbnail() function to resize and convert image formats for images stored in container fields.

However, there are scattered reports that this isn’t always reliable (like at https://www.reddit.com/r/filemaker/comments/1et224c/strange_container_bug/ and https://community.claris.com/en/s/question/0D53w00005ZIw34CAD/getthumbnail-on-filemaker-go-not-working-with-png-files-when-fm-file-is-hosted.

So I used a javascript demo I found (at https://dev.to/ninofiliu/lets-write-an-image-converter-in-20-lines-of-htmljs-bng)  to create a webviewer-powered function that uses pure javascript to resize and convert images in FileMaker container fields.

Not going to give a technical explanation right now, but it’s self-contained and ready for use, you can just copy what you need from it. If you look at it in layout mode you’ll see some additional instructions. Right now it automatically converts as you add pictures or change parameters, but hidden in Layout mode there’s some instructions to adapt it so you can use a script, maybe with a button if you want (both included already, just hidden from view initially) to do the conversion manually whenever you want, instead of automatically every time you add an image or change a parameter.

Here’s the download: Image Converter without GetThumbnail.fmp12


Related articles

  • Michael Kupietz
  • Certified Expert FileMaker Pro Consultant & Full-Stack Web Developer
  • Serving clients locally and remotely, in California's San Francisco Bay Area and nationwide
  • Phone: (415) 545-8743
  • Download vCard