feat: added thumbnail middleware (idk if it works tho)
This commit is contained in:
parent
b25949a8f3
commit
6a1287495d
5 changed files with 33 additions and 4 deletions
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
|
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
|
||||||
|
<PackageReference Include="ImageThumbnail.AspNetCore.Middleware" Version="1.0.1" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.13" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.13" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.13">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.13">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
@ -25,9 +26,31 @@
|
||||||
<Folder Include="wwwroot\img\dynamic\comment\tec" />
|
<Folder Include="wwwroot\img\dynamic\comment\tec" />
|
||||||
<Folder Include="wwwroot\img\dynamic\comment\vg" />
|
<Folder Include="wwwroot\img\dynamic\comment\vg" />
|
||||||
<Folder Include="wwwroot\img\dynamic\op\art" />
|
<Folder Include="wwwroot\img\dynamic\op\art" />
|
||||||
<Folder Include="wwwroot\img\dynamic\op\m" />
|
|
||||||
<Folder Include="wwwroot\img\dynamic\op\tec" />
|
<Folder Include="wwwroot\img\dynamic\op\tec" />
|
||||||
<Folder Include="wwwroot\img\dynamic\op\vg" />
|
<Folder Include="wwwroot\img\dynamic\op\vg" />
|
||||||
|
<Folder Include="wwwroot\img\thumb" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\dynamic\op\m\zh5hrb0h.srp.jpg" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banned\1.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banned\10.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banned\2.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banned\3.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banned\4.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banned\5.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banned\6.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banned\7.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banned\8.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banned\9.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banner\art ban.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banner\m ban.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\banner\tec ban.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\deadlink\1.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\err\1.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\err\2.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\err\3.png" />
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\img\static\logo.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using ImageBoardServerApp.Auth;
|
using ImageBoardServerApp.Auth;
|
||||||
using ImageBoardServerApp.Data;
|
using ImageBoardServerApp.Data;
|
||||||
|
using ImageThumbnail.AspNetCore.Middleware;
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage;
|
using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage;
|
||||||
|
|
||||||
|
@ -38,4 +39,8 @@ using (var serviceScope = app.Services.CreateScope())
|
||||||
context.Database.EnsureCreated();
|
context.Database.EnsureCreated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImageThumbnailOptions options = new ImageThumbnailOptions("wwwroot/img/", "wwwroot/img/thumb");
|
||||||
|
options.ImageQuality = 75L;
|
||||||
|
app.UseImageThumbnail(options);
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
|
@ -11,6 +11,7 @@
|
||||||
display: block;
|
display: block;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
max-width: 500px;
|
width: 500px;
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
|
max-width: 90vw !important;
|
||||||
}
|
}
|
|
@ -22,7 +22,7 @@
|
||||||
<div class="threadImage">
|
<div class="threadImage">
|
||||||
@if (image != null)
|
@if (image != null)
|
||||||
{
|
{
|
||||||
<img src="@($"{image.ImageLocation}")" alt="No Image found" />
|
<img src="@($"{image.ImageLocation}?size=258x258")" alt="No Image found" />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="threadTextContainer">
|
<div class="threadTextContainer">
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<div class="threadImage">
|
<div class="threadImage">
|
||||||
@if (@post.Image != null)
|
@if (@post.Image != null)
|
||||||
{
|
{
|
||||||
<img src="@($"{@post.Image.ImageLocation}")" alt="No Image found" />
|
<img src="@($"{@post.Image.ImageLocation}?size=258x258")" alt="No Image found" />
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue