public static void MakeThumbnail(string originalImagePath, string thumbnailPath, ThumbnailSize size) { try { ImageUtil.MakeThumbnail(originalImagePath, thumbnailPath, size.Width, size.Height, size.Mode, size.AddWaterMarker, size.WaterMarkerPosition, size.WaterMarkerPath, size.Quality); Console.WriteLine("生成成功:{0}", thumbnailPath); } catch { Console.WriteLine("生成失败,非标准图片:{0}", thumbnailPath); //_Logger.Error(string.Format("{0} 生成失败,非标准图片", thumbnailPath), e); } }
public static void MakeThumbnail(string originalImagePath, string thumbnailPath, int width, int height, string mode = "Cut", bool isaddwatermark = false, int quality = 88) { var size = new ThumbnailSize() { Width = width, Height = height, Mode = mode, AddWaterMarker = isaddwatermark, Quality = quality}; MakeThumbnail(originalImagePath, thumbnailPath, size); }