Improve sticker thumbnail format detection.

This commit is contained in:
levlam 2021-03-02 04:50:14 +03:00
parent fe6fe481f6
commit 720a64962e

View File

@ -1602,12 +1602,15 @@ tl_object_ptr<td_api::sticker> StickersManager::get_sticker_object(FileId file_i
if (sticker_file_view.has_remote_location() && sticker_file_view.remote_location().is_document()) {
document_id = sticker_file_view.remote_location().get_id();
}
if (thumbnail.file_id.is_valid()) {
auto thumbnail_file_view = td_->file_manager_->get_file_view(thumbnail.file_id);
if (ends_with(thumbnail_file_view.suggested_path(), ".jpg")) {
thumbnail_format = PhotoFormat::Jpeg;
}
}
}
}
auto thumbnail_object = get_thumbnail_object(td_->file_manager_.get(), thumbnail, thumbnail_format);
return make_tl_object<td_api::sticker>(
sticker->set_id.get(), sticker->dimensions.width, sticker->dimensions.height, sticker->alt, sticker->is_animated,