Skip to content

Commit

Permalink
Если "обложка" в формате WebP, то преобразуем ее в формат JPEG во вре…
Browse files Browse the repository at this point in the history
…мя сохранения.
  • Loading branch information
v0lt committed May 30, 2024
1 parent ef6f93e commit e4d6f61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/apps/mplayerc/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6056,9 +6056,12 @@ void CMainFrame::OnFileSaveAs()
if (m_youtubeFields.fname.GetLength()) {
if (m_bAudioOnly) {
saveItems.emplace_back('a', in, GetAltFileName(), "");
if (ext == L".m4a" && EndsWithNoCase(m_youtubeFields.thumbnailUrl, L".jpg")) {
saveItems.emplace_back('t', m_youtubeFields.thumbnailUrl, L".jpg", "");
ffmpegpath = GetFullExePath(s.strFFmpegExePath, true);
if (ext == L".m4a") {
auto thumbnail_ext = m_youtubeFields.thumbnailUrl.Mid(m_youtubeFields.thumbnailUrl.ReverseFind('.')).MakeLower();
if (thumbnail_ext == L".jpg" || thumbnail_ext == L".webp") {
saveItems.emplace_back('t', m_youtubeFields.thumbnailUrl, thumbnail_ext, "");
ffmpegpath = GetFullExePath(s.strFFmpegExePath, true);
}
}
}
else {
Expand Down
3 changes: 3 additions & 0 deletions src/apps/mplayerc/SaveTaskDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ void CSaveTaskDlg::SaveHTTP(const int iSubLangDefault)
strArgs.AppendFormat(L" -disposition:s:%d default", iSubLangDefault);
}
if (m_saveItems.back().type == 't') {
if (EndsWith(m_dstPaths.back(), L".webp")) {
strArgs.Append(L" -c:v:0 mjpeg");
}
strArgs.Append(L" -disposition:v:0 attached_pic");
}
if (finalext == L"mp4" || finalext == L"m4a") {
Expand Down

0 comments on commit e4d6f61

Please sign in to comment.