Skip to content

Conversation

@iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Oct 29, 2025

Changelog Description

Allow to create thumbnail from file stream.

Additional review information

Extend the functionality of thumbnail upload so it is possible to use byte stream to upload thumbnail instead of filepath.
This PR gave me the idea that we should support this ynput/ayon-core#1510 .

Testing notes:

  1. Download thumbnail using get_thumbnail_by_id and then create new thumbnail using create_thumbnail_with_stream.
  2. Thumbnail is uploaded.

Example snippet

import io
import ayon_api


project_name = "..."
src_folder_id = "..."
dst_folder_id = "..."
src_folder_entity = ayon_api.get_folder_by_id(project_name, src_folder_id)
src_thumbnail = ayon_api.get_folder_thumbnail(
    project_name,
    src_folder_entity["id"],
    src_folder_entity["thumbnailId"]
)
stream = io.BytesIO(src_thumbnail.content)
thumbnail_id = ayon_api.create_thumbnail_with_stream(project_name, stream)
ayon_api.update_folder(project_name, folder_id, thumbnail_id=thumbnail_id)

@iLLiCiTiT iLLiCiTiT added the type: enhancement New feature or request label Oct 29, 2025
@iLLiCiTiT iLLiCiTiT self-assigned this Oct 29, 2025
@iLLiCiTiT iLLiCiTiT requested a review from kalisp October 29, 2025 14:10
@iLLiCiTiT iLLiCiTiT changed the title added functions to create thumbnail from stream Thumbnails: Create thumbnail from stream Oct 29, 2025
@iLLiCiTiT iLLiCiTiT merged commit 464f282 into develop Oct 30, 2025
2 checks passed
@iLLiCiTiT iLLiCiTiT deleted the enhancement/support-thumbnail-upload-from-stream branch October 30, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants