Skip to content

Commit

Permalink
修复御2行业进阶版照片解析报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
jazous committed Apr 11, 2023
1 parent 27e8b3c commit 6e8ae94
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 12 deletions.
4 changes: 2 additions & 2 deletions SDKs.DjiImage.Net45/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.1.0")]
[assembly: AssemblyFileVersion("1.4.1.0")]
[assembly: AssemblyVersion("1.4.2.0")]
[assembly: AssemblyFileVersion("1.4.2.0")]
9 changes: 7 additions & 2 deletions SDKs.DjiImage.Net45/Rdf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ static class Rdf
{
const string rdf_Description = "<rdf:Description";
const string drone_dji_Version = "drone-dji:Version=[\"][\\d]+[.\\d]*[\"]";
const string drone_dji_Make = "tiff:Make=\"DJI\"";
const string drone_dji_Model = "tiff:Model=[\"].+[\"]";
const string drone_dji_GpsStatus = "drone-dji:GpsStatus=[\"].+[\"]";
const string drone_dji_GpsLatitude = "drone-dji:GpsLatitude=[\"][-+]{0,1}\\d+[.\\d+]*[\"]";
Expand All @@ -20,6 +21,7 @@ static class Rdf
const string drone_dji_FlightYawDegree = "drone-dji:FlightYawDegree=[\"][-+]{0,1}\\d+[.\\d+]*[\"]";
const string drone_dji_FlightPitchDegree = "drone-dji:FlightPitchDegree=[\"][-+]{0,1}\\d+[.\\d+]*[\"]";
const string drone_dji_RtkFlag = "drone-dji:RtkFlag=[\"]\\d+[\"]";
const string drone_dji_RtkStdLon = "drone-dji:RtkStdLon=[\"]\\d+[.\\d+]*[\"]";

static string GetStr(System.Text.RegularExpressions.Regex regex, System.Text.Encoding encoding, byte[] bytes, int sIndex, int ncount)
{
Expand Down Expand Up @@ -93,12 +95,15 @@ static string GetStr(System.Text.RegularExpressions.Regex regex, System.Text.Enc
}
internal static RdfDroneDji? GetDroneDji(string text)
{
var mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Version, RegexOptions.CultureInvariant);
var mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Make, RegexOptions.CultureInvariant);
if (!mc.Success)
return null;

var meta = new RdfDroneDji();
meta.Version = mc.Value.Split('=')[1].Trim('"');

mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Version, RegexOptions.CultureInvariant);
if (mc.Success)
meta.Version = mc.Value.Split('=')[1].Trim('"');

mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Model, RegexOptions.CultureInvariant);
if (mc.Success)
Expand Down
4 changes: 2 additions & 2 deletions SDKs.DjiImage.Net48/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.1.0")]
[assembly: AssemblyFileVersion("1.4.1.0")]
[assembly: AssemblyVersion("1.4.2.0")]
[assembly: AssemblyFileVersion("1.4.2.0")]
[assembly: NeutralResourcesLanguage("zh")]
8 changes: 6 additions & 2 deletions SDKs.DjiImage.Net48/Rdf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ static class Rdf
{
const string rdf_Description = "<rdf:Description";
const string drone_dji_Version = "drone-dji:Version=[\"][\\d]+[.\\d]*[\"]";
const string drone_dji_Make = "tiff:Make=\"DJI\"";
const string drone_dji_Model = "tiff:Model=[\"].+[\"]";
const string drone_dji_GpsStatus = "drone-dji:GpsStatus=[\"].+[\"]";
const string drone_dji_GpsLatitude = "drone-dji:GpsLatitude=[\"][-+]{0,1}\\d+[.\\d+]*[\"]";
Expand Down Expand Up @@ -93,12 +94,15 @@ static string GetStr(System.Text.RegularExpressions.Regex regex, System.Text.Enc
}
internal static RdfDroneDji? GetDroneDji(string text)
{
var mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Version, RegexOptions.CultureInvariant);
var mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Make, RegexOptions.CultureInvariant);
if (!mc.Success)
return null;

var meta = new RdfDroneDji();
meta.Version = mc.Value.Split('=')[1].Trim('"');

mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Version, RegexOptions.CultureInvariant);
if (mc.Success)
meta.Version = mc.Value.Split('=')[1].Trim('"');

mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Model, RegexOptions.CultureInvariant);
if (mc.Success)
Expand Down
9 changes: 7 additions & 2 deletions SDKs.DjiImage/Rdf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ static class Rdf
{
const string rdf_Description = "<rdf:Description";
const string drone_dji_Version = "drone-dji:Version=[\"][\\d]+[.\\d]*[\"]";
const string drone_dji_Make = "tiff:Make=\"DJI\"";
const string drone_dji_Model = "tiff:Model=[\"].+[\"]";
const string drone_dji_GpsStatus = "drone-dji:GpsStatus=[\"].+[\"]";
const string drone_dji_GpsLatitude = "drone-dji:GpsLatitude=[\"][-+]{0,1}\\d+[.\\d+]*[\"]";
Expand Down Expand Up @@ -93,12 +94,16 @@ static string GetStr(System.Text.RegularExpressions.Regex regex, System.Text.Enc
}
internal static RdfDroneDji? GetDroneDji(string text)
{
var mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Version, RegexOptions.CultureInvariant);
//判断是否是大疆无人机照片
var mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Make, RegexOptions.CultureInvariant);
if (!mc.Success)
return null;

var meta = new RdfDroneDji();
meta.Version = mc.Value.Split('=')[1].Trim('"');

mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Version, RegexOptions.CultureInvariant);
if (mc.Success)
meta.Version = mc.Value.Split('=')[1].Trim('"');

mc = System.Text.RegularExpressions.Regex.Match(text, drone_dji_Model, RegexOptions.CultureInvariant);
if (mc.Success)
Expand Down
4 changes: 2 additions & 2 deletions SDKs.DjiImage/SDKs.DjiImage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Nullable>enable</Nullable>
<SignAssembly>True</SignAssembly>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.4.1</Version>
<Version>1.4.2</Version>
<Authors>jazous</Authors>
<RepositoryUrl>https://github.com/Jazous/SDKs-DjiImage.git</RepositoryUrl>
<PackageProjectUrl>https://github.com/Jazous/SDKs-DjiImage</PackageProjectUrl>
Expand All @@ -26,7 +26,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<AssemblyOriginatorKeyFile>..\SDKs.snk</AssemblyOriginatorKeyFile>
<DocumentationFile>obj\Release\net6.0\SDKs.DjiImage.xml</DocumentationFile>
<PackageReleaseNotes>1、修复获取矩形温度和矩形集合方法中矩形超出图片像素范围时的判断问题</PackageReleaseNotes>
<PackageReleaseNotes>1、修复读取御2行业进阶版照片报错的问题</PackageReleaseNotes>
<Company>[email protected]</Company>
<Product>$(AssemblyName).dll</Product>
</PropertyGroup>
Expand Down

0 comments on commit 6e8ae94

Please sign in to comment.