CGImageSource.Release
---------------------

Closes image source and releases memory.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CGImageSource](component_CGImageSource.md) | [3.4](newinversion34.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |

MBS( "CGImageSource.Release"; Ref ) 

**MBS**( **"CGImageSource.Release";** /\* Closes image source and releases memory. \*/  
**$Ref**) /\* The image source reference number returned by [CGImageSource.CreateWithData](CGImageSourceCreateWithData.md), [CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md) or [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md) \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Ref | The image source reference number returned by [CGImageSource.CreateWithData](CGImageSourceCreateWithData.md), [CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md) or [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md) | $ref |

### Result

Returns OK or error message.

### Description

Closes image source and releases memory.  
### Examples

Convert image from one container and output to other:

 Set Variable \[ $img ; Value: MBS ( "[CGImageSource.CreateWithData](CGImageSourceCreateWithData.md)"; test::input ) \]   
Set Field \[ test::output ; MBS ( "[CGImageSource.ImageAtIndex](CGImageSourceImageAtIndex.md)"; $img ; 0; "PNG") \]   
Set Variable \[ $r ; Value: MBS ( "CGImageSource.Release"; $img ) \]  
### See also

- [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md)
- [CGImageSource.FileName](CGImageSourceFileName.md)
- [CGImageSource.ImageAtIndex](CGImageSourceImageAtIndex.md)
- [CGImageSource.Keys](CGImageSourceKeys.md)
- [CGImageSource.Properties](CGImageSourceProperties.md)
- [CGImageSource.Property](CGImageSourceProperty.md)
- [CGImageSource.ReleaseAll](CGImageSourceReleaseAll.md)
- [CGImageSource.Status](CGImageSourceStatus.md)
- [CGImageSource.ThumbnailAtIndex](CGImageSourceThumbnailAtIndex.md)
- [CGImageSource.Type](CGImageSourceType.md)

### Release notes

- **Version 10.5**
    - Added [CFunction.ReleaseAll](https://www.mbsplugins.eu/CFunctionReleaseAll.shtml), [CGImageSource.ReleaseAll](https://www.mbsplugins.eu/CGImageSourceReleaseAll.shtml), [CLibrary.ReleaseAll](https://www.mbsplugins.eu/CLibraryReleaseAll.shtml), [DynaPDF.ReleaseAll](https://www.mbsplugins.eu/DynaPDFReleaseAll.shtml), [ECKey.ReleaseAll](https://www.mbsplugins.eu/ECKeyReleaseAll.shtml), [FSEvents.ReleaseAll](https://www.mbsplugins.eu/FSEventsReleaseAll.shtml), [MarkDown.ReleaseAll](https://www.mbsplugins.eu/MarkDownReleaseAll.shtml), [MenuItem.ReleaseAll](https://www.mbsplugins.eu/MenuItemReleaseAll.shtml), [SendMail.ReleaseAll](https://www.mbsplugins.eu/SendMailReleaseAll.shtml), [Shell.ReleaseAll](https://www.mbsplugins.eu/ShellReleaseAll.shtml), [SmartCard.ReleaseAll](https://www.mbsplugins.eu/SmartCardReleaseAll.shtml), [TouchBar.ReleaseAll](https://www.mbsplugins.eu/TouchBarReleaseAll.shtml), [UserNotification.ReleaseAll](https://www.mbsplugins.eu/UserNotificationReleaseAll.shtml), [WMFP.ReleaseAll](https://www.mbsplugins.eu/WMFPReleaseAll.shtml), [WMIQuery.ReleaseAll](https://www.mbsplugins.eu/WMIQueryReleaseAll.shtml) and [WindowsUserNotification.ReleaseAll](https://www.mbsplugins.eu/WindowsUserNotificationReleaseAll.shtml).

### Example Databases

- [Mac and iOS/CGImageSource](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/CGImageSource.shtml#1ScriptAnchor_)

### Blog Entries

- [Read HEIC or HEIF image files in FileMaker](https://www.mbsplugins.de/archive/2019-08-20/Read_HEIC_or_HEIF_image_files_/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 26th April 2023

  
[CGImageSource.Property](CGImageSourceProperty.md) - [CGImageSource.ReleaseAll](CGImageSourceReleaseAll.md)

[HTML Version](CGImageSourceRelease.shtml)