Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
Container.ReadImage
Reads and convert image.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| Container | 8.4 | Yes | No | No | Yes, macOS only | No |
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| Container | The container field or value to inspect. | MyTable::MyContainerField | |
| ImageType | The type of image to return. Either JPEG, PNG, GIF or BMP. Default is JPEG. |
"JPEG" | Optional |
| FileName | The filename to use for the picture. Default is "image" with the extension matching the image type. |
"test.jpg" | Optional |
Result
Returns image container or error.
Description
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.
Examples
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
Convert a PSD or HEIF image to PNG:
Set Field [ Contacts::Output ; MBS( "Container.ReadImage"; Contacts::Input; "PNG"; "test.png" ) ]
See also
Blog Entries
- MBS FileMaker Plugin, version 10.5pr7
- Read HEIC or HEIF image files in FileMaker
- MBS FileMaker Plugin, version 8.4pr1
Release notes
- Version 10.5
- Fixed memory leaks in BinaryFile.WriteContainer, Container.ReadImage, Vision.ClassifyImage, Vision.DetectBarcode and Vision.RecognizeText functions.
- Version 8.4
- Added Container.ReadImage function.
Created 29th July 2018, last changed 29th September 2020
Container.ReadFile - Container.Remove
Feedback: Report problem or ask question.
Links
MBS FileMaker tutorial videos