AssetLib: convert video thumbnails to RGBA

Image::blend_rect only works with images that have the same format.
This commit is contained in:
merumelu 2019-03-05 21:02:56 +01:00
parent c40877bc6a
commit e4b20a9a51

View File

@ -177,6 +177,8 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const
thumbnail = thumbnail->duplicate();
Point2 overlay_pos = Point2((thumbnail->get_width() - overlay->get_width()) / 2, (thumbnail->get_height() - overlay->get_height()) / 2);
// Overlay and thumbnail need the same format for `blend_rect` to work.
thumbnail->convert(Image::FORMAT_RGBA8);
thumbnail->lock();
thumbnail->blend_rect(overlay, overlay->get_used_rect(), overlay_pos);
thumbnail->unlock();