- ⌂ #IMAGE
- Operations
#IMAGE SetFormat
Set the file format used to encode the image bytes.
Prototype
#IMAGE($image_bytes, SetFormat, $format)
Parameters
- Format - A string that represents the file format used to encode the image bytes, such as "GIF", "JPEG", "PDF", "PNG".
If the format is not recognized, an empty string is returned. This is the proper way to check for recognized image data. All other "Get" image processors will log an error when unrecognized image bytes are encountered.
Example
#/ if the file format is not JPEG, convert to JPEG
#NEW($format)#IMAGE($img,GetFormat)#ENDNEW
#IF($format != 'JPEG')
#NEW($img)#IMAGE($img,SetFormat,JPEG)#ENDNEW
<img src="#OUTPUT('thumbnail.jpg',$img)" />
#ENDIF
webCOMAND Docs