...
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
<PackageReference Include="Blazor.PersianDatePicker" Version="2.1.0" />
|
||||
<PackageReference Include="Melipayamak.RestClient" Version="1.0.0" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.0" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||
<PackageReference Include="FluentValidation" Version="11.9.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
|
||||
|
@@ -5,7 +5,9 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Shared.DTOs;
|
||||
|
||||
using SixLabors.ImageSharp;
|
||||
using SixLabors.ImageSharp.Formats;
|
||||
using SixLabors.ImageSharp.Processing;
|
||||
namespace Back.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
@@ -40,7 +42,20 @@ namespace Back.Controllers
|
||||
var UserID = claim.Value;
|
||||
var result = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
var company = result?.RolUsers.First().Company;
|
||||
company.Logo= logo;
|
||||
//company.Logo = logo;
|
||||
|
||||
//----------resize
|
||||
|
||||
using var image = SixLabors.ImageSharp.Image.Load(logo);
|
||||
//کاهش سایز تصویر
|
||||
image.Mutate(x => x.Resize(200, 200));
|
||||
var img = new MemoryStream();
|
||||
image.Save(img, image.Metadata.DecodedImageFormat );
|
||||
company.Logo = img.ToArray();
|
||||
|
||||
//-------------
|
||||
|
||||
|
||||
return Ok(await _servCompany.AddORUpdateCompanyBoolResult(company));
|
||||
}
|
||||
[HttpGet("ChangeName/{name}")]
|
||||
|
Reference in New Issue
Block a user