CGImageSource.Status
--------------------

Return the status of an 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.Status"; Ref { ; Index } ) 

**MBS**( **"CGImageSource.Status";** /\* Return the status of an image source. \*/  
**$Ref**; /\* The image source reference number returned by [CGImageSource.CreateWithData](CGImageSourceCreateWithData.md), [CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md) or [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md) \*/   
**$Index**) /\* Optional; The index of the image to query. -1 for global properties. Else a number from 0 to [CGImageSource.Count](CGImageSourceCount.md)-1.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Ref | The image source reference number returned by [CGImageSource.CreateWithData](CGImageSourceCreateWithData.md), [CGImageSource.CreateWithPath](CGImageSourceCreateWithPath.md) or [CGImageSource.CreateWithURL](CGImageSourceCreateWithURL.md) | $ref |  |
| Index | The index of the image to query. -1 for global properties. Else a number from 0 to [CGImageSource.Count](CGImageSourceCount.md)-1. | 0 | Optional |

### Result

Returns status number or error message.

### Description

Return the status of an image source.  
  
Possible status values:  
| kCGImageStatusUnexpectedEOF | -5 | The end of the file was encountered unexpectedly. |
|---|--:|---|
| kCGImageStatusInvalidData | -4 | The data is not valid. |
| kCGImageStatusUnknownType | -3 | The image is an unknown type. |
| kCGImageStatusReadingHeader | -2 | In the process of reading the header. |
| kCGImageStatusIncomplete | -1 | The operation is not complete |
| kCGImageStatusComplete | 0 | The operation is complete. |

### Examples

Checks status:

 Set Variable \[ $img ; Value: MBS ( "[CGImageSource.CreateWithData](CGImageSourceCreateWithData.md)"; test::input ) \]   
Show Custom Dialog \[ "Status" ; MBS ( "CGImageSource.Status"; $img ; 0) \]   
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.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.SetProperty](CGImageSourceSetProperty.md) - [CGImageSource.SupportedExportTypes](CGImageSourceSupportedExportTypes.md)

[HTML Version](CGImageSourceStatus.shtml)