rawfilewizard

git clone https://git.clttr.info/rawfilewizard.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 9aaadfb2b220382bec43765a0983f8068de15e1d
parent 9ef2eeef13ed4dcfaed4265e489185269ec90d09
Author: rwa <apollo@rw-net.de>
Date:   Mon, 15 Oct 2018 18:52:42 +0200

new tool "JpegDivider"

divide jpegs from rawfiles by moving them to the subfolder JPEG

Diffstat:
AJpegDivider/App.config | 7+++++++
AJpegDivider/JpegDivider.csproj | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
AJpegDivider/JpegDivider.csproj.user | 8++++++++
AJpegDivider/Program.cs | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AJpegDivider/Properties/AssemblyInfo.cs | 36++++++++++++++++++++++++++++++++++++
MSilkypixFileMover.sln | 6++++++
MSilkypixFileMover/SilkypixFileMover.csproj | 2+-
7 files changed, 192 insertions(+), 1 deletion(-)

diff --git a/JpegDivider/App.config b/JpegDivider/App.config @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> + </startup> +</configuration> +\ No newline at end of file diff --git a/JpegDivider/JpegDivider.csproj b/JpegDivider/JpegDivider.csproj @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{6F7D666B-F570-4C69-877C-2A5E5168D9CF}</ProjectGuid> + <OutputType>Exe</OutputType> + <RootNamespace>JpegDivider</RootNamespace> + <AssemblyName>JpegDivider</AssemblyName> + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <Deterministic>true</Deterministic> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project> +\ No newline at end of file diff --git a/JpegDivider/JpegDivider.csproj.user b/JpegDivider/JpegDivider.csproj.user @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> + <StartArguments>/%3f</StartArguments> + <StartWorkingDirectory>C:\Users\winuser\Pictures</StartWorkingDirectory> + </PropertyGroup> +</Project> +\ No newline at end of file diff --git a/JpegDivider/Program.cs b/JpegDivider/Program.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace JpegDivider +{ + class Program + { + static void Main(string[] args) + { + if (args.Length > 1) + { + Console.WriteLine("Leave args blank or give exactly one dir!"); + } + + if (args[0].Equals("help") || args[0].Equals("/h") || args[0].Equals("/?")) + { + showHelp(); + return; + } + + string dir; + if (args.Length > 0 && Directory.Exists(args[0])) + { + dir = args[0]; + } + else + { + dir = Directory.GetCurrentDirectory(); + } + + Console.WriteLine($"working dir: {dir}"); + + // create + string sepDir = Path.Combine(dir, "JPEG"); + if (!Directory.Exists(sepDir)) + { + Directory.CreateDirectory(sepDir); + } + + // find jpg files in args or current folder + List<string> files = Directory.GetFiles(dir, "*.jpg", SearchOption.TopDirectoryOnly).ToList<string>(); + files.AddRange(Directory.GetFiles(dir, "*.jpeg", SearchOption.TopDirectoryOnly).ToList<string>()); + + Console.WriteLine($"Found {files.Count} files."); + foreach (string file in files) + { + Console.Write($"moving file {Path.GetFileName(file)}..."); + try + { + File.Move(file, Path.Combine(sepDir, Path.GetFileName(file))); + Console.WriteLine("done."); + } + catch + { + Console.WriteLine("failed!"); + } + } + + Console.WriteLine("Finished."); + + Console.ReadKey(); + } + + private static void showHelp() + { + Console.WriteLine($"{Assembly.GetExecutingAssembly().GetName().Name} - Version {Assembly.GetExecutingAssembly().GetName().Version}"); + Console.WriteLine("divide jpegs from raw files by moving them to subfolder JPEG"); + Console.WriteLine(""); + Console.WriteLine("Commandline:"); + Console.WriteLine("jpegdivider.exe - move jpegs from current working dir to subfolder"); + Console.WriteLine("jpgedivider.exe <path_to_folder> - move jpegs from specified folder to subfolder"); + Console.WriteLine("jpgedivider.exe /h|/?|help - show this help"); + } + } +} diff --git a/JpegDivider/Properties/AssemblyInfo.cs b/JpegDivider/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("JpegDivider")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("JpegDivider")] +[assembly: AssemblyCopyright("Copyright © René Wagner 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("6f7d666b-f570-4c69-877c-2a5e5168d9cf")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SilkypixFileMover.sln b/SilkypixFileMover.sln @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilkypixFileMover", "Silkyp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OldSilkypixFileCleaner", "OldSilkypixFileCleaner\OldSilkypixFileCleaner.csproj", "{CD88930D-2D8B-43F1-9C80-9BD45792265D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JpegDivider", "JpegDivider\JpegDivider.csproj", "{6F7D666B-F570-4C69-877C-2A5E5168D9CF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,10 @@ Global {CD88930D-2D8B-43F1-9C80-9BD45792265D}.Debug|Any CPU.Build.0 = Debug|Any CPU {CD88930D-2D8B-43F1-9C80-9BD45792265D}.Release|Any CPU.ActiveCfg = Release|Any CPU {CD88930D-2D8B-43F1-9C80-9BD45792265D}.Release|Any CPU.Build.0 = Release|Any CPU + {6F7D666B-F570-4C69-877C-2A5E5168D9CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6F7D666B-F570-4C69-877C-2A5E5168D9CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6F7D666B-F570-4C69-877C-2A5E5168D9CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6F7D666B-F570-4C69-877C-2A5E5168D9CF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SilkypixFileMover/SilkypixFileMover.csproj b/SilkypixFileMover/SilkypixFileMover.csproj @@ -39,7 +39,7 @@ <CreateWebPageOnPublish>true</CreateWebPageOnPublish> <WebPage>index.htm</WebPage> <OpenBrowserOnPublish>false</OpenBrowserOnPublish> - <ApplicationRevision>1</ApplicationRevision> + <ApplicationRevision>2</ApplicationRevision> <ApplicationVersion>1.6.1.%2a</ApplicationVersion> <UseApplicationTrust>false</UseApplicationTrust> <CreateDesktopShortcut>true</CreateDesktopShortcut>