GMImage.Ping
------------

Pings an image to query metadata.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [GraphicsMagick](component_GraphicsMagick.md) | [10.3](newinversion103.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "GMImage.Ping"; ImageRef; Spec ) 

**MBS**( **"GMImage.Ping";** /\* Pings an image to query metadata. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$Spec**) /\* The image specification.  
e.g. native file path \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ImageRef | The image reference number. | 1 |
| Spec | The image specification.   e.g. native file path |  |

### Result

Returns OK or error.

### Description

Pings an image to query metadata.  
Ping is similar to read except only enough of the image is read to determine the image columns, rows, and file size.  
  
See [GMImage.GetWidth](GMImageGetWidth.md), [GMImage.GetHeight](GMImageGetHeight.md) and [GMImage.GetXMP](GMImageGetXMP.md).  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### Examples

Ping picture and show size:

 # ping in file Contacts   
  
\# you have some dummy image already   
Set Variable \[ $img ; Value: MBS ( "[GMImage.New](GMImageNew.md)"; "10x10"; "white" ) \]   
\# read new picture into it   
Set Variable \[ $r ; Value: MBS ( "GMImage.Ping"; $img ; "/Users/cs/Desktop/test.png" ) \]   
If \[ MBS ("IsError") = 0 \]   
 Set Variable \[ $w ; Value: MBS ( "[GMImage.GetWidth](GMImageGetWidth.md)"; $img ) \]   
 Set Variable \[ $h ; Value: MBS ( "[GMImage.GetHeight](GMImageGetHeight.md)"; $img ) \]   
 Show Custom Dialog \[ "Size" ; $w &amp; " x " &amp; $h \]   
Else  
 Show Custom Dialog \[ "Failed" ; $r \]   
End If  
Set Variable \[ $r ; Value: MBS ( "[GMImage.Release](GMImageRelease.md)"; $img ) \]  
### See also

- [GMImage.GetHeight](GMImageGetHeight.md)
- [GMImage.GetWidth](GMImageGetWidth.md)
- [GMImage.GetXMP](GMImageGetXMP.md)
- [GMImage.List](GMImageList.md)
- [GMImage.New](GMImageNew.md)
- [GMImage.PingContainer](GMImagePingContainer.md)
- [GMImage.Release](GMImageRelease.md)
- [IsError](IsError.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)

### Release notes

- **Version 10.3**
    - Added [GMImage.Ping](https://www.mbsplugins.eu/GMImagePing.shtml) and [GMImage.PingContainer](https://www.mbsplugins.eu/GMImagePingContainer.shtml) functions.

### Blog Entries

- [What is new in the MBS FileMaker Plugin Version 10.3](https://www.mbsplugins.de/archive/2020-07-31/What_is_new_in_the_MBS_FileMak/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 10.3 - Über 6200 Funktionen in einem Plugin](https://www.mbsplugins.de/archive/2020-07-21/Neues_MBS_FileMaker_Plugin_103/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 10.3 - More than 6200 Functions In One Plugin](https://www.mbsplugins.de/archive/2020-07-21/MBS_FileMaker_Plugin_103_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.3pr9](https://www.mbsplugins.de/archive/2020-07-15/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 14th July 2020 , last changed 8th March 2021

  
[GMImage.Opaque](GMImageOpaque.md) - [GMImage.PingContainer](GMImagePingContainer.md)

[HTML Version](GMImagePing.shtml)