Skip to main content
Language

From Remote URL

PhotoEditor SDK supports loading filters from a remote URL, this can be a resource hosted by a photo hosting provider or your servers. Although the editor supports adding assets with remote URLs, we highly recommend that you manage the download of remote resources yourself, since this gives you more control over the whole process.

Download filter#

For each remote resource, we create a File in the cache directory and download the remote resource. Since file handling and downloading are IO operations, we do this inside a coroutine using the IO dispatcher.

Create LutColorFilterAsset#

Here, we construct a LutColorFilterAsset object using the file downloaded above. Additionally, we also specify the horizontal and vertical tiles as well as the texture size.

Add filter to AssetConfig#

To use the filter, it must first be available in the SDK's backend. This is done by adding the filter to the AssetConfig.

Create filter group#

In cases where we want to simplify navigation and discovery, we can group sets of related filters that will appear in a single folder in the filter tool.

Create a FolderItem passing a unique identifier, a display name for the group and a thumbnail for the group folder.

Configure UiConfigFilter#

Here, we configure UiConfigFilter and add the custom FolderItem we created above to the filterList. Alternatively, we could have directly added the FilterItem to the filterList without creating a folder.