移动系统liao
2025-02-08 479b6cfc60113f692f6f9146bcd7b9231a32b0e8
cylsg/EzUpFile/EzFileUploadService.cs
@@ -302,7 +302,7 @@
                if (FileData.Length > maxSize)
                {
                    throw Oops.Oh(" 上传文件不可超出500K");
                    throw Oops.Oh(" 上传文件不可超出5M");
                }
@@ -316,13 +316,13 @@
                }
                MemoryStream ms = new MemoryStream();
                if (oimage.Width > 600)
                if (oimage.Width > 1200)
                {
                    if (oimage.Width > oimage.Height)
                        oimage.GetThumbnailImage(600, 400, null, IntPtr.Zero).Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                        oimage.GetThumbnailImage(1200, 800, null, IntPtr.Zero).Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                    else
                        oimage.GetThumbnailImage(400, 600, null, IntPtr.Zero).Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                        oimage.GetThumbnailImage(800, 1200, null, IntPtr.Zero).Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                }
                else
                    oimage.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
@@ -349,7 +349,7 @@
                catch (Exception e)
                {
                    throw Oops.Oh(e.Message);
                    throw Oops.Oh(e.Message+"腾讯云,或者阿里云操作错误");
                }
            }
            catch (Exception e)
@@ -371,7 +371,7 @@
                if (FileData.Length > maxSize)
                {
                    throw Oops.Oh(" 上传文件不可超出500K");
                    throw Oops.Oh(" 上传文件不可超出5M");
                }
@@ -385,13 +385,13 @@
                }
                MemoryStream ms = new MemoryStream();
                if (oimage.Width > 600)
                if (oimage.Width > 1200)
                {
                    if (oimage.Width > oimage.Height)
                        oimage.GetThumbnailImage(600, 400, null, IntPtr.Zero).Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                        oimage.GetThumbnailImage(1200, 800, null, IntPtr.Zero).Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                    else
                        oimage.GetThumbnailImage(400, 600, null, IntPtr.Zero).Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                        oimage.GetThumbnailImage(800, 1200, null, IntPtr.Zero).Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                }
                else
                    oimage.Save(ms, System.Drawing.Imaging.ImageFormat.Png);