### QPx_TestImageFile

QPx_TestImageFile(imagePath; imageType):error
| imagePath | Text | Full path to image file
| imageType | String4 | Image type
| error | Longint | Error result

Tests if a file contains image data.

If imagePath is a file that contains valid image data, imageType is set to a graphic importer type identifier (a non empty string) and returns qpx_noErr. If the file is not an image file, the imageType is set to an empty string and the qpx_paramErr error is returned.

If imagePath parameter is invalid, a file system error is returned. If imagePath is empty, QPix presents the following file selection dialog where the user can preview and select an image file. If the user selects a file, its full pathname is returned in imagePath, otherwise error qpx_userCancelErr is returned.

Example

``Test a gif image` `C_LONGINT($error)` `C_TEXT($imagePath)` `C_STRING(4;$imageType)` `` `$imagePath:="Hard disk:images:people.gif"` `$imageType:=""` `` `$error:=QPx_TestImageFile ($imagePath;$imageType)` `` `If ($error=qpx_noErr)` `` `Case of` `: ($imageType="GIFf")` `` ``Handle gif file` `` `End case` `` `End if`

Related commands

QPx_GetImportTypes | Returns the list of available import types

QPix © Escape
Generated by QDoc 2.8 on Wed, Feb 17, 2010 17:42:54