|
|
|
@ -1,5 +1,8 @@
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Drawing.Imaging;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Net.Http.Headers;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using Infrastructure.CloudSdk.minio;
|
|
|
|
|
using Infrastructure.CloudSdk.wayline;
|
|
|
|
|
using Infrastructure.Extensions;
|
|
|
|
@ -179,7 +182,7 @@ public class TestAbc
|
|
|
|
|
static string GetPropertyName(int id)
|
|
|
|
|
{
|
|
|
|
|
// 常见的EXIF属性ID映射
|
|
|
|
|
var propertyNames = new System.Collections.Generic.Dictionary<int, string>
|
|
|
|
|
var propertyNames = new Dictionary<int, string>
|
|
|
|
|
{
|
|
|
|
|
{ 0x010F, "制造商" },
|
|
|
|
|
{ 0x0110, "相机型号" },
|
|
|
|
@ -213,7 +216,7 @@ public class TestAbc
|
|
|
|
|
case 1: // 字节型
|
|
|
|
|
return BitConverter.ToString(prop.Value);
|
|
|
|
|
case 2: // 字符串
|
|
|
|
|
return System.Text.Encoding.ASCII.GetString(prop.Value).Trim('\0');
|
|
|
|
|
return Encoding.ASCII.GetString(prop.Value).Trim('\0');
|
|
|
|
|
case 3: // 16位整数
|
|
|
|
|
return BitConverter.ToInt16(prop.Value, 0).ToString();
|
|
|
|
|
case 4: // 32位整数
|
|
|
|
@ -428,20 +431,21 @@ public class TestAbc
|
|
|
|
|
long? picSize = 0;
|
|
|
|
|
int width = 0, height = 0, focalLength = 0;
|
|
|
|
|
int offset = 0, length = 0;
|
|
|
|
|
string model = "";
|
|
|
|
|
using (var httpClient = new HttpClient())
|
|
|
|
|
{
|
|
|
|
|
var total = 0L;
|
|
|
|
|
// 添加Range请求头
|
|
|
|
|
httpClient.DefaultRequestHeaders.Range = new System.Net.Http.Headers.RangeHeaderValue(0, 65535);
|
|
|
|
|
httpClient.DefaultRequestHeaders.Range = new RangeHeaderValue(0, 65535);
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var response = httpClient
|
|
|
|
|
.GetAsync(
|
|
|
|
|
"http://" + minio.endPoint + "/" + minio._bucketName + "/" +
|
|
|
|
|
"/640aea27-2dd3-4081-933c-fcef432fcec0/71924889-540d-4362-aeb1-9ee787a655a7/DJI_202508050906_002_71924889-540d-4362-aeb1-9ee787a655a7/DJI_20250805090809_0001_V.jpeg",
|
|
|
|
|
"f4ac965b-b5bb-44ce-83e6-10d5758c4960/8529f6f0-2fc2-4357-95a4-9244fae06e9e/DJI_202508081026_002_8529f6f0-2fc2-4357-95a4-9244fae06e9e/DJI_20250808102710_0002_D.NAV",
|
|
|
|
|
HttpCompletionOption.ResponseHeadersRead).Result;
|
|
|
|
|
|
|
|
|
|
if (response.StatusCode == System.Net.HttpStatusCode.PartialContent)
|
|
|
|
|
if (response.StatusCode == HttpStatusCode.PartialContent)
|
|
|
|
|
{
|
|
|
|
|
//Focal Length 35: 24 mm
|
|
|
|
|
//Exif Image Width: 4032 pixels : Exif SubIFD
|
|
|
|
@ -491,6 +495,17 @@ public class TestAbc
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (directory.Name.Equals("Exif IFD0"))
|
|
|
|
|
{
|
|
|
|
|
foreach (var tag in directory.Tags)
|
|
|
|
|
{
|
|
|
|
|
if (tag.Name.Equals("Model"))
|
|
|
|
|
{
|
|
|
|
|
model = tag.Description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Console.WriteLine(directory.Name);
|
|
|
|
|
if (directory.Name.Equals("Exif Thumbnail"))
|
|
|
|
|
{
|
|
|
|
@ -519,7 +534,8 @@ public class TestAbc
|
|
|
|
|
Size = picSize,
|
|
|
|
|
ShowOnMap = 1,
|
|
|
|
|
display = 1,
|
|
|
|
|
FocalLength = focalLength
|
|
|
|
|
FocalLength = focalLength,
|
|
|
|
|
PayloadModelKey = model,
|
|
|
|
|
};
|
|
|
|
|
Console.WriteLine("是否有错呢:" + JsonConvert.SerializeObject(fileUpload));
|
|
|
|
|
ms.Seek(offset + 6, SeekOrigin.Begin);
|
|
|
|
@ -530,7 +546,7 @@ public class TestAbc
|
|
|
|
|
Console.WriteLine("读取的字节长度: " + bytesRead);
|
|
|
|
|
File.WriteAllBytes("f:/abbbbbb.jpeg", buffer);
|
|
|
|
|
}
|
|
|
|
|
else if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
|
|
|
|
else if (response.StatusCode == HttpStatusCode.OK)
|
|
|
|
|
{
|
|
|
|
|
// 服务器不支持Range请求,返回完整内容
|
|
|
|
|
throw new InvalidOperationException("服务器不支持Range请求");
|
|
|
|
|