Attaching to the image library

When you call img_lib_attach(), the image library initializes and loads the codecs it finds listed in the img.conf configuration file. You can customize this file to load just the codecs your application requires, and change the location where the image library looks for it by setting the LIBIMG_CFGFILE environment variable. If this environment variable isn't set, the library checks the default location /etc/system/config/img.conf. See the documentation for img_lib_attach() for more information about the format of this file.

To use img_lib_attach():

img_lib_t ilib = NULL;
int rc;
if ((rc = img_lib_attach(&ilib)) != IMG_ERR_OK) {
                fprintf(stderr, "img_lib_attach() failed: %d\n", rc);
                return -1;