Skip to content

Commit f1b1f5e

Browse files
committed
Produce alternative DLL targeting .NET 3.5 Client Profile. Closes #22.
1 parent 05889b3 commit f1b1f5e

40 files changed

+567
-69
lines changed

MetadataExtractor.Tests/MetadataExtractor.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
<DebugSymbols>true</DebugSymbols>
2121
<DebugType>full</DebugType>
2222
<Optimize>false</Optimize>
23-
<OutputPath>bin\Debug\</OutputPath>
23+
<OutputPath>bin\Debug\net45\</OutputPath>
2424
<DefineConstants>DEBUG;TRACE</DefineConstants>
2525
<ErrorReport>prompt</ErrorReport>
2626
<WarningLevel>4</WarningLevel>
2727
</PropertyGroup>
2828
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2929
<DebugType>pdbonly</DebugType>
3030
<Optimize>true</Optimize>
31-
<OutputPath>bin\Release\</OutputPath>
31+
<OutputPath>bin\Release\net45\</OutputPath>
3232
<DefineConstants>TRACE</DefineConstants>
3333
<ErrorReport>prompt</ErrorReport>
3434
<WarningLevel>4</WarningLevel>
@@ -173,9 +173,9 @@
173173
<None Include="packages.config" />
174174
</ItemGroup>
175175
<ItemGroup>
176-
<ProjectReference Include="..\MetadataExtractor\MetadataExtractor.csproj">
176+
<ProjectReference Include="..\MetadataExtractor\MetadataExtractor.net45.csproj">
177177
<Project>{26e27564-a74f-423b-a986-e979988f259d}</Project>
178-
<Name>MetadataExtractor</Name>
178+
<Name>MetadataExtractor.net45</Name>
179179
</ProjectReference>
180180
</ItemGroup>
181181
<ItemGroup>

MetadataExtractor.Tests/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<packages>
44
<package id="JetBrains.Annotations" version="9.1.1" targetFramework="net45" />
5-
<package id="XmpCore" version="1.1.0" targetFramework="net45" />
5+
<package id="XmpCore" version="1.1.0" targetFramework="net35" />
66
<package id="xunit" version="2.0.0" targetFramework="net45" />
77
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
88
<package id="xunit.assert" version="2.0.0" targetFramework="net45" />

MetadataExtractor.Tools.FileProcessor/MetadataExtractor.Tools.FileProcessor.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
<None Include="packages.config" />
5656
</ItemGroup>
5757
<ItemGroup>
58-
<ProjectReference Include="..\MetadataExtractor\MetadataExtractor.csproj">
58+
<ProjectReference Include="..\MetadataExtractor\MetadataExtractor.net45.csproj">
5959
<Project>{26E27564-A74F-423B-A986-E979988F259D}</Project>
60-
<Name>MetadataExtractor</Name>
60+
<Name>MetadataExtractor.net45</Name>
6161
</ProjectReference>
6262
</ItemGroup>
6363
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

MetadataExtractor.Tools.JpegSegmentExtractor/MetadataExtractor.Tools.JpegSegmentExtractor.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
<None Include="App.config" />
4848
</ItemGroup>
4949
<ItemGroup>
50-
<ProjectReference Include="..\MetadataExtractor\MetadataExtractor.csproj">
50+
<ProjectReference Include="..\MetadataExtractor\MetadataExtractor.net45.csproj">
5151
<Project>{26E27564-A74F-423B-A986-E979988F259D}</Project>
52-
<Name>MetadataExtractor</Name>
52+
<Name>MetadataExtractor.net45</Name>
5353
</ProjectReference>
5454
</ItemGroup>
5555
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

MetadataExtractor.sln

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2015
3+
# Visual Studio 14
44
VisualStudioVersion = 14.0.23107.0
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetadataExtractor", "MetadataExtractor\MetadataExtractor.csproj", "{26E27564-A74F-423B-A986-E979988F259D}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetadataExtractor.net45", "MetadataExtractor\MetadataExtractor.net45.csproj", "{26E27564-A74F-423B-A986-E979988F259D}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetadataExtractor.Tests", "MetadataExtractor.Tests\MetadataExtractor.Tests.csproj", "{07AFC815-EDBB-4CF8-B555-86B6CADE7D0F}"
99
EndProject
@@ -18,6 +18,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetadataExtractor.Tools.Fil
1818
EndProject
1919
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetadataExtractor.Tools.JpegSegmentExtractor", "MetadataExtractor.Tools.JpegSegmentExtractor\MetadataExtractor.Tools.JpegSegmentExtractor.csproj", "{B7BED0C7-F73D-4F58-AE3D-A9131405D62B}"
2020
EndProject
21+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MetadataExtractor.net35", "MetadataExtractor\MetadataExtractor.net35.csproj", "{D09E58A4-9758-4BEA-9981-1BDE7CE4D2FB}"
22+
EndProject
2123
Global
2224
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2325
Debug|Any CPU = Debug|Any CPU
@@ -40,6 +42,10 @@ Global
4042
{B7BED0C7-F73D-4F58-AE3D-A9131405D62B}.Debug|Any CPU.Build.0 = Debug|Any CPU
4143
{B7BED0C7-F73D-4F58-AE3D-A9131405D62B}.Release|Any CPU.ActiveCfg = Release|Any CPU
4244
{B7BED0C7-F73D-4F58-AE3D-A9131405D62B}.Release|Any CPU.Build.0 = Release|Any CPU
45+
{D09E58A4-9758-4BEA-9981-1BDE7CE4D2FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46+
{D09E58A4-9758-4BEA-9981-1BDE7CE4D2FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{D09E58A4-9758-4BEA-9981-1BDE7CE4D2FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
48+
{D09E58A4-9758-4BEA-9981-1BDE7CE4D2FB}.Release|Any CPU.Build.0 = Release|Any CPU
4349
EndGlobalSection
4450
GlobalSection(SolutionProperties) = preSolution
4551
HideSolutionNode = FALSE

MetadataExtractor/Directory.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ public abstract class Directory
7272
/// <summary>Returns all <see cref="Tag"/> objects that have been set in this <see cref="Directory"/>.</summary>
7373
/// <value>The list of <see cref="Tag"/> objects.</value>
7474
[NotNull]
75-
public IReadOnlyList<Tag> Tags => _definedTagList;
75+
public
76+
#if NET35
77+
IEnumerable<Tag>
78+
#else
79+
IReadOnlyList<Tag>
80+
#endif
81+
Tags => _definedTagList;
7682

7783
/// <summary>Returns the number of tags set in this Directory.</summary>
7884
/// <value>the number of tags set in this Directory</value>
@@ -102,7 +108,13 @@ public void SetDescriptor([NotNull] ITagDescriptor descriptor)
102108
/// <summary>Used to iterate over any error messages contained in this directory.</summary>
103109
/// <value>The collection of error message strings.</value>
104110
[NotNull]
105-
public IReadOnlyCollection<string> Errors => _errorList;
111+
public
112+
#if NET35
113+
IEnumerable<string>
114+
#else
115+
IReadOnlyList<string>
116+
#endif
117+
Errors => _errorList;
106118

107119
#endregion
108120

MetadataExtractor/Formats/Adobe/AdobeJpegReader.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,20 @@ public IEnumerable<JpegSegmentType> GetSegmentTypes()
4444
yield return JpegSegmentType.AppE;
4545
}
4646

47-
public IReadOnlyList<Directory> ReadJpegSegments(IEnumerable<byte[]> segments, JpegSegmentType segmentType)
47+
public
48+
#if NET35
49+
IList<Directory>
50+
#else
51+
IReadOnlyList<Directory>
52+
#endif
53+
ReadJpegSegments(IEnumerable<byte[]> segments, JpegSegmentType segmentType)
4854
{
4955
return segments
5056
.Where(segment => segment.Length == 12 && Preamble.Equals(Encoding.ASCII.GetString(segment, 0, Preamble.Length), StringComparison.OrdinalIgnoreCase))
5157
.Select(bytes => Extract(new SequentialByteArrayReader(bytes)))
58+
#if NET35
59+
.Cast<Directory>()
60+
#endif
5261
.ToList();
5362
}
5463

MetadataExtractor/Formats/Bmp/BmpMetadataReader.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ public static class BmpMetadataReader
3636
{
3737
/// <exception cref="System.IO.IOException"/>
3838
[NotNull]
39-
public static IReadOnlyList<Directory> ReadMetadata([NotNull] string filePath)
39+
public static
40+
#if NET35
41+
IList<Directory>
42+
#else
43+
IReadOnlyList<Directory>
44+
#endif
45+
ReadMetadata([NotNull] string filePath)
4046
{
4147
var directories = new List<Directory>(2);
4248

MetadataExtractor/Formats/Exif/ExifReader.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ public IEnumerable<JpegSegmentType> GetSegmentTypes()
5252
yield return JpegSegmentType.App1;
5353
}
5454

55-
public IReadOnlyList<Directory> ReadJpegSegments(IEnumerable<byte[]> segments, JpegSegmentType segmentType)
55+
public
56+
#if NET35
57+
IList<Directory>
58+
#else
59+
IReadOnlyList<Directory>
60+
#endif
61+
ReadJpegSegments(IEnumerable<byte[]> segments, JpegSegmentType segmentType)
5662
{
5763
Debug.Assert(segmentType == JpegSegmentType.App1);
5864

@@ -65,7 +71,13 @@ public IReadOnlyList<Directory> ReadJpegSegments(IEnumerable<byte[]> segments, J
6571
/// <summary>
6672
/// Reads TIFF formatted Exif data a specified offset within a <see cref="IndexedReader"/>.
6773
/// </summary>
68-
public IReadOnlyList<Directory> Extract(IndexedReader reader, int readerOffset = 0)
74+
public
75+
#if NET35
76+
IList<Directory>
77+
#else
78+
IReadOnlyList<Directory>
79+
#endif
80+
Extract(IndexedReader reader, int readerOffset = 0)
6981
{
7082
var directories = new List<Directory>();
7183

MetadataExtractor/Formats/Exif/makernotes/PanasonicMakernoteDescriptor.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,9 +506,13 @@ private static string BuildFacesDescription([CanBeNull] IEnumerable<Face> faces)
506506
return null;
507507

508508
var description = string.Join(Environment.NewLine,
509-
faces.Select((f, i) => $"Face {i + 1}: {f}"));
509+
faces.Select((f, i) => $"Face {i + 1}: {f}")
510+
#if NET35
511+
.ToArray()
512+
#endif
513+
);
510514

511-
return string.IsNullOrWhiteSpace(description) ? null : description;
515+
return description.Length == 0 ? null : description;
512516
}
513517

514518
private static readonly string[] _sceneModes =

0 commit comments

Comments
 (0)