-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResizeProfile.cs
More file actions
111 lines (105 loc) · 3.32 KB
/
Copy pathResizeProfile.cs
File metadata and controls
111 lines (105 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
using System.Collections.Generic;
namespace DropResize
{
public enum ResizeMode
{
Fit
}
public enum OutputFormat
{
Jpeg,
Png,
Bmp
}
public class ResizeProfile
{
public string Id { get; set; }
public string Name { get; set; }
public ResizeMode ResizeMode { get; set; }
public int MaxWidth { get; set; }
public int MaxHeight { get; set; }
public bool DoNotEnlarge { get; set; }
public OutputFormat OutputFormat { get; set; }
public long JpegQuality { get; set; }
public string Suffix { get; set; }
public bool IsBuiltIn { get; set; }
public override string ToString()
{
return Name;
}
public static List<ResizeProfile> CreateBuiltInProfiles()
{
return new List<ResizeProfile>
{
new ResizeProfile
{
Id = "email-1280-jpg-85",
Name = "Email 1280 JPG 85",
ResizeMode = ResizeMode.Fit,
MaxWidth = 1280,
MaxHeight = 1280,
DoNotEnlarge = true,
OutputFormat = OutputFormat.Jpeg,
JpegQuality = 85,
Suffix = "_email",
IsBuiltIn = true
},
new ResizeProfile
{
Id = "web-1920-jpg-85",
Name = "Web 1920 JPG 85",
ResizeMode = ResizeMode.Fit,
MaxWidth = 1920,
MaxHeight = 1920,
DoNotEnlarge = true,
OutputFormat = OutputFormat.Jpeg,
JpegQuality = 85,
Suffix = "_web",
IsBuiltIn = true
},
new ResizeProfile
{
Id = "small-800-jpg-80",
Name = "Small 800 JPG 80",
ResizeMode = ResizeMode.Fit,
MaxWidth = 800,
MaxHeight = 800,
DoNotEnlarge = true,
OutputFormat = OutputFormat.Jpeg,
JpegQuality = 80,
Suffix = "_small",
IsBuiltIn = true
},
new ResizeProfile
{
Id = "png-1280",
Name = "PNG 1280",
ResizeMode = ResizeMode.Fit,
MaxWidth = 1280,
MaxHeight = 1280,
DoNotEnlarge = true,
OutputFormat = OutputFormat.Png,
JpegQuality = 90,
Suffix = "_resized",
IsBuiltIn = true
}
};
}
public ResizeProfile Clone()
{
return new ResizeProfile
{
Id = Id,
Name = Name,
ResizeMode = ResizeMode,
MaxWidth = MaxWidth,
MaxHeight = MaxHeight,
DoNotEnlarge = DoNotEnlarge,
OutputFormat = OutputFormat,
JpegQuality = JpegQuality,
Suffix = Suffix,
IsBuiltIn = IsBuiltIn
};
}
}
}