CGImageSource.Type
------------------

Queries the type of the image source.

| 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.Type"; Ref ) 

**MBS**( **"CGImageSource.Type";** /\* Queries the type of the image source. \*/  
**$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 type string or error message.

### Description

Queries the type of the image source.  
e.g. "public.jpeg" for a jpeg image.  
### Examples

Query type:

 MBS ( "CGImageSource.Type"; $ref )  
Load image from container and query type:

 Set Variable \[ $img ; Value: MBS ( "[CGImageSource.CreateWithData](CGImageSourceCreateWithData.md)"; test::input ) \]   
Show Custom Dialog \[ "Type" ; MBS ( "CGImageSource.Type"; $img ) \]   
Set Variable \[ $r ; Value: MBS ( "[CGImageSource.Release](CGImageSourceRelease.md)"; $img ) \]  
### See also

- [CGImageSource.Count](CGImageSourceCount.md)
- [CGImageSource.CreateWithData](CGImageSourceCreateWithData.md)
- [CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md)
- [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md)
- [CGImageSource.Export](CGImageSourceExport.md)
- [CGImageSource.Keys](CGImageSourceKeys.md)
- [CGImageSource.List](CGImageSourceList.md)
- [CGImageSource.Release](CGImageSourceRelease.md)

This function checks for a license.

Created 18th August 2014 , last changed 5th January 2018

  
[CGImageSource.ThumbnailAtIndex](CGImageSourceThumbnailAtIndex.md) - [CGPSConverter.Convert](CGPSConverterConvert.md)

[HTML Version](CGImageSourceType.shtml)