### Namespace

# AppStreamCompose – 1.0

Library to compose AppStream catalog metadata

Version | 1.1.6
Authors | AppStream Developers
License | LGPL-2.1-or-later
Website | https://www.freedesktop.org/software/appstream/docs/
Source | https://github.com/ximion/appstream

#### Build

C headers | `appstream-compose.h`
pkg-config files | `appstream-compose`

#### Dependencies

GObject—2.0 | The base type system library
| Browse documentation
Gio—2.0 | A modern, easy-to-use VFS API
| Browse documentation
AppStream—1.0 | Library to work with AppStream metadata
| Browse documentation

#### Additional documentation

- Classes Hierarchy

#### Classes

Compose |
DirectoryUnit |
Hint |
IconPolicy |
Image |
Result |
Unit |

#### Structs

IconPolicyIter | A `AscIconPolicyIter` structure represents an iterator that can be used to iterate over the icon sizes / policy entries of an `AscIconPolicy`. `AscIconPolicyIter` structures are typically allocated on the stack and then initialized with asc_icon_policy_iter_init().

#### Enumerations

IconState | Designated state for an icon of a given size.
ImageFormat | File format of an image.

#### Bitfields

ComposeFlags |
ImageLoadFlags | The flags used for loading images.
ImageSaveFlags | The flags used for saving images.

#### Error Domains

ComposeError | A metadata composition error.
ImageError | An image processing error.

#### Callbacks

CheckMetadataEarlyFn | Function which is called after all metainfo and related data (e.g. desktop-entry files) has been loaded, but before any expensive operations such as screenshot downloads or font searches are performed.
TranslateDesktopTextFn | Function which is called while parsing a desktop-entry file to allow external translations of string values. This is used in e.g. the Ubuntu distribution.

#### Functions

build_component_global_id | Builds a global component ID from a component-id and a checksum (usually Blake3) generated from the component data.
compute_content_checksum_for_data | Compute a checksum for the given content.
filename_from_url | Generate a filename from a web-URL that can be used to store the file on disk after download.
globals_add_hint_tag | Register a new hint tag. If a previous tag with the given name already existed, the existing tag will not be replaced unless `overrideExisting` is set to `TRUE`. Please be careful when overriding tags! Tag severities can not be lowered by overriding a tag.
globals_clear | Clear all global state and restore defaults.
globals_get_ffprobe_binary | Get path to the “ffprobe” binary we should use.
globals_get_hint_tags | Retrieve all hint tags that we know.
globals_get_optipng_binary | Get path to the “optipng” binary we should use.
globals_get_tmp_dir | Get temporary directory used by appstream-compose.
globals_get_tmp_dir_create | Get temporary directory used by appstream-compose and try to create it if it does not exist.
globals_get_use_optipng | Get whether images should be optimized using optipng.
globals_hint_tag_explanation | Retrieve the explanation template of the given hint tag.
globals_hint_tag_severity | Retrieve the severity of the given hint tag.
globals_set_ffprobe_binary | Set path to the “ffprobe” binary we should use.
globals_set_optipng_binary | Set path to the “optipng” binary we should use.
globals_set_tmp_dir | Set temporary directory used by appstream-compose.
globals_set_use_optipng | Set whether images should be optimized using optipng.
render_svg_to_file | Renders SVG data from a stream to a file in a specific format.