Skip to content

Commit

Permalink
Merge branch 'develop' into feature/analizators
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbannov committed Feb 7, 2022
2 parents 37c88da + e16d758 commit 9f5a1f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
7 changes: 6 additions & 1 deletion common/ASC.Core.Common/Data/DbSettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,12 @@ public void ClearCache<T>() where T : class, ISettings

private T Deserialize<T>(string data)
{
return JsonSerializer.Deserialize<T>(data);
var options = new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
};

return JsonSerializer.Deserialize<T>(data, options);
}

private string Serialize<T>(T settings)
Expand Down
10 changes: 7 additions & 3 deletions web/ASC.Web.Core/Users/UserPhotoThumbnailManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,20 @@ public static Image GetImage(Image mainImg, Size size, UserPhotoThumbnailSetting

var x = thumbnailSettings.Point.X > 0 ? thumbnailSettings.Point.X : 0;
var y = thumbnailSettings.Point.Y > 0 ? thumbnailSettings.Point.Y : 0;
var width = x + thumbnailSettings.Size.Width > mainImg.Width ? mainImg.Width : thumbnailSettings.Size.Width;
var height = y + thumbnailSettings.Size.Height > mainImg.Height ? mainImg.Height : thumbnailSettings.Size.Height;

var rect = new Rectangle(x,
y,
thumbnailSettings.Size.Width,
thumbnailSettings.Size.Height);
width,
height);

Image destRound = mainImg.Clone(x => x.Crop(rect).Resize(new ResizeOptions
{
Size = size,
Mode = ResizeMode.Stretch
}));
}));

return destRound;
}
}
Expand Down

0 comments on commit 9f5a1f3

Please sign in to comment.