diff --git a/Components/Composer.razor b/Components/Composer.razor index ea0ccc5..4948851 100644 --- a/Components/Composer.razor +++ b/Components/Composer.razor @@ -518,12 +518,13 @@ continue; } + // the post's at once, and uploading (a publish meanwhile waits for it); its small picture follows var media = new UploadMedia { File = file, FileName = file.Name, ContentType = type, Size = file.Size }; - if (type.StartsWith("image/")) - media.Preview = await Thumbnail(file); form.Media.Add(media); altTextConfirmed = false; Start(media); + if (type.StartsWith("image/")) + media.Preview = await Thumbnail(file); } } diff --git a/Components/Settings/ProfileEditor.razor b/Components/Settings/ProfileEditor.razor index 829ac55..2d9b8ac 100644 --- a/Components/Settings/ProfileEditor.razor +++ b/Components/Settings/ProfileEditor.razor @@ -200,8 +200,13 @@ else return; } - // the file is sent as it is when saving; only a small picture of it is kept to show it now + // the file is sent as it is when saving, and is the form's at once (a save meanwhile sends it); only a small picture + // of it is kept to show it, made afterwards, and PrivaPub decides about a file the browser can't draw var picture = new UploadMedia { File = file, FileName = file.Name, ContentType = file.ContentType, Size = file.Size }; + if (isAvatar) + form.Avatar = picture; + else + form.Header = picture; try { var small = await file.RequestImageFileAsync("image/jpeg", isAvatar ? 240 : 900, isAvatar ? 240 : 300); @@ -212,14 +217,8 @@ else } catch (Exception ex) { - await Logger.ProcessError(ex, $"{nameof(ProfileEditor)}.{nameof(Pick)}:{file.Name}"); - pictureErrors.Add(Localizer["The file \"{0}\" could not be read.", file.Name]); - return; + await Logger.ProcessWarning(ex.Message, $"{nameof(ProfileEditor)}.{nameof(Pick)}:{file.Name}"); } - if (isAvatar) - form.Avatar = picture; - else - form.Header = picture; } async Task RemovePicture(bool avatar)