Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
66a92e6838 | |||
088637ff5d | |||
23dc2d75e0 |
@ -1,25 +1,10 @@
|
|||||||
using SixLabors.ImageSharp;
|
using SixLabors.ImageSharp;
|
||||||
using SixLabors.ImageSharp.Formats.Webp;
|
using SixLabors.ImageSharp.Formats.Webp;
|
||||||
using SixLabors.ImageSharp.Processing;
|
using SixLabors.ImageSharp.Processing;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Photomator;
|
namespace Photomator;
|
||||||
|
|
||||||
public static class Lib {
|
public static class Lib {
|
||||||
const int SW_HIDE = 0;
|
|
||||||
const int SW_SHOW = 5;
|
|
||||||
readonly static IntPtr handle = GetConsoleWindow();
|
|
||||||
[DllImport("kernel32.dll")] static extern IntPtr GetConsoleWindow();
|
|
||||||
[DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd,int nCmdShow);
|
|
||||||
|
|
||||||
public static void HideConsole() {
|
|
||||||
ShowWindow(handle,SW_HIDE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ShowConsole() {
|
|
||||||
ShowWindow(handle,SW_SHOW);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static async Task Convert(string src, string dest, ConvertOptions options) {
|
public static async Task Convert(string src, string dest, ConvertOptions options) {
|
||||||
Image img = await Image.LoadAsync(src);
|
Image img = await Image.LoadAsync(src);
|
||||||
img.Mutate(i => {
|
img.Mutate(i => {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="GirCore.Adw-1" Version="0.5.0" />
|
<PackageReference Include="GirCore.Adw-1" Version="0.5.0" />
|
||||||
<PackageReference Include="GitInfo" Version="3.3.5">
|
<PackageReference Include="GitInfo" Version="3.5.0">
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
@ -19,20 +19,27 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||||
|
<Message Text="=== Building Photomator $(GitTag)... ===" Importance="high" />
|
||||||
<RemoveDir Directories="$(PublishDir)" />
|
<RemoveDir Directories="$(PublishDir)" />
|
||||||
<Message Text="=== Compiling extra resources... ===" Importance="high"/>
|
<Message Text="=== Compiling extra resources... ===" Importance="high" />
|
||||||
<Exec Command="glib-compile-resources --sourcedir ./Resources ./Resources/de.cantorgymnasium.Photomator.gresource.xml --target=$(OutDir)/de.cantorgymnasium.Photomator.gresource" />
|
<Exec Command="glib-compile-resources --sourcedir ./Resources ./Resources/de.cantorgymnasium.Photomator.gresource.xml --target=$(OutDir)/de.cantorgymnasium.Photomator.gresource" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="CopyFiles" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)' == 'win-x64'">
|
<Target Name="CopyFiles" AfterTargets="Publish">
|
||||||
<Message Text="=== Copying Gtk files for win-x64 runtime ... ===" Importance="high"/>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<SourceFiles Include="$(PublishDir)\**\*.*" />
|
<SourceFiles Include="$(PublishDir)\**\*.*" />
|
||||||
<GtkDlls Include="libgtk-4-1.dll;libadwaita-1-0.dll;libappstream-5.dll;libbrotlicommon.dll;libbrotlidec.dll;libbz2-1.dll;libcairo-2.dll;libcairo-gobject-2.dll;libcairo-script-interpreter-2.dll;libcrypto-3-x64.dll;libcurl-4.dll;libdatrie-1.dll;libdeflate.dll;libepoxy-0.dll;libexpat-1.dll;libffi-8.dll;libfontconfig-1.dll;libfreetype-6.dll;libfribidi-0.dll;libgcc_s_seh-1.dll;libgdk_pixbuf-2.0-0.dll;libgio-2.0-0.dll;libglib-2.0-0.dll;libgmodule-2.0-0.dll;libgobject-2.0-0.dll;libgraphene-1.0-0.dll;libgraphite2.dll;libharfbuzz-0.dll;libharfbuzz-gobject-0.dll;libiconv-2.dll;libidn2-0.dll;libintl-8.dll;libjbig-0.dll;libjpeg-8.dll;libLerc.dll;liblzma-5.dll;liblzo2-2.dll;libnghttp2-14.dll;libnghttp3-9.dll;libpango-1.0-0.dll;libpangocairo-1.0-0.dll;libpangoft2-1.0-0.dll;libpangowin32-1.0-0.dll;libpcre2-8-0.dll;libpixman-1-0.dll;libpng16-16.dll;libpsl-5.dll;librsvg-2-2.dll;libsharpyuv-0.dll;libssh2-1.dll;libssl-3-x64.dll;libstdc++-6.dll;libthai-0.dll;libtiff-6.dll;libunistring-5.dll;libwebp-7.dll;libwinpthread-1.dll;libxml2-2.dll;libxmlb-2.dll;libyaml-0-2.dll;libzstd.dll;zlib1.dll;gdbus.exe"/>
|
|
||||||
<Icons Include="C:\msys64\mingw64\share\icons\**\*.*" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Move SourceFiles="@(SourceFiles)" DestinationFolder="$(PublishDir)\bin" />
|
<Move SourceFiles="@(SourceFiles)" DestinationFolder="$(PublishDir)\bin" />
|
||||||
<Copy SourceFiles="$(OutDir)/de.cantorgymnasium.Photomator.gresource" DestinationFolder="$(PublishDir)\share\de.cantorgymnasium.Photomator" />
|
<Copy SourceFiles="$(OutDir)/de.cantorgymnasium.Photomator.gresource" DestinationFolder="$(PublishDir)\share\de.cantorgymnasium.Photomator" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="CopyFilesWindows" AfterTargets="Publish" Condition="'$(RuntimeIdentifier)' == 'win-x64'">
|
||||||
|
<Message Text="=== Copying Gtk files for win-x64 runtime ... ===" Importance="high"/>
|
||||||
|
<ItemGroup>
|
||||||
|
|
||||||
|
<GtkDlls Include="libgtk-4-1.dll;libadwaita-1-0.dll;libappstream-5.dll;libbrotlicommon.dll;libbrotlidec.dll;libbz2-1.dll;libcairo-2.dll;libcairo-gobject-2.dll;libcairo-script-interpreter-2.dll;libcrypto-3-x64.dll;libcurl-4.dll;libdatrie-1.dll;libdeflate.dll;libepoxy-0.dll;libexpat-1.dll;libffi-8.dll;libfontconfig-1.dll;libfreetype-6.dll;libfribidi-0.dll;libgcc_s_seh-1.dll;libgdk_pixbuf-2.0-0.dll;libgio-2.0-0.dll;libglib-2.0-0.dll;libgmodule-2.0-0.dll;libgobject-2.0-0.dll;libgraphene-1.0-0.dll;libgraphite2.dll;libharfbuzz-0.dll;libharfbuzz-gobject-0.dll;libiconv-2.dll;libidn2-0.dll;libintl-8.dll;libjbig-0.dll;libjpeg-8.dll;libLerc.dll;liblzma-5.dll;liblzo2-2.dll;libnghttp2-14.dll;libnghttp3-9.dll;libpango-1.0-0.dll;libpangocairo-1.0-0.dll;libpangoft2-1.0-0.dll;libpangowin32-1.0-0.dll;libpcre2-8-0.dll;libpixman-1-0.dll;libpng16-16.dll;libpsl-5.dll;librsvg-2-2.dll;libsharpyuv-0.dll;libssh2-1.dll;libssl-3-x64.dll;libstdc++-6.dll;libthai-0.dll;libtiff-6.dll;libunistring-5.dll;libwebp-7.dll;libwinpthread-1.dll;libxml2-2.dll;libxmlb-2.dll;libyaml-0-2.dll;libzstd.dll;zlib1.dll;gdbus.exe"/>
|
||||||
|
<Icons Include="C:\msys64\mingw64\share\icons\**\*.*" />
|
||||||
|
</ItemGroup>
|
||||||
<Copy SourceFiles="@(GtkDlls->'C:\msys64\mingw64\bin\%(Filename)%(Extension)')" DestinationFolder="$(PublishDir)\bin" />
|
<Copy SourceFiles="@(GtkDlls->'C:\msys64\mingw64\bin\%(Filename)%(Extension)')" DestinationFolder="$(PublishDir)\bin" />
|
||||||
<Copy SourceFiles="C:\msys64\mingw64\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-svg.dll" DestinationFolder="$(PublishDir)\lib\gdk-pixbuf-2.0\2.10.0\loaders" />
|
<Copy SourceFiles="C:\msys64\mingw64\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-svg.dll" DestinationFolder="$(PublishDir)\lib\gdk-pixbuf-2.0\2.10.0\loaders" />
|
||||||
<Copy SourceFiles=".\Resources\loaders.cache" DestinationFolder="$(PublishDir)\lib\gdk-pixbuf-2.0\2.10.0" />
|
<Copy SourceFiles=".\Resources\loaders.cache" DestinationFolder="$(PublishDir)\lib\gdk-pixbuf-2.0\2.10.0" />
|
||||||
|
@ -11,7 +11,6 @@ public partial class Program {
|
|||||||
public static int Main() => new Program().Run();
|
public static int Main() => new Program().Run();
|
||||||
|
|
||||||
public Program() {
|
public Program() {
|
||||||
Lib.HideConsole();
|
|
||||||
_application = Adw.Application.New("de.cantorgymnasium.Photomator", Gio.ApplicationFlags.FlagsNone);
|
_application = Adw.Application.New("de.cantorgymnasium.Photomator", Gio.ApplicationFlags.FlagsNone);
|
||||||
Gtk.Window.SetDefaultIconName("de.cantorgymnasium.Photomator");
|
Gtk.Window.SetDefaultIconName("de.cantorgymnasium.Photomator");
|
||||||
string localPath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!) + "/de.cantorgymnasium.Photomator.gresource";
|
string localPath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!) + "/de.cantorgymnasium.Photomator.gresource";
|
||||||
|
20
README.md
20
README.md
@ -1,3 +1,23 @@
|
|||||||
# Photomator
|
# Photomator
|
||||||
|
|
||||||
Desktop-Anwendung zum Konvertieren und Schrumpfen von Bildern für die Verwendung im Web.
|
Desktop-Anwendung zum Konvertieren und Schrumpfen von Bildern für die Verwendung im Web.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
- install msys2 (mingw-w64) -> libadwaita, gtk4, libwebp
|
||||||
|
- install .NET 8.0
|
||||||
|
- install Git for Windows
|
||||||
|
- add .NET 8.0 and mingw-w64 to PATH
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
git clone https://git.cantorgymnasium.de/gcg/photomator
|
||||||
|
|
||||||
|
cd photomator/Photomator
|
||||||
|
|
||||||
|
dotnet restore
|
||||||
|
dotnet publish -r win-x64
|
||||||
|
```
|
||||||
|
|
||||||
|
The installer will be located under `Photomator\bin\Release\net8.0\win-x64\publish`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user