Browse Source

Merge pull request #26655 from merumelu/assetlib-video-overlay

AssetLib: convert video thumbnails to RGBA8
Rémi Verschelde 6 years ago
parent
commit
88355b2719
1 changed files with 2 additions and 0 deletions
  1. 2 0
      editor/plugins/asset_library_editor_plugin.cpp

+ 2 - 0
editor/plugins/asset_library_editor_plugin.cpp

@@ -177,6 +177,8 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const
 						thumbnail = thumbnail->duplicate();
 						thumbnail = thumbnail->duplicate();
 						Point2 overlay_pos = Point2((thumbnail->get_width() - overlay->get_width()) / 2, (thumbnail->get_height() - overlay->get_height()) / 2);
 						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->lock();
 						thumbnail->blend_rect(overlay, overlay->get_used_rect(), overlay_pos);
 						thumbnail->blend_rect(overlay, overlay->get_used_rect(), overlay_pos);
 						thumbnail->unlock();
 						thumbnail->unlock();