浏览代码

修改图片旋转工具

yuzhengyang 7 年之前
父节点
当前提交
a95623d24f

+ 3 - 2
Azylee.Utils/Azylee.Core/Azylee.Core.csproj

@@ -85,11 +85,12 @@
     <Compile Include="IOUtils\ImageUtils\AffineTool.cs" />
     <Compile Include="IOUtils\ImageUtils\BarCodeToHTML.cs" />
     <Compile Include="IOUtils\ImageUtils\CaptchaHelper.cs" />
-    <Compile Include="IOUtils\ImageUtils\ExifTagNames.cs" />
-    <Compile Include="IOUtils\ImageUtils\ExifHelper.cs" />
+    <Compile Include="IOUtils\ExifUtils\ExifTagNames.cs" />
+    <Compile Include="IOUtils\ExifUtils\ExifHelper.cs" />
     <Compile Include="IOUtils\ImageUtils\IconTool.cs" />
     <Compile Include="IOUtils\ImageUtils\ImageHelper.cs" />
     <Compile Include="IOUtils\ImageUtils\ImageSpliter.cs" />
+    <Compile Include="IOUtils\ImageUtils\RotateImageTool.cs" />
     <Compile Include="IOUtils\ImageUtils\ScreenCapture.cs" />
     <Compile Include="IOUtils\ImageUtils\ThunbnailTool.cs" />
     <Compile Include="IOUtils\OfficeUtils\WordTool.cs" />

+ 3 - 3
Azylee.Utils/Azylee.Core/IOUtils/ImageUtils/RotateImageTool.cs

@@ -10,12 +10,12 @@ namespace Azylee.Core.IOUtils.ImageUtils
     public static class RotateImageTool
     {
         /// <summary>
-        /// 旋转照片
+        /// 旋转照片(根据Exif信息的方向)
         /// </summary>
         /// <param name="originalImagePath"></param>
         /// <param name="saveImagePath"></param>
         /// <returns></returns>
-        public static bool RotateImg(string originalImagePath, string saveImagePath)
+        public static bool Rotate(string originalImagePath, string saveImagePath)
         { 
             Image img = Image.FromFile(originalImagePath);
             var exif = img.PropertyItems;
@@ -67,7 +67,7 @@ namespace Azylee.Core.IOUtils.ImageUtils
         /// <param name="saveImagePath">保存图像的路径</param>
         /// <param name = "angle" > 旋转角度[0, 360](前台给的) </ param >
         /// <returns></returns>
-        public static bool RotateImg(string originalImagePath, string saveImagePath, int angle)
+        public static bool Rotate(string originalImagePath, string saveImagePath, int angle)
         {
             Image originalImage = Image.FromFile(originalImagePath);
             angle = angle % 360;

+ 4 - 0
Azylee.Utils/Tests/Test.YeahWeb/Test.YeahWeb.csproj

@@ -48,6 +48,10 @@
     <None Include="App.config" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\Azylee.Core\Azylee.Core.csproj">
+      <Project>{88dc61fa-95f0-41b7-9d7d-ab0f3cbd169c}</Project>
+      <Name>Azylee.Core</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\Azylee.YeahWeb\Azylee.YeahWeb.csproj">
       <Project>{ccf7a654-b442-4db1-bb3b-0f8014c3237f}</Project>
       <Name>Azylee.YeahWeb</Name>