Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Correction in VS solution(unable to compile from source) and invalid error handling in NonContainer.StarTag.ReadTag #10

Open
wants to merge 2 commits into from

2 participants

@jakubfijalkowski

VisualStudio was unable to compile TagLib# from source from GitHub(missing files, invalid configuration) so I decided to update it to fit my requirements(prepared AssemblyInfo.cs, link to snk in root directory). I'm not good in autoconf/make stuff, but I hope I didn't break anything.
Additionally, I removed reference to ICSharpCode.SharpZipLib from project and HAVE_SHARPZIPLIB constant from Debug compilation.
Tests project was untouched(only conversion).

NonContainer.StartTag.ReadTag was logging errors to console instead of throwing exceptions. Now it behave correctly.

jakubfijalkowski added some commits
@jakubfijalkowski jakubfijalkowski Updated .gitignore to ignore Visual Studio files(user, suo, pdb, obj …
…folder) and not ignore src/AssemblyInfo.cs.

Solution and project files updated to VS10 and .NET 3.5.
src/AssemblyInfo.cs added(compilation problems in VS).
taglib-sharp project links to snk file in root directory, not to src.
669ba53
@jakubfijalkowski jakubfijalkowski StartTag.ReadTag thorws exception instead of writing info to console. f62da57
@alexkay

What is the reason you want the exception?

For the Windows-related changes, I will check it a bit later when I get access to a windows box.

@jakubfijalkowski

Because when tag is corrupted, user wants to know that. Logging error to console doesn't help, especially in GUI programs, only makes things harder to recognize. And this was the only place where lib was logging errors to console, not throwing exceptions.

@alexkay

Thank you, it makes sense, I committed the patch. The exceptions are now caught on the TagLib.File level, you can use File.CorruptionReasons and File.PossiblyCorrupt to analyse them.

I'm keeping this request open until the Windows-related changes are checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 23, 2012
  1. @jakubfijalkowski

    Updated .gitignore to ignore Visual Studio files(user, suo, pdb, obj …

    jakubfijalkowski authored
    …folder) and not ignore src/AssemblyInfo.cs.
    
    Solution and project files updated to VS10 and .NET 3.5.
    src/AssemblyInfo.cs added(compilation problems in VS).
    taglib-sharp project links to snk file in root directory, not to src.
  2. @jakubfijalkowski
This page is out of date. Refresh to see the latest.
View
5 .gitignore
@@ -13,7 +13,6 @@ configure
*.config
install-sh
missing
-src/AssemblyInfo.cs
*.pc
*.zip
tests/samples/tmp*
@@ -29,3 +28,7 @@ tests/*.dll
tests/*.xml
test-results
.*.swp
+[oO]bj
+*.user
+*.pdb
+*.suo
View
35 src/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+//
+// AssemblyInfo.cs.in: Contains flags to use for the assembly.
+//
+// Author:
+// Brian Nickel (brian.nickel@gmail.com)
+//
+// Copyright (C) 2006-2007 Brian Nickel
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License version
+// 2.1 as published by the Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly:AssemblyVersion("2.0.4.0")]
+[assembly:AssemblyTitle ("TagLib#")]
+[assembly:AssemblyDescription ("A library for reading and writing audio metatags.")]
+[assembly:AssemblyCopyright ("Copyright (c) 2006-2007 Brian Nickel. Copyright (c) 2009-2010 Other contributors")]
+[assembly:AssemblyCompany ("")]
+[assembly:AssemblyDelaySign(false)]
+[assembly:CLSCompliant(false)]
View
1  src/AssemblyInfo.cs.in
@@ -32,5 +32,4 @@ using System.Runtime.InteropServices;
[assembly:AssemblyCopyright ("Copyright (c) 2006-2007 Brian Nickel. Copyright (c) 2009-2010 Other contributors")]
[assembly:AssemblyCompany ("")]
[assembly:AssemblyDelaySign(false)]
-[assembly:AssemblyKeyFile("taglib-sharp.snk")]
[assembly:CLSCompliant(false)]
View
22 src/TagLib/NonContainer/StartTag.cs
@@ -264,19 +264,15 @@ private TagLib.Tag ReadTag (ref long start)
long end = start;
TagTypes type = ReadTagInfo (ref end);
TagLib.Tag tag = null;
-
- try {
- switch (type)
- {
- case TagTypes.Ape:
- tag = new TagLib.Ape.Tag (file, start);
- break;
- case TagTypes.Id3v2:
- tag = new TagLib.Id3v2.Tag (file, start);
- break;
- }
- } catch (CorruptFileException e) {
- Console.Error.WriteLine ("taglib-sharp caught exception creating tag: {0}", e);
+
+ switch (type)
+ {
+ case TagTypes.Ape:
+ tag = new TagLib.Ape.Tag (file, start);
+ break;
+ case TagTypes.Id3v2:
+ tag = new TagLib.Id3v2.Tag (file, start);
+ break;
}
start = end;
View
57 src/taglib-sharp.csproj
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -8,10 +8,30 @@
<ProjectGuid>{6B143A39-C7B2-4743-9917-92262C60E9A6}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>TagLib</RootNamespace>
- <ApplicationIcon>.</ApplicationIcon>
+ <ApplicationIcon>
+ </ApplicationIcon>
<AssemblyName>taglib-sharp</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<ReleaseVersion>2.0.4.0</ReleaseVersion>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <UpgradeBackupLocation />
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -26,7 +46,8 @@
<Execution>
<Execution clr-version="Net_2_0" />
</Execution>
- <DefineConstants>HAVE_SHARPZIPLIB</DefineConstants>
+ <DefineConstants>
+ </DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
@@ -270,24 +291,34 @@
<Compile Include="TagLib\Xmp\XmpTag.cs" />
</ItemGroup>
<ItemGroup>
- <Folder Include="TagLib\NonContainer\" />
- <Folder Include="TagLib\Ogg\Codecs\" />
- <Folder Include="TagLib\Riff\" />
- <Folder Include="TagLib\Id3v2\" />
- <Folder Include="TagLib\Mpeg4\" />
- <Folder Include="TagLib\Ogg\" />
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
- <Reference Include="ICSharpCode.SharpZipLib" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
+ <None Include="..\taglib-sharp.snk">
+ <Link>taglib-sharp.snk</Link>
+ </None>
<None Include="AssemblyInfo.cs.in" />
<None Include="policy.2.0.taglib-sharp.config.in" />
- <None Include="taglib-sharp.snk" />
<None Include="TagLib\TagLib.sources" />
</ItemGroup>
-</Project>
+</Project>
View
53 taglib-sharp.sln
@@ -1,9 +1,9 @@

-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "taglib-sharp", "src\taglib-sharp.csproj", "{6B143A39-C7B2-4743-9917-92262C60E9A6}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests\tests.csproj", "{4D1C6110-D6F2-496E-BD7E-E45B7217D458}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests\tests.csproj", "{4D1C6110-D6F2-496E-BD7E-E45B7217D458}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,27 +11,30 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6B143A39-C7B2-4743-9917-92262C60E9A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6B143A39-C7B2-4743-9917-92262C60E9A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6B143A39-C7B2-4743-9917-92262C60E9A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6B143A39-C7B2-4743-9917-92262C60E9A6}.Release|Any CPU.Build.0 = Release|Any CPU
- {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6B143A39-C7B2-4743-9917-92262C60E9A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6B143A39-C7B2-4743-9917-92262C60E9A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6B143A39-C7B2-4743-9917-92262C60E9A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6B143A39-C7B2-4743-9917-92262C60E9A6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4D1C6110-D6F2-496E-BD7E-E45B7217D458}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
- StartupItem = tests\tests.csproj
- Policies = $0
- $0.TextStylePolicy = $1
- $1.inheritsSet = null
- $1.scope = application/x-mdp
- $0.StandardHeader = $2
- $2.inheritsSet = LGPLv2License
- $0.DotNetNamingPolicy = $3
- $3.DirectoryNamespaceAssociation = None
- $3.ResourceNamePolicy = FileFormatDefault
- version = 2.0.4.0
- outputpath = build
- EndGlobalSection
-EndGlobal
+ StartupItem = tests\tests.csproj
+ Policies = $0
+ $0.TextStylePolicy = $1
+ $1.inheritsSet = null
+ $1.scope = application/x-mdp
+ $0.StandardHeader = $2
+ $2.inheritsSet = LGPLv2License
+ $0.DotNetNamingPolicy = $3
+ $3.DirectoryNamespaceAssociation = None
+ $3.ResourceNamePolicy = FileFormatDefault
+ version = 2.0.4.0
+ outputpath = build
+ EndGlobalSection
+EndGlobal
View
13 tests/tests.csproj
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,6 +10,11 @@
<RootNamespace>tests</RootNamespace>
<AssemblyName>tests</AssemblyName>
<ReleaseVersion>2.0.3.5</ReleaseVersion>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>2.0</OldToolsVersion>
+ <UpgradeBackupLocation />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -50,7 +55,7 @@
<Compile Include="fixtures\TagLib.Tests.FileFormats\IFormatTest.cs" />
<Compile Include="fixtures\TagLib.Tests.FileFormats\JpegFormatTest.cs" />
<Compile Include="fixtures\TagLib.Tests.FileFormats\M4aFormatTest.cs" />
- <Compile Include="fixtures\TagLib.Tests.FileFormats\M4vFormatTest.cs" />
+ <Compile Include="fixtures\TagLib.Tests.FileFormats\M4vFormatTest.cs" />
<Compile Include="fixtures\TagLib.Tests.FileFormats\MpcFormatTest.cs" />
<Compile Include="fixtures\TagLib.Tests.FileFormats\OggFormatTest.cs" />
<Compile Include="fixtures\TagLib.Tests.FileFormats\StandardTests.cs" />
@@ -118,4 +123,4 @@
<Private>False</Private>
</ProjectReference>
</ItemGroup>
-</Project>
+</Project>
Something went wrong with that request. Please try again.