fixed user photo thumbnail generator
This commit is contained in:
parent
8428ef730c
commit
eed733b83c
@ -326,7 +326,12 @@ namespace ASC.Core.Data
|
||||
|
||||
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)
|
||||
|
@ -78,16 +78,20 @@ namespace ASC.Web.Core.Users
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user