Improve sticker thumbnail format detection.
This commit is contained in:
parent
fe6fe481f6
commit
720a64962e
@ -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()) {
|
if (sticker_file_view.has_remote_location() && sticker_file_view.remote_location().is_document()) {
|
||||||
document_id = sticker_file_view.remote_location().get_id();
|
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);
|
auto thumbnail_file_view = td_->file_manager_->get_file_view(thumbnail.file_id);
|
||||||
if (ends_with(thumbnail_file_view.suggested_path(), ".jpg")) {
|
if (ends_with(thumbnail_file_view.suggested_path(), ".jpg")) {
|
||||||
thumbnail_format = PhotoFormat::Jpeg;
|
thumbnail_format = PhotoFormat::Jpeg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
auto thumbnail_object = get_thumbnail_object(td_->file_manager_.get(), thumbnail, thumbnail_format);
|
auto thumbnail_object = get_thumbnail_object(td_->file_manager_.get(), thumbnail, thumbnail_format);
|
||||||
return make_tl_object<td_api::sticker>(
|
return make_tl_object<td_api::sticker>(
|
||||||
sticker->set_id.get(), sticker->dimensions.width, sticker->dimensions.height, sticker->alt, sticker->is_animated,
|
sticker->set_id.get(), sticker->dimensions.width, sticker->dimensions.height, sticker->alt, sticker->is_animated,
|
||||||
|
Loading…
Reference in New Issue
Block a user