Skip to main content

TURL_GetLastProperties (function reference)

By October 1, 2021October 13th, 2021Online Help, Troi URL plug-in
Troi URL Plug-in > Functions reference > TURL_GetLastProperties
Troi URL Plug-in for FileMaker Pro

TURL_GetLastProperties

Gets the (image) properties of the last retrieved image by a TURL_Get or a TURL_Post action.

SyntaxFunction badge

TURL_GetLastProperties ( switches )

Parameters

switches determines the behaviour of the function

Switches

switches can be one of these:

-ImageType get the image type actually returned, for example GIF
-ImageWidth get the width of the last image, in pixels
-ImageHeight get the height of the last image, in pixels
-ImageFileName get the filename of the last image

Returned Result

Data type returned

Text

Result

Possible values for image types are currently:
UNKNOWN
JPEG
GIF
PNG

If the last GET or POST did not return an image UNKNOWN will be returned as image type and 0, 0 is returned as width and height.

Originated in

Troi URL Plug-in 2.0

Compatibility

FileMaker Pro 16 to 19

Considerations

Some web pages have images which have the wrong extension, for example abc.jpg, which is then actually a GIF. This function makes it possible to detect this.

v7.0 added the switch “-ImageFileName”

Example

TURL_GetLastProperties ( "-ImageType" )

will for example return “JPEG”.

Example 2

Set Field [ containerField ; TURL_Get ( "-unused" ; "https://www.troi.com/ima/sm_peter.jpg" ) ]
Set Field [ imageType ; TURL_GetLastProperties ( "-ImageType" ) ]
Set Field [ imageWidth ; TURL_GetLastProperties ( "-ImageWidth" ) ]
Set Field [ imageHeight ; TURL_GetLastProperties ( "-ImageHeight" ) ]

This will get an image and put it into a containerField and fill the other fields with JPEG, 48 and 48 respectively.

Related functionsFunction badge

TURL_Get
TURL_Post

Related topics

Troi URL Plug-in online help (overview)


Online Help Page for Troi URL Plug-in for 16 to 19 –> TURL_GetLastProperties (urlp4412) 2021-1013 16:28:21