KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Converting Pictures to Remove Quicktime Dependency
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: March 17, 2011

This Tech Tip applies to both 4D v11 SQL and 4D v12.

Since 4D v11 SQL, 4D no longer relies on Apple QuickTime in order to display pictures. With one exception, 4D handles picture rendering natively. The exception is if the picture is specifically encoded in the MacPICT format. 4D still relies on QuickTime to handle MacPICT pictures. Please note that MacPICT is only a container: it can contain images in other formats (JPEG, GIF, TIFF, etc.).

To eliminate the need for QuickTime, simply use the CONVERT PICTURE command, for example:

ALL RECORDS([Pictures_4D])
While (Not(End selection([Pictures_4D])))
    CONVERT PICTURE([Pictures_4D]Pic;".jpg")
    SAVE RECORD([Pictures_4D])
    NEXT RECORD([Pictures_4D])
End while


The above example converts the MacPICT pictures into JPEG pictures.

Note that in 4D v12 the JPEG compression can be changed as well, with an addtional parameter:

CONVERT PICTURE([Pictures_4D]Pic;".jpg"; 0.6)


IMPORTANT: this procedure should only be executed on a computer that has Quicktime installed. If Quicktime is not installed the conversion will fail and all of the MacPICT pictures will be deleted.

To test and see if Quicktime is installed, check the picture codec list, for example:

ARRAY TEXT($ids_at;0)
ARRAY TEXT($names_at;0)
PICTURE CODEC LIST($ids_at;$names_at)
If (Find in array($ids_at;".qtif")<0) // QuickTime image
    ALERT("QuickTime is not installed.")
End if