Skip to content

anderyuan/ResizingServer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ResizingServer

  1. .NET base
  2. image server
  3. support resizing thumb
  4. use ImageResizer

Server Demo

deploy ResizingServer to a web server and config

  <appSettings>
    <add key="UploadRouteUrl" value="api" /><!--api routeurl http://host/{UploadRouteUrl} -->
    <add key="ApiKey" value="48DFD0EE-61A2-4CB5-B1D6-33E917A83202" /><!--when upload file use it -->
    <add key="AllowFolders" value="face,images" /><!-- folder/category  for diff biz line -->
  </appSettings>

physical path like upload/face/1508/21/5a020a4161f543f197ddc0965aeeb66d.jpg

  • upload
    • category(eg:face or images in config:AllowFolders)
      • yyMM (year and month)
        • dd (date)
          • {guid}.jpg

virtual path you can use the ResizingClient to convert from a formatUrl to url format url like /u/face/b96225af353d15504302a087f4f46bb0151d1c{0}x{1}{2}.jpg url like /u/face/b96225af353d15504302a087f4f46bb0151d1c100x100c.jpg

Client Demo

install from nuget downloads release

install nuget package

Install-Package ResizingClient

upload to server

var result=ResizingUtil.Upload(File.ReadAllBytes("d:\\a.jpg"), "a.jpg", "face").Result;
Console.WriteLine(result.FormatUrl);//like /u/face/b96225af353d15504302a087f4f46bb0151d1c{0}x{1}{2}.jpg
//Assert.IsTrue(result.IsSuccess);

{0}:width {1}:height {2}:mode

mode enum:

  • c:crop
  • m:max
  • p:pad

convert format to url

using ResizingClient;
// ...
var url1 = ResizingUtil.Format(url,100,100,ResizingMode.Pad);
var url1 = ResizingUtil.Format(url,100,100);

About

a .net image server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.2%
  • Classic ASP 0.8%