Adds small exif library to read meta data from jpg's so we can attempt to read width/height from exif instead of loading the file into mem with GDI, makes for much faster and far less memory processing.U4-6246 Uploading specific images causes GDI+ Errors
This commit is contained in:
@@ -482,17 +482,27 @@ namespace Umbraco.Core
|
||||
/// <returns></returns>
|
||||
public static string ConvertToHex(this string input)
|
||||
{
|
||||
if (String.IsNullOrEmpty(input)) return String.Empty;
|
||||
if (string.IsNullOrEmpty(input)) return string.Empty;
|
||||
|
||||
var sb = new StringBuilder(input.Length);
|
||||
foreach (char c in input)
|
||||
foreach (var c in input)
|
||||
{
|
||||
int tmp = c;
|
||||
sb.AppendFormat("{0:x2}", Convert.ToUInt32(c));
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string DecodeFromHex(this string hexValue)
|
||||
{
|
||||
var strValue = "";
|
||||
while (hexValue.Length > 0)
|
||||
{
|
||||
strValue += Convert.ToChar(Convert.ToUInt32(hexValue.Substring(0, 2), 16)).ToString();
|
||||
hexValue = hexValue.Substring(2, hexValue.Length - 2);
|
||||
}
|
||||
return strValue;
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// Encodes a string to a safe URL base64 string
|
||||
///</summary>
|
||||
|
||||
Reference in New Issue
Block a user