개정판 5639752b
issue #00000 Compare 오류 수정
Change-Id: If0efab86e471922327866c6e89b3252e6f565df2
FileUploadWevService/FileUpload.asmx.cs | ||
---|---|---|
91 | 91 |
|
92 | 92 |
var item = entity.PROPERTIES.Where(data => data.TYPE == "SystemInfo" && data.PROPERTY == "Url").FirstOrDefault(); |
93 | 93 |
string result = ""; |
94 |
if (item != null) |
|
95 |
{ |
|
96 |
FileName = FileName.Replace(".png", ".svg"); |
|
97 |
|
|
98 |
result = string.Format(@"{0}/UserData/{1}/{2}/{3}", item.VALUE, ProjectNo, UserID, FileName); |
|
99 |
} |
|
100 |
else |
|
94 |
|
|
95 |
if (item == null) |
|
101 | 96 |
{ |
102 | 97 |
throw new Exception("SystemInfo 정보가 없습니다."); |
103 | 98 |
} |
... | ... | |
109 | 104 |
{ |
110 | 105 |
throw new Exception("TileSourceStorage 정보가 없습니다."); |
111 | 106 |
} |
107 |
|
|
112 | 108 |
/// 실제 이미지를 저장할 위치 |
113 | 109 |
string DirectoryPath = string.Format(Path.Combine(TileSourceProperty.VALUE, "UserData", ProjectNo, UserID)); |
114 | 110 |
DirectoryInfo directoryInfo_ = new DirectoryInfo(DirectoryPath); |
... | ... | |
118 | 114 |
directoryInfo_.Create(); |
119 | 115 |
} |
120 | 116 |
|
121 |
using (MemoryStream ms = new MemoryStream(f))
|
|
117 |
if (!ImageUploadWebService.Properties.Settings.Default.IsSaveSVG)
|
|
122 | 118 |
{ |
123 |
using (var image = Image.FromStream(ms)) |
|
119 |
MemoryStream ms = new MemoryStream(f); |
|
120 |
FileStream fs = new FileStream(directoryInfo_ + @"\" + FileName, FileMode.Create); |
|
121 |
ms.WriteTo(fs); |
|
122 |
|
|
123 |
ms.Close(); |
|
124 |
fs.Close(); |
|
125 |
fs.Dispose(); |
|
126 |
} |
|
127 |
else |
|
128 |
{ |
|
129 |
FileName = FileName.Replace(".png", ".svg"); |
|
130 |
|
|
131 |
using (MemoryStream ms = new MemoryStream(f)) |
|
124 | 132 |
{ |
125 |
using (var ig = new SvgGraphics(Color.Transparent))
|
|
133 |
using (var image = Image.FromStream(ms))
|
|
126 | 134 |
{ |
127 |
//ig.PixelOffsetMode = PixelOffsetMode.HighSpeed; |
|
128 |
ig.CompositingQuality = CompositingQuality.HighSpeed; |
|
129 |
|
|
130 |
ig.DrawImage(image, 0, 0); |
|
131 |
GraphicsContainer cnt = ig.BeginContainer(); |
|
132 |
ig.EndContainer(cnt); |
|
133 |
|
|
134 |
string s = ig.WriteSVGString(); |
|
135 |
string tempFile = Path.Combine(directoryInfo_.FullName, FileName); |
|
136 |
var tw = new StreamWriter(tempFile, false); |
|
137 |
tw.Write(s); |
|
138 |
tw.Close(); |
|
139 |
tw.Dispose(); |
|
140 |
ig.Dispose(); |
|
135 |
using (var ig = new SvgGraphics(Color.Transparent)) |
|
136 |
{ |
|
137 |
//ig.PixelOffsetMode = PixelOffsetMode.HighSpeed; |
|
138 |
ig.CompositingQuality = CompositingQuality.HighSpeed; |
|
139 |
|
|
140 |
ig.DrawImage(image, 0, 0); |
|
141 |
GraphicsContainer cnt = ig.BeginContainer(); |
|
142 |
ig.EndContainer(cnt); |
|
143 |
|
|
144 |
string s = ig.WriteSVGString(); |
|
145 |
string tempFile = Path.Combine(directoryInfo_.FullName, FileName); |
|
146 |
var tw = new StreamWriter(tempFile, false); |
|
147 |
tw.Write(s); |
|
148 |
tw.Close(); |
|
149 |
tw.Dispose(); |
|
150 |
ig.Dispose(); |
|
151 |
} |
|
141 | 152 |
} |
142 | 153 |
} |
143 | 154 |
} |
155 |
|
|
156 |
result = string.Format(@"{0}/UserData/{1}/{2}/{3}", item.VALUE, ProjectNo, UserID, FileName); |
|
144 | 157 |
} |
145 | 158 |
catch (Exception ex) |
146 | 159 |
{ |
내보내기 Unified diff