Skip to content

Commit

Permalink
Enjoy people
Browse files Browse the repository at this point in the history
Works great.
  • Loading branch information
mahowa committed Apr 12, 2016
1 parent e7099cb commit f13003a
Show file tree
Hide file tree
Showing 36 changed files with 7,209 additions and 0 deletions.
Binary file added .vs/ImageEnlarger/v14/.suo
Binary file not shown.
22 changes: 22 additions & 0 deletions ImageEnlarger.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageEnlarger", "ImageEnlarger\ImageEnlarger.csproj", "{77D1D2B3-367E-421D-BA6C-13EB826AA747}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{77D1D2B3-367E-421D-BA6C-13EB826AA747}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{77D1D2B3-367E-421D-BA6C-13EB826AA747}.Debug|Any CPU.Build.0 = Debug|Any CPU
{77D1D2B3-367E-421D-BA6C-13EB826AA747}.Release|Any CPU.ActiveCfg = Release|Any CPU
{77D1D2B3-367E-421D-BA6C-13EB826AA747}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions ImageEnlarger/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
63 changes: 63 additions & 0 deletions ImageEnlarger/ImageEnlarger.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" 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>{77D1D2B3-367E-421D-BA6C-13EB826AA747}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ImageEnlarger</RootNamespace>
<AssemblyName>ImageEnlarger</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</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.Drawing" />
<Reference Include="System.Windows.Forms" />
<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" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
98 changes: 98 additions & 0 deletions ImageEnlarger/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;

namespace ImageEnlarger
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the full file path of your Eclipse configuration file:\n");
var dir = @Console.ReadLine();
var ext = new List<string> { ".jpg", ".gif", ".png" };
var myFiles = Directory.GetFiles(dir, "*.*", SearchOption.AllDirectories)
.Where(s => ext.Any(e => s.EndsWith(e))).ToList<string>();

int height, width;
try {
Console.WriteLine("Enter Resize Height\t");
height = int.Parse(Console.ReadLine());
Console.WriteLine("Enter Resize Width\t");
width = int.Parse(Console.ReadLine());
}
catch
{
Console.WriteLine("You must enter a valid integer for Height and Width");
Console.ReadLine();
return;
}
int count = 1;
List<string> missed = new List<string>();
foreach (string file in myFiles)
{
Console.Clear();
Console.Write((((double)count++ / (double)myFiles.Count())*100).ToString("##.##") + "%");
try
{
using (FileStream bitmapFile = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
Image loaded = new Bitmap(bitmapFile);
Bitmap b = ResizeImage(loaded, height, width);
b.Save("temp");
}

File.Delete(file);

using (Image i = Bitmap.FromFile("temp"))
{
i.Save(file);
}

File.Delete("temp");
}
catch { missed.Add(file); }
}
Console.WriteLine("\nError resizing:\n");
Console.WriteLine(string.Join("\n", missed));
Console.ReadLine();
}
/// <summary>
/// Resize the image to the specified width and height.
/// </summary>
/// <param name="image">The image to resize.</param>
/// <param name="width">The width to resize to.</param>
/// <param name="height">The height to resize to.</param>
/// <returns>The resized image.</returns>
public static Bitmap ResizeImage(Image image, int width, int height)
{
var destRect = new Rectangle(0, 0, width, height);
var destImage = new Bitmap(width, height);

destImage.SetResolution(image.HorizontalResolution, image.VerticalResolution);

using (var graphics = Graphics.FromImage(destImage))
{
graphics.CompositingMode = CompositingMode.SourceCopy;
graphics.CompositingQuality = CompositingQuality.HighQuality;
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
graphics.SmoothingMode = SmoothingMode.HighQuality;
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;

using (var wrapMode = new ImageAttributes())
{
wrapMode.SetWrapMode(WrapMode.TileFlipXY);
graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, wrapMode);
}
}

return destImage;
}
}
}
36 changes: 36 additions & 0 deletions ImageEnlarger/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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("ImageEnlarger")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ImageEnlarger")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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("77d1d2b3-367e-421d-ba6c-13eb826aa747")]

// 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")]
Binary file added ImageEnlarger/bin/Debug/ImageEnlarger.exe
Binary file not shown.
6 changes: 6 additions & 0 deletions ImageEnlarger/bin/Debug/ImageEnlarger.exe.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Binary file added ImageEnlarger/bin/Debug/ImageEnlarger.pdb
Binary file not shown.
Binary file added ImageEnlarger/bin/Debug/ImageEnlarger.vshost.exe
Binary file not shown.
6 changes: 6 additions & 0 deletions ImageEnlarger/bin/Debug/ImageEnlarger.vshost.exe.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
11 changes: 11 additions & 0 deletions ImageEnlarger/bin/Debug/ImageEnlarger.vshost.exe.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
c:\users\mahowa\documents\visual studio 2015\Projects\ImageEnlarger\ImageEnlarger\bin\Debug\ImageEnlarger.exe.config
c:\users\mahowa\documents\visual studio 2015\Projects\ImageEnlarger\ImageEnlarger\obj\Debug\ImageEnlarger.csprojResolveAssemblyReference.cache
c:\users\mahowa\documents\visual studio 2015\Projects\ImageEnlarger\ImageEnlarger\bin\Debug\ImageEnlarger.exe
c:\users\mahowa\documents\visual studio 2015\Projects\ImageEnlarger\ImageEnlarger\bin\Debug\ImageEnlarger.pdb
c:\users\mahowa\documents\visual studio 2015\Projects\ImageEnlarger\ImageEnlarger\obj\Debug\ImageEnlarger.exe
c:\users\mahowa\documents\visual studio 2015\Projects\ImageEnlarger\ImageEnlarger\obj\Debug\ImageEnlarger.pdb
C:\Users\mahowa\Documents\Visual Studio 2015\Projects\ImageEnlarger\ImageUpscaler\ImageEnlarger\bin\Debug\ImageEnlarger.exe.config
C:\Users\mahowa\Documents\Visual Studio 2015\Projects\ImageEnlarger\ImageUpscaler\ImageEnlarger\obj\Debug\ImageEnlarger.exe
C:\Users\mahowa\Documents\Visual Studio 2015\Projects\ImageEnlarger\ImageUpscaler\ImageEnlarger\obj\Debug\ImageEnlarger.pdb
Binary file not shown.
Binary file added ImageEnlarger/obj/Debug/ImageEnlarger.exe
Binary file not shown.
Binary file added ImageEnlarger/obj/Debug/ImageEnlarger.pdb
Binary file not shown.
Empty file.
Empty file.
Empty file.
8 changes: 8 additions & 0 deletions ImageEnlarger/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ImageResizer" version="4.0.5" targetFramework="net452" />
<package id="ImageResizer.MvcWebConfig" version="4.0.5" targetFramework="net452" />
<package id="ImageResizer.Plugins.DiskCache" version="4.0.5" targetFramework="net452" />
<package id="ImageResizer.Plugins.PrettyGifs" version="4.0.5" targetFramework="net452" />
<package id="ImageResizer.WebConfig" version="4.0.5" targetFramework="net452" />
</packages>
Binary file not shown.
Loading

0 comments on commit f13003a

Please sign in to comment.