Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples
New in version: 9.0   9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2   10.3    Statistic  


Reads and convert image.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Container 8.4 Yes No Yes, macOS only No No
MBS( "Container.ReadImage"; Container { ; ImageType; Filename } )   More


Parameter Description Example value
Container The container field or value to inspect. MyTable::MyContainerField
ImageType Optional
The type of image to return. Either JPEG, PNG, GIF or BMP. Default is JPEG.
Filename Optional
The filename to use for the picture. Default is "image" with the extension matching the image type.


Returns image container or error.


Reads and convert image.
This function is useful to read all the image formats supported by Apple's frameworks and convert them to a common format like JPEG or PNG.
Use this function to convert old PICT images in containers.
Works as well for HEIC and HEIF images.


Convert PICT to PNG:

Set Field [ Test::output ; MBS("Container.ReadImage"; Test::OldImage; "PNG"; "image.png") ]

Read file from disk and read as image:

Set Field [ Batch Emailer::Inline Graphics ; MBS("Container.ReadImage"; MBS("Container.ReadFile"; "/Users/cs/Desktop/test.heic")) ]

Read HEIC file:

Set Variable [ $path ; Value: "/Users/cs/Desktop/IMG_3552.HEIC" ]
Set Variable [ $container ; Value: MBS( "Container.ReadFile"; $path) ]
If [ MBS("IsError") = 0 ]
    Set Variable [ $image ; Value: MBS( "Container.ReadImage"; $container; "PNG"; "image.png") ]
    If [ MBS("IsError") = 0 ]
        Set Field [ Untitled::image ; $image ]
    End If
End If

See also

Blog Entries

Release notes

Created 29th July 2018, last changed 20th August 2019

Container.ReadFile   -   Container.Remove

Feedback: Report problem or ask question.

MBS FileMaker Plugins