Skip to content

Commit

Permalink
Added cover art resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
Otiel committed Apr 15, 2014
1 parent f08bbbf commit 1c94b01
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 155 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,34 @@ Features
* From album pages: http://[artist].bandcamp.com/album/[album],
* From artist pages: http://[artist].bandcamp.com.
* Adds ID3 tags to tracks: Album, Artist, Album Artist, Title, Track number and Year.
* Downloads cover art and save it in tracks tags.
* Downloads cover art and:
* Convert cover art to jpg,
* Resize cover art,
* Save cover art in tracks tags.

Usage
-----

1. [Download](https://github.com/Otiel/BandcampDownloader/releases/latest) the latest version from the releases page as a zip file.
2. Make sure the following files are located in the same folder:
* `BandcampDownloader.exe`,
* `ImageResizer.dll`,
* `Newtonsoft.Json.dll`,
* `taglib-sharp.dll`.
3. Run `BandcampDownloader.exe`.

Screenshot
----------

![Screenshot](http://i.imgur.com/sBCKZTg.png)
![Screenshot](http://i.imgur.com/s8RYXJi.png)

Dependencies
------------

_BandcampDownloader_ uses:
* [Json.NET](http://james.newtonking.com/json) to deserialize JSON data from the Bandcamp pages.
* [TagLibSharp](https://github.com/mono/taglib-sharp) to tag tracks.
* [ImageResizer](http://imageresizing.net/) to convert/resize covert arts.

Bugs/Ideas
----------
Expand Down
9 changes: 7 additions & 2 deletions Sources/BandcampDownloader/BandcampDownloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<RootNamespace>BandcampDownloader</RootNamespace>
<AssemblyName>BandcampDownloader</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
Expand Down Expand Up @@ -74,6 +75,9 @@
<ApplicationIcon>Resources\Cloud.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="ImageResizer">
<HintPath>..\packages\ImageResizer.3.4.2\lib\ImageResizer.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.6.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -113,7 +117,7 @@
<Compile Include="Business Objects\JSON\JsonMp3File.cs" />
<Compile Include="Business Objects\Track.cs" />
<Compile Include="Miscellaneous\Constants.cs" />
<Compile Include="Helpers\Extensions.cs" />
<Compile Include="Miscellaneous\Extensions.cs" />
<Compile Include="Helpers\FileHelper.cs" />
<Compile Include="Windows\MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
Expand All @@ -139,6 +143,7 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down
4 changes: 2 additions & 2 deletions Sources/BandcampDownloader/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.2.4")]
[assembly: AssemblyFileVersion("0.1.2.4")]
[assembly: AssemblyVersion("0.1.3.0")]
[assembly: AssemblyFileVersion("0.1.3.0")]
[assembly: GuidAttribute("8C171C7F-9BAC-4EC0-A287-59908B48953F")]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Sources/BandcampDownloader/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 19 additions & 14 deletions Sources/BandcampDownloader/Windows/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Bandcamp Downloader"
Height="470" Width="785"
Height="485" Width="785"
MinWidth="785" MinHeight="400"
WindowStyle="SingleBorderWindow" WindowStartupLocation="CenterScreen"
Icon="pack://application:,,,/Resources/Cloud.ico"
Expand All @@ -11,28 +11,33 @@
<TaskbarItemInfo />
</Window.TaskbarItemInfo>
<Grid>
<RichTextBox Margin="12,255,12,21" Name="richTextBoxLog" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" IsReadOnly="True" IsTabStop="False">
<RichTextBox Margin="12,272,12,21" Name="richTextBoxLog" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" IsReadOnly="True" IsTabStop="False">
<RichTextBox.Resources>
<Style TargetType="{x:Type Paragraph}">
<Setter Property="Margin" Value="0" />
</Style>
</RichTextBox.Resources>
</RichTextBox>
<TextBox Margin="12,12,12,0" Name="textBoxUrls" AcceptsReturn="True" Height="111" VerticalAlignment="Top" Text="" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" GotFocus="textBoxUrls_GotFocus" LostFocus="textBoxUrls_LostFocus" TabIndex="0" />
<ProgressBar Margin="12,217,12,0" Name="progressBar" Height="15" VerticalAlignment="Top" IsTabStop="False" />
<Button Content="Start download" Height="23" Margin="242,188,300,0" Name="buttonStart" VerticalAlignment="Top" HorizontalAlignment="Center" Click="buttonStart_Click" HorizontalContentAlignment="Center" Width="103" TabIndex="8" />
<Button Content="Cancel" Height="23" HorizontalAlignment="Center" HorizontalContentAlignment="Center" Margin="419,188,289,0" Name="buttonStop" VerticalAlignment="Top" Visibility="Visible" Click="buttonStop_Click" Width="55" IsEnabled="False" TabIndex="9" />
<Label Content="About" Margin="0,0,8,-3" Name="labelAbout" HorizontalAlignment="Right" Width="43" Height="28" VerticalAlignment="Bottom" Foreground="#FF003BFF" Cursor="Hand" MouseDown="labelAbout_MouseDown" />
<Label Height="28" Margin="0,229,10,0" Name="labelProgress" VerticalAlignment="Top" HorizontalAlignment="Right" />
<ProgressBar Margin="12,235,12,0" Name="progressBar" Height="15" VerticalAlignment="Top" IsTabStop="False" />
<Button Content="Start download" Height="23" Margin="242,206,300,0" Name="buttonStart" VerticalAlignment="Top" HorizontalAlignment="Center" Click="buttonStart_Click" HorizontalContentAlignment="Center" Width="103" TabIndex="8" />
<Button Content="Cancel" Height="23" HorizontalAlignment="Center" HorizontalContentAlignment="Center" Margin="419,206,289,0" Name="buttonStop" VerticalAlignment="Top" Visibility="Visible" Click="buttonStop_Click" Width="55" IsEnabled="False" TabIndex="9" />
<Label Content="About" Margin="0,0,8,-3" Name="labelAbout" HorizontalAlignment="Right" Width="43" Height="28" VerticalAlignment="Bottom" Foreground="#FF003BFF" Cursor="Hand" MouseDown="labelAbout_MouseDown" ToolTip="Open project website" />
<Label Height="28" Margin="0,247,10,0" Name="labelProgress" VerticalAlignment="Top" HorizontalAlignment="Right" />
<TextBox Height="23" Margin="104,129,50,0" Name="textBoxDownloadsLocation" VerticalAlignment="Top" TabIndex="1" />
<Label Content="Save albums to" Height="28" HorizontalAlignment="Left" Margin="8,127,0,0" Name="labelDownloadsLocation" VerticalAlignment="Top" />
<Button Content="..." Height="23" Margin="0,129,12,0" Name="buttonBrowse" VerticalAlignment="Top" HorizontalAlignment="Right" Width="27" Click="buttonBrowse_Click" TabIndex="2" />
<CheckBox Content="Tag tracks" Height="16" HorizontalAlignment="Left" Margin="12,161,0,0" Name="checkBoxTag" VerticalAlignment="Top" IsChecked="True" ToolTip="If checked, the album, artist, album artist, title, track number and year will be saved in the tracks tags." TabIndex="3" />
<CheckBox Content="Save cover art in tags" Height="16" HorizontalAlignment="Left" Margin="94,161,0,0" Name="checkBoxCoverArtInTags" VerticalAlignment="Top" IsChecked="False" ToolTip="If checked, the cover art will be saved in the tracks tags." TabIndex="4" />
<CheckBox Content="Save cover art in folder" Height="16" HorizontalAlignment="Left" Margin="235,161,0,0" Name="checkBoxCoverArtInFolder" VerticalAlignment="Top" ToolTip="If checked, the cover art will be downloaded in the albums folder." IsChecked="True" TabIndex="5" />
<CheckBox Content="Download one album at a time" Height="16" Margin="385,161,0,0" Name="checkBoxOneAlbumAtATime" VerticalAlignment="Top" IsEnabled="True" ToolTip="If checked, only one album at a time will be downloaded.&#x0a;If unchecked, all albums will be downloaded at the same time (preferred if you have a high bandwidth)." TabIndex="6" HorizontalAlignment="Left" Width="181" />
<Label Height="28" HorizontalAlignment="Left" Margin="9,229,0,0" Name="labelDownloadSpeed" VerticalAlignment="Top" />
<CheckBox Content="Force download of all albums" Height="16" HorizontalAlignment="Left" IsEnabled="True" Margin="577,161,0,0" Name="checkBoxForceAlbumsDownload" ToolTip="If checked, all albums referred on the page will be downloaded.&#x0a;Check this box if you want to download all albums of an artist." VerticalAlignment="Top" TabIndex="7" />
<Label Content="v x.x.x.x" HorizontalAlignment="Left" Margin="8,0,0,-3" Name="labelVersion" Foreground="Gray" Height="28" VerticalAlignment="Bottom" />
<CheckBox Content="Tag tracks" Height="16" HorizontalAlignment="Left" Margin="12,157,0,0" Name="checkBoxTag" VerticalAlignment="Top" IsChecked="True" ToolTip="If checked, the album, artist, album artist, title, track number and year will be saved in the tracks tags." TabIndex="3" />
<CheckBox Content="Save in tags" Height="16" HorizontalAlignment="Left" Margin="75,180,0,0" Name="checkBoxCoverArtInTags" VerticalAlignment="Top" IsChecked="True" ToolTip="If checked, the cover art will be saved in the tracks tags." TabIndex="4" Checked="SaveCoverArtCheckBox_CheckedChanged" Unchecked="SaveCoverArtCheckBox_CheckedChanged" />
<CheckBox Content="Save in folder" Height="16" HorizontalAlignment="Left" Margin="175,180,0,0" Name="checkBoxCoverArtInFolder" VerticalAlignment="Top" ToolTip="If checked, the cover art will be downloaded in the albums folder." IsChecked="False" TabIndex="5" Checked="SaveCoverArtCheckBox_CheckedChanged" Unchecked="SaveCoverArtCheckBox_CheckedChanged" />
<CheckBox Content="Download one album at a time" Height="16" Margin="103,157,0,0" Name="checkBoxOneAlbumAtATime" VerticalAlignment="Top" IsEnabled="True" ToolTip="If checked, only one album at a time will be downloaded.&#x0a;If unchecked, all albums will be downloaded at the same time (preferred if you have a high bandwidth)." TabIndex="6" HorizontalAlignment="Left" Width="181" />
<Label Height="28" HorizontalAlignment="Left" Margin="9,247,0,0" Name="labelDownloadSpeed" VerticalAlignment="Top" />
<CheckBox Content="Force download of all albums" Height="16" IsEnabled="True" Margin="304,157,0,0" Name="checkBoxForceAlbumsDownload" ToolTip="If checked, all albums referred on the page will be downloaded.&#x0a;Check this box if you want to download all albums of an artist." VerticalAlignment="Top" TabIndex="7" HorizontalAlignment="Left" Width="173" />
<Label Content="v x.x.x.x" HorizontalAlignment="Left" Margin="8,0,0,-3" Name="labelVersion" Foreground="Gray" Height="28" VerticalAlignment="Bottom" ToolTip="Go to project website to check for new updates" />
<CheckBox Content="Convert to jpg" Height="16" HorizontalAlignment="Left" Margin="284,180,0,0" Name="checkBoxConvertToJpg" VerticalAlignment="Top" IsChecked="True" ToolTip="If checked, the cover art will be converted to jpg with a jpeg compression of 90 (which is an excellent tradeoff between size and perfection)." />
<CheckBox Height="16" HorizontalAlignment="Left" Margin="397,180,0,0" Name="checkBoxResizeCoverArt" VerticalAlignment="Top" Content="Constrain max width/height at" IsChecked="True" Checked="CheckBoxResizeCoverArt_CheckedChanged" Unchecked="CheckBoxResizeCoverArt_CheckedChanged" ToolTip="If checked, the cover art will be resized with the specified max width/height." />
<TextBox Height="23" HorizontalAlignment="Left" Margin="578,177,0,0" Name="textBoxCoverArtMaxSize" VerticalAlignment="Top" Width="40" Text="1000" />
<Label Content="pixels" Height="28" HorizontalAlignment="Left" Margin="616,175,0,0" Name="labelPixels" VerticalAlignment="Top" />
<Label Content="Cover art:" Height="28" HorizontalAlignment="Left" Margin="8,175,0,0" Name="labelCoverArt" VerticalAlignment="Top" />
</Grid>
</Window>
Loading

0 comments on commit 1c94b01

Please sign in to comment.