A picture field or variable can store different image formats – and even one image in several formats at the same time. As example, an image could be stored as PNG, SVG and MacPICT – in the same variable.
The new GET PICTURE FORMATS command permits you to get the number and types of format that are contained in a C_PICTURE variable.
If you copy/paste a picture from another application, like Adobe Photoshop™ or Microsoft Word™, the other application will insert in the clipboard the image in several formats. Usually the internal native format and one or several standard formats. Pasting that into a 4D picture object, 4D does not know which format you prefer – so it stores ALL supported formats in the same object.
Later, when you export the picture or use CONVERT PICTURE, it checks if the requested format is already existing, then it will be used as it is, or it converts it. For displaying the image, 4D automatically selects one of the supported formats.
With this new GET PICTURE FORMATS command you will be able to identify such pictures and convert them into a single format, to reduce the space taken by your database. It also allows you to check if your database contains pictures saved in a deprecated format such as “pict”. If the deprecated format is supported you will be able to convert the pictures to another format (png, jpg, svg…), if not you can plan actions to recover/replace these pictures.
To know more about the new command, download the following example:
For more details, please refer to the GET PICTURE FORMATS command documentation.