String encoding = _getImageEncoding(context, properties);
// _getImageEncoding() always returns non-null encoding
assert (encoding != null);
ImageEncoderManager manager =
ImageEncoderManager.getDefaultImageEncoderManager();
String extension = manager.getImageExtension(encoding);
if (extension == null)
_error(_IMAGE_ENCODING_EXTENSION_ERROR + encoding);
return extension;