├── jxlgui.buildinfo
├── assets
│ ├── version
│ ├── date
│ └── commitid
├── jxlgui.buildinfo.csproj
└── BuildInfos.cs
├── jxlgui.wpf
├── Assets
│ ├── Icon.pdn
│ ├── Icon.png
│ └── Icon.ico
├── Windows
│ ├── SettingsWindow.xaml.cs
│ └── SettingsWindow.xaml
├── Messenger
│ ├── FileDroppedMessage.cs
│ └── WindowsMessage.cs
├── App.xaml
├── AssemblyInfo.cs
├── Converter
│ ├── VisibilityNullConverter.cs
│ ├── VisibilityInverterConverter.cs
│ ├── VisibilityStringAnyConverter.cs
│ └── JobStatusBrushConverter.cs
├── App.xaml.cs
├── Properties
│ └── PublishProfiles
│ │ └── Portable.pubxml
├── jxlgui.wpf.csproj
├── Views
│ ├── MainWindow.xaml.cs
│ └── MainWindow.xaml
└── ViewModels
│ ├── SettingsViewModel.cs
│ └── MainViewModel.cs
├── jxlgui.converter
├── assets
│ ├── cjxl.exe
│ ├── djxl.exe
│ ├── LICENSE.zlib
│ ├── LICENSE.brotli
│ ├── LICENSE.giflib
│ ├── LICENSE
│ ├── LICENSE.libjxl
│ ├── LICENSE.libwebp
│ ├── LICENSE.skcms
│ ├── LICENSE.libjpeg-turbo
│ ├── LICENSE.libpng
│ ├── LICENSE.highway
│ └── LICENSE.sjpeg
├── jxlgui.converter.csproj
├── Constants.cs
├── Config.cs
├── ExternalJxlResourceHandler.cs
└── JobManager.cs
├── .gitattributes
├── .idea
└── .idea.jxlgui
│ └── .idea
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── indexLayout.xml
│ └── .gitignore
├── update_build_infos.ps1
├── LICENSE
├── .vscode
├── launch.json
└── tasks.json
├── .github
└── workflows
│ └── dotnet.yml
├── jxlgui.sln
├── sign_file.ps1
├── README.md
└── .gitignore
/jxlgui.buildinfo/assets/version:
--------------------------------------------------------------------------------
1 | v1.0.0
2 |
--------------------------------------------------------------------------------
/jxlgui.buildinfo/assets/date:
--------------------------------------------------------------------------------
1 | 20220219T1145111775Z
--------------------------------------------------------------------------------
/jxlgui.buildinfo/assets/commitid:
--------------------------------------------------------------------------------
1 | 0000000000000000000000000000000000000000
--------------------------------------------------------------------------------
/jxlgui.wpf/Assets/Icon.pdn:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:9c9d54a62d941c9e8536fca93d9d8f9b95b893700a80979df6bb51ea088cc42b
3 | size 10401
4 |
--------------------------------------------------------------------------------
/jxlgui.wpf/Assets/Icon.png:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:543363ef889e8fecbd80799ed356bb83ff087fdc108b145eb626f8695001d6cf
3 | size 3359
4 |
--------------------------------------------------------------------------------
/jxlgui.wpf/Assets/Icon.ico:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:690d5d9c477eb90e10c0d8b0ad9abed69c6099d6f5996d5f5296a15367ab59ec
3 | size 104063
4 |
--------------------------------------------------------------------------------
/jxlgui.converter/assets/cjxl.exe:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:480543db0d1b8e5347b949b4024bae6f70397079b02bad62d270502604f01a45
3 | size 4113920
4 |
--------------------------------------------------------------------------------
/jxlgui.converter/assets/djxl.exe:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:4d3b94b15e754614ed4caa8a41bcd52a30d7effcbdf15e1ba7bda56cda23f5fa
3 | size 4325888
4 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.exe filter=lfs diff=lfs merge=lfs -text
2 | *.pdn filter=lfs diff=lfs merge=lfs -text
3 | *.png filter=lfs diff=lfs merge=lfs -text
4 | *.ico filter=lfs diff=lfs merge=lfs -text
5 |
--------------------------------------------------------------------------------
/.idea/.idea.jxlgui/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/.idea.jxlgui/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/.idea.jxlgui/.idea/indexLayout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/jxlgui.wpf/Windows/SettingsWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace jxlgui.wpf.Windows;
4 |
5 | public partial class SettingsWindow : Window
6 | {
7 | public SettingsWindow()
8 | {
9 | InitializeComponent();
10 | }
11 | }
--------------------------------------------------------------------------------
/jxlgui.wpf/Messenger/FileDroppedMessage.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.Messaging.Messages;
2 |
3 | namespace jxlgui.wpf.Messenger;
4 |
5 | public class FileDroppedMessage : ValueChangedMessage
6 | {
7 | public FileDroppedMessage(string value) : base(value)
8 | {
9 | }
10 | }
--------------------------------------------------------------------------------
/jxlgui.wpf/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/.idea.jxlgui/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Rider ignored files
5 | /modules.xml
6 | /.idea.jxlgui.iml
7 | /projectSettingsUpdater.xml
8 | /contentModel.xml
9 | # Editor-based HTTP Client requests
10 | /httpRequests/
11 | # Datasource local storage ignored files
12 | /dataSources/
13 | /dataSources.local.xml
14 |
--------------------------------------------------------------------------------
/jxlgui.wpf/Messenger/WindowsMessage.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.Messaging.Messages;
2 |
3 | namespace jxlgui.wpf.Messenger;
4 |
5 | internal class WindowMessage : ValueChangedMessage
6 | {
7 | public WindowMessage(WindowEnum value) : base(value)
8 | {
9 | }
10 | }
11 |
12 | public enum WindowEnum
13 | {
14 | SettingsWindows,
15 | SettingsWindowsClose
16 | }
--------------------------------------------------------------------------------
/jxlgui.wpf/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | [assembly: ThemeInfo(
4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5 | //(used if a resource is not found in the page,
6 | // or application resource dictionaries)
7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8 | //(used if a resource is not found in the page,
9 | // app, or any theme specific resource dictionaries)
10 | )]
--------------------------------------------------------------------------------
/jxlgui.wpf/Converter/VisibilityNullConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 |
6 | namespace jxlgui.wpf.Converter;
7 |
8 | public class VisibilityNullConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | return value == null ? Visibility.Collapsed : Visibility.Visible;
13 | }
14 |
15 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
16 | {
17 | throw new NotImplementedException();
18 | }
19 | }
--------------------------------------------------------------------------------
/jxlgui.wpf/Converter/VisibilityInverterConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 |
6 | namespace jxlgui.wpf.Converter;
7 |
8 | public class VisibilityInverterConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | var valueBool = (bool)value;
13 | return valueBool ? Visibility.Collapsed : Visibility.Visible;
14 | }
15 |
16 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | throw new NotImplementedException();
19 | }
20 | }
--------------------------------------------------------------------------------
/jxlgui.buildinfo/jxlgui.buildinfo.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/jxlgui.wpf/Converter/VisibilityStringAnyConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 |
6 | namespace jxlgui.wpf.Converter;
7 |
8 | public class VisibilityStringAnyConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | var valueString = value as string;
13 | return string.IsNullOrEmpty(valueString) ? Visibility.Collapsed : Visibility.Visible;
14 | }
15 |
16 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | throw new NotImplementedException();
19 | }
20 | }
--------------------------------------------------------------------------------
/jxlgui.converter/jxlgui.converter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/jxlgui.wpf/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using jxlgui.wpf.Messenger;
3 | using jxlgui.wpf.Windows;
4 | using CommunityToolkit.Mvvm.Messaging;
5 |
6 | namespace jxlgui.wpf;
7 |
8 | public partial class App : Application
9 | {
10 | protected override void OnStartup(StartupEventArgs e)
11 | {
12 | base.OnStartup(e);
13 |
14 | SettingsWindow? w = null;
15 |
16 | WeakReferenceMessenger.Default.Register(this, (r, m) =>
17 | {
18 | if (m.Value == WindowEnum.SettingsWindows)
19 | {
20 | w = new SettingsWindow();
21 | w.ShowDialog();
22 | }
23 |
24 | if (m.Value == WindowEnum.SettingsWindowsClose)
25 | {
26 | w?.Close();
27 | }
28 | });
29 | }
30 | }
--------------------------------------------------------------------------------
/jxlgui.wpf/Properties/PublishProfiles/Portable.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 | Release
9 | Any CPU
10 | bin\Release\net8.0-windows\win-x64\publish\
11 | FileSystem
12 | net8.0-windows
13 | win-x64
14 | true
15 | true
16 | true
17 | true
18 |
19 |
--------------------------------------------------------------------------------
/update_build_infos.ps1:
--------------------------------------------------------------------------------
1 | <#
2 | .SYNOPSIS
3 | This script updates build information for a project.
4 |
5 | #>
6 |
7 | Set-Location $PSScriptRoot
8 |
9 | git rev-parse HEAD > .\jxlgui.buildinfo\assets\commitid
10 | get-date -Format FileDateTimeUniversal > .\jxlgui.buildinfo\assets\date
11 |
12 | $latesttag = $(git describe --abbrev=0 --tags)
13 |
14 | if ($LASTEXITCODE -eq 0) {
15 | $latesttag > .\jxlgui.buildinfo\assets\version
16 | }
17 | else {
18 | "0.0.0" > .\jxlgui.buildinfo\assets\version
19 | }
20 |
21 | # Check
22 | Write-Host ("::notice title=commitid::{0}" -f (Get-Content .\jxlgui.buildinfo\assets\commitid))
23 | Write-Host ("::notice title=date::{0}" -f (Get-Content .\jxlgui.buildinfo\assets\date))
24 | Write-Host ("::notice title=version::{0}" -f (Get-Content .\jxlgui.buildinfo\assets\version))
25 |
26 | Exit 0
--------------------------------------------------------------------------------
/jxlgui.converter/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace jxlgui.converter;
2 |
3 | public class Constants
4 | {
5 | public static string[] ExtensionsEncode = { ".png", ".apng", ".gif", ".jpeg", ".jpg", ".ppm", ".pfm", ".pgx" };
6 | public static string[] ExtensionsDecode = { ".jxl" };
7 |
8 | public static string[] Extensions = ExtensionsEncode.Concat(ExtensionsDecode).ToArray();
9 |
10 | public static string AppFolder =
11 | Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "jxlgui");
12 |
13 |
14 | ///
15 | /// JPEG XL decoder (djxl.exe)
16 | ///
17 | public static string DecoderFilePath => Path.Combine(AppFolder, "djxl.exe");
18 |
19 | ///
20 | /// JPEG XL encoder (cjxl.exe)
21 | ///
22 | public static string EncoderFilePath => Path.Combine(AppFolder, "cjxl.exe");
23 |
24 | public static string ConfigPath => Path.Combine(AppFolder, "config.json");
25 | }
--------------------------------------------------------------------------------
/jxlgui.wpf/Converter/JobStatusBrushConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 | using System.Windows.Media;
5 | using jxlgui.converter;
6 |
7 | namespace jxlgui.wpf.Converter;
8 |
9 | public class JobStatusBrushConverter : IValueConverter
10 | {
11 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
12 | {
13 | var converterValue = (Job.JobStateEnum)value;
14 |
15 | switch (converterValue)
16 | {
17 | case Job.JobStateEnum.Done: return Brushes.LightGreen;
18 | case Job.JobStateEnum.Working: return Brushes.Yellow;
19 | case Job.JobStateEnum.Pending: return Brushes.Beige;
20 | case Job.JobStateEnum.Error: return Brushes.OrangeRed;
21 | default:
22 | return Brushes.Green;
23 | }
24 | }
25 |
26 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
27 | {
28 | throw new NotImplementedException();
29 | }
30 | }
--------------------------------------------------------------------------------
/jxlgui.converter/assets/LICENSE.zlib:
--------------------------------------------------------------------------------
1 | Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
2 |
3 | This software is provided 'as-is', without any express or implied
4 | warranty. In no event will the authors be held liable for any damages
5 | arising from the use of this software.
6 |
7 | Permission is granted to anyone to use this software for any purpose,
8 | including commercial applications, and to alter it and redistribute it
9 | freely, subject to the following restrictions:
10 |
11 | 1. The origin of this software must not be misrepresented; you must not
12 | claim that you wrote the original software. If you use this software
13 | in a product, an acknowledgment in the product documentation would be
14 | appreciated but is not required.
15 | 2. Altered source versions must be plainly marked as such, and must not be
16 | misrepresented as being the original software.
17 | 3. This notice may not be removed or altered from any source distribution.
18 |
19 | Jean-loup Gailly Mark Adler
20 | jloup@gzip.org madler@alumni.caltech.edu
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Daniel
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/jxlgui.converter/assets/LICENSE.brotli:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/jxlgui.converter/assets/LICENSE.giflib:
--------------------------------------------------------------------------------
1 | The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | // Use IntelliSense to find out which attributes exist for C# debugging
6 | // Use hover for the description of the existing attributes
7 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
8 | "name": ".NET Core Launch (console)",
9 | "type": "coreclr",
10 | "request": "launch",
11 | "preLaunchTask": "build",
12 | // If you have changed target frameworks, make sure to update the program path.
13 | "program": "${workspaceFolder}/jxlgui.wpf/bin/Debug/net8.0-windows/jxlgui.wpf.dll",
14 | "args": [],
15 | "cwd": "${workspaceFolder}/jxlgui.wpf",
16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
17 | "console": "internalConsole",
18 | "stopAtEntry": false
19 | },
20 | {
21 | "name": ".NET Core Attach",
22 | "type": "coreclr",
23 | "request": "attach"
24 | }
25 | ]
26 | }
--------------------------------------------------------------------------------
/jxlgui.wpf/jxlgui.wpf.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | net8.0-windows
6 | enable
7 | true
8 | Icon.png
9 | https://github.com/dhcgn/jxlgui
10 | Assets\Icon.ico
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | True
30 | \
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/.github/workflows/dotnet.yml:
--------------------------------------------------------------------------------
1 | name: .NET
2 |
3 | on:
4 | push:
5 | branches: [ main ]
6 | tags:
7 | - '*'
8 |
9 | pull_request:
10 | branches: [ main ]
11 |
12 | jobs:
13 | build:
14 |
15 | runs-on: windows-latest
16 |
17 | steps:
18 | - uses: actions/checkout@v2
19 | with:
20 | fetch-depth: 0
21 | lfs: true
22 | - name: Set Build Infos
23 | run: |
24 | ./update_build_infos.ps1
25 | - name: Setup .NET
26 | uses: actions/setup-dotnet@v1
27 | with:
28 | dotnet-version: 8.0.x
29 | - name: Restore dependencies
30 | run: dotnet restore
31 | - name: Build
32 | run: dotnet build --no-restore
33 | - name: Test
34 | run: dotnet test --no-build --verbosity normal
35 | - name: Publish
36 | run: dotnet publish /p:PublishProfile=Portable -c Release -o output
37 | - shell: pwsh
38 | env:
39 | MINISIGN_KEY: ${{ secrets.MINISIGN_KEY }}
40 | run: |
41 | .\sign_file.ps1 .\output\jxlgui.wpf.exe
42 | - name: Compress Publish
43 | run: Compress-Archive -Path .\output\jxlgui.wpf.exe* .\output\jxlgui.wpf.exe.zip
44 | - name: Upload Build Artifact
45 | uses: actions/upload-artifact@v2.3.1
46 | with:
47 | path: output\jxlgui.wpf.exe.zip
48 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/jxlgui.wpf/jxlgui.wpf.csproj",
11 | "/property:GenerateFullPaths=true",
12 | "/consoleloggerparameters:NoSummary"
13 | ],
14 | "problemMatcher": "$msCompile"
15 | },
16 | {
17 | "label": "publish",
18 | "command": "dotnet",
19 | "type": "process",
20 | "args": [
21 | "publish",
22 | "${workspaceFolder}/jxlgui.wpf/jxlgui.wpf.csproj",
23 | "/property:GenerateFullPaths=true",
24 | "/consoleloggerparameters:NoSummary"
25 | ],
26 | "problemMatcher": "$msCompile"
27 | },
28 | {
29 | "label": "watch",
30 | "command": "dotnet",
31 | "type": "process",
32 | "args": [
33 | "watch",
34 | "run",
35 | "--project",
36 | "${workspaceFolder}/jxlgui.wpf/jxlgui.wpf.csproj"
37 | ],
38 | "problemMatcher": "$msCompile"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/jxlgui.buildinfo/BuildInfos.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | namespace jxlgui.buildinfo;
4 |
5 | public class BuildInfos
6 | {
7 | private BuildInfos()
8 | {
9 | this.Version = GetStringFromFile("version");
10 | this.CommitId = GetStringFromFile("commitid");
11 | // core.abbrev configuration variable (see git-config[1]).
12 | // int minimum_abbrev = 4, default_abbrev = 7;
13 | this.CommitIdShort = GetStringFromFile("commitid").Substring(0, 20);
14 | this.Date = GetStringFromFile("date");
15 | }
16 |
17 | public string Version { get; set; }
18 | public string CommitId { get; set; }
19 | public string CommitIdShort { get; set; }
20 | public string Date { get; set; }
21 |
22 | public static BuildInfos Get()
23 | {
24 | return new BuildInfos();
25 | }
26 |
27 | private static string GetStringFromFile(string resourceName)
28 | {
29 | var assembly = Assembly.GetExecutingAssembly();
30 | var name = assembly.GetManifestResourceNames().First(n => n.EndsWith(resourceName));
31 | using (var resource = assembly.GetManifestResourceStream(name))
32 | {
33 | if (resource == null)
34 | return String.Empty;
35 |
36 | using var reader = new StreamReader(resource);
37 | var text = reader.ReadToEnd();
38 | text = text.Trim();
39 | return text;
40 | }
41 |
42 | }
43 | }
--------------------------------------------------------------------------------
/jxlgui.wpf/Views/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Linq;
3 | using System.Windows;
4 | using jxlgui.converter;
5 | using jxlgui.wpf.Messenger;
6 | using CommunityToolkit.Mvvm.Messaging;
7 |
8 | namespace jxlgui.wpf.Views;
9 |
10 | ///
11 | /// Interaction logic for MainWindow.xaml
12 | ///
13 | public partial class MainWindow : Window
14 | {
15 | public MainWindow()
16 | {
17 | this.InitializeComponent();
18 | }
19 |
20 | private void Border_Drop(object sender, DragEventArgs e)
21 | {
22 | base.OnDrop(e);
23 | var droppedFileName = e.Data.GetData(DataFormats.FileDrop) as string[];
24 |
25 | if (droppedFileName != null && droppedFileName.Any())
26 | droppedFileName.ToList()
27 | .ForEach(path => WeakReferenceMessenger.Default.Send(new FileDroppedMessage(path)));
28 |
29 | e.Handled = true;
30 | }
31 |
32 | private void Border_DragOver(object sender, DragEventArgs e)
33 | {
34 | e.Effects = DragDropEffects.None;
35 | var droppedFileName = e.Data.GetData(DataFormats.FileDrop) as string[];
36 |
37 | if (droppedFileName != null
38 | && droppedFileName.Any()
39 | && droppedFileName.Select(f => Path.GetExtension(f))
40 | .All(e => Constants.Extensions.Any(ee => ee.ToLower() == e.ToLower())))
41 | {
42 | e.Effects = DragDropEffects.Copy | DragDropEffects.Move;
43 | }
44 |
45 | e.Handled = true;
46 | }
47 | }
--------------------------------------------------------------------------------
/jxlgui.converter/assets/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) the JPEG XL Project Authors.
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | 1. Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | 2. Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | 3. Neither the name of the copyright holder nor the names of its
15 | contributors may be used to endorse or promote products derived from
16 | this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/jxlgui.converter/assets/LICENSE.libjxl:
--------------------------------------------------------------------------------
1 | Copyright (c) the JPEG XL Project Authors.
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | 1. Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | 2. Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | 3. Neither the name of the copyright holder nor the names of its
15 | contributors may be used to endorse or promote products derived from
16 | this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/jxlgui.converter/assets/LICENSE.libwebp:
--------------------------------------------------------------------------------
1 | Copyright (c) 2010, Google Inc. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in
12 | the documentation and/or other materials provided with the
13 | distribution.
14 |
15 | * Neither the name of Google nor the names of its contributors may
16 | be used to endorse or promote products derived from this software
17 | without specific prior written permission.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 |
31 |
--------------------------------------------------------------------------------
/jxlgui.converter/assets/LICENSE.skcms:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018 Google Inc. All rights reserved.
2 | //
3 | // Redistribution and use in source and binary forms, with or without
4 | // modification, are permitted provided that the following conditions are
5 | // met:
6 | //
7 | // * Redistributions of source code must retain the above copyright
8 | // notice, this list of conditions and the following disclaimer.
9 | // * Redistributions in binary form must reproduce the above
10 | // copyright notice, this list of conditions and the following disclaimer
11 | // in the documentation and/or other materials provided with the
12 | // distribution.
13 | // * Neither the name of Google Inc. nor the names of its
14 | // contributors may be used to endorse or promote products derived from
15 | // this software without specific prior written permission.
16 | //
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | --------------------------------------------------------------------------------
30 |
--------------------------------------------------------------------------------
/jxlgui.wpf/Windows/SettingsWindow.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/jxlgui.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30114.105
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "jxlgui.converter", "jxlgui.converter\jxlgui.converter.csproj", "{F61B084D-5C17-4C39-B85F-5395A2E07ADA}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "jxlgui.wpf", "jxlgui.wpf\jxlgui.wpf.csproj", "{505A1098-D0BE-4D59-B185-03B50C81D8B4}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "jxlgui.buildinfo", "jxlgui.buildinfo\jxlgui.buildinfo.csproj", "{D21DD31D-48D3-4D0A-B668-D2BAB90C16B1}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Release|Any CPU = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | {F61B084D-5C17-4C39-B85F-5395A2E07ADA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22 | {F61B084D-5C17-4C39-B85F-5395A2E07ADA}.Debug|Any CPU.Build.0 = Debug|Any CPU
23 | {F61B084D-5C17-4C39-B85F-5395A2E07ADA}.Release|Any CPU.ActiveCfg = Release|Any CPU
24 | {F61B084D-5C17-4C39-B85F-5395A2E07ADA}.Release|Any CPU.Build.0 = Release|Any CPU
25 | {505A1098-D0BE-4D59-B185-03B50C81D8B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26 | {505A1098-D0BE-4D59-B185-03B50C81D8B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
27 | {505A1098-D0BE-4D59-B185-03B50C81D8B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
28 | {505A1098-D0BE-4D59-B185-03B50C81D8B4}.Release|Any CPU.Build.0 = Release|Any CPU
29 | {D21DD31D-48D3-4D0A-B668-D2BAB90C16B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30 | {D21DD31D-48D3-4D0A-B668-D2BAB90C16B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
31 | {D21DD31D-48D3-4D0A-B668-D2BAB90C16B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
32 | {D21DD31D-48D3-4D0A-B668-D2BAB90C16B1}.Release|Any CPU.Build.0 = Release|Any CPU
33 | EndGlobalSection
34 | EndGlobal
35 |
--------------------------------------------------------------------------------
/sign_file.ps1:
--------------------------------------------------------------------------------
1 | <#
2 | .SYNOPSIS
3 | This script signs a file using Minisign.
4 |
5 | .DESCRIPTION
6 | The script takes an input file as a parameter, signs it using a private key, and verifies the signature.
7 | The private key is fetched from an environment variable or a local file.
8 | If the private key is not valid, the script will exit with an error.
9 | The script also downloads and extracts Minisign if it's not already present.
10 |
11 | .PARAMETER inputfile
12 | The file to be signed.
13 |
14 | .EXAMPLE
15 | .\sign_file.ps1 -inputfile "path\to\file"
16 |
17 | .NOTES
18 | The script requires Minisign to be available. If it's not, the script will download it from GitHub.
19 | The private key is expected to be in base64 format.
20 | #>
21 |
22 | param ([string] $inputfile)
23 |
24 | # Vars
25 | $secretKeyPathLocal = "D:\*\*\*\dhcgn-github.key.base64"
26 | $secretKeyHash = "C73659FD39DC0C1A4A58E2CCB517322A78CB5D8DEAAFCE8E6D1A4BBEEFD08EFC"
27 | $minisignDownloadUrl = 'https://github.com/jedisct1/minisign/releases/download/0.10/minisign-0.10-win64.zip'
28 | $publicKey = "RWS6WvbGy1Vj62jz6zVQfFIy+gcXJVK1nyGOZxpOLOIQmhTziYNk9B/g"
29 |
30 | # Secrets
31 | $privateKey = $env:MINISIGN_KEY
32 |
33 | if ($privateKey.Length -eq "") {
34 | Write-Host "::debug::Secret was empty"
35 | $privateKey = Get-Content $secretKeyPathLocal
36 | }
37 |
38 | $privateKey = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($privateKey))
39 |
40 | Set-Content -Path private_key -Value $privateKey
41 | Get-FileHash -Path private_key -Algorithm SHA256
42 |
43 | if ((Get-FileHash -Path private_key -Algorithm SHA256).Hash -ne $secretKeyHash) {
44 | Write-Host "::error::Private key is not valid"
45 | Exit -1
46 | }
47 |
48 | if (-Not (Test-Path "minisign.zip")) {
49 | Invoke-WebRequest -Uri $minisignDownloadUrl -OutFile minisign.zip
50 | }
51 |
52 | Expand-Archive -Path minisign.zip -DestinationPath . -Force
53 | Set-Alias -Name minisign -Value .\minisign-win64\minisign.exe
54 |
55 | Write-Host "::debug::Sign file"
56 | "" | minisign -Sm $inputfile -s private_key
57 | Remove-Item -Path private_key -Force
58 | if ($LASTEXITCODE -ne 0) {
59 | Write-Host "::error::Could't sign file"
60 | Exit -1
61 | }
62 |
63 | Write-Host "::debug::Verify signature"
64 | minisign -VP $publicKey -m $inputfile
65 | if ($LASTEXITCODE -ne 0) {
66 | Write-Host "::error::Couldn't verify signature"
67 | Exit -1
68 | }
--------------------------------------------------------------------------------
/jxlgui.converter/Config.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json;
2 |
3 | namespace jxlgui.converter;
4 |
5 | public class Config
6 | {
7 | // Quality setting (is remapped to --distance). Range: -inf .. 100.
8 | // 100 = mathematically lossless. Default for already-lossy input (JPEG/GIF).
9 | // Positive quality values roughly match libjpeg quality.
10 | public double? Quality { get; set; }
11 |
12 | // Encoder effort setting. Range: 1 .. 9.
13 | // Default: 7. Higher number is more effort (slower)
14 | public int Effort { get; set; }
15 |
16 | // The distance level for lossy compression: target max butteraugli
17 | // distance, lower = higher quality. Range: 0 .. 15.
18 | // 0.0 = mathematically lossless (however, use JxlEncoderOptionsSetLossless to use true lossless).
19 | // 1.0 = visually lossless.
20 | // Recommended range: 0.5 .. 3.0.
21 | // Default value: 1.0.
22 | // If JxlEncoderOptionsSetLossless is used, this value is unused and implied to be 0
23 | public double? Distance { get; set; }
24 |
25 | public static Config CreateEmpty()
26 | {
27 | return new Config
28 | {
29 | Quality = 99.9,
30 | Effort = 7,
31 | Distance = null,
32 | };
33 | }
34 |
35 | public string ToJson()
36 | {
37 | var jsonConfig = new JsonSerializerOptions
38 | {
39 | WriteIndented = true
40 | };
41 | var jsonString = JsonSerializer.Serialize(this, jsonConfig);
42 | return jsonString;
43 | }
44 |
45 | public static bool IsJsonValid(string json)
46 | {
47 | try
48 | {
49 | var settings = JsonSerializer.Deserialize(json);
50 | return settings != null;
51 | }
52 | catch (System.Exception)
53 | {
54 | return false;
55 | }
56 | }
57 |
58 |
59 | public static Config LoadOrCreateNew()
60 | {
61 | if (File.Exists(Constants.ConfigPath))
62 | {
63 | var c = Load();
64 | return c ?? CreateEmpty();
65 | }
66 |
67 | var config = CreateEmpty();
68 | Save(config);
69 | return config;
70 | }
71 |
72 | public static void Save(Config config)
73 | {
74 | File.WriteAllText(Constants.ConfigPath, config.ToJson());
75 | }
76 |
77 | public static Config? Load()
78 | {
79 | var json = File.ReadAllText(Constants.ConfigPath);
80 |
81 | try
82 | {
83 | var config = JsonSerializer.Deserialize(json);
84 | return config;
85 | }
86 | catch (System.Exception)
87 | {
88 | return null;
89 | }
90 | }
91 | }
--------------------------------------------------------------------------------
/jxlgui.wpf/ViewModels/SettingsViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Text.Json;
3 | using System.Windows;
4 | using jxlgui.converter;
5 | using jxlgui.wpf.Messenger;
6 | using CommunityToolkit.Mvvm.ComponentModel;
7 | using CommunityToolkit.Mvvm.Input;
8 | using CommunityToolkit.Mvvm.Messaging;
9 |
10 | namespace jxlgui.wpf.ViewModels;
11 |
12 | public class SettingsViewModel : ObservableRecipient
13 | {
14 | public SettingsViewModel()
15 | {
16 | this.SaveCommand =
17 | new RelayCommand(SaveCommandHandling, () =>
18 | {
19 | if (this.Config == null)
20 | return false;
21 | return jxlgui.converter.Config.IsJsonValid(this.Config);
22 | });
23 | this.CancelCommand = new RelayCommand(() =>
24 | {
25 | this.Messenger.Send(new WindowMessage(WindowEnum.SettingsWindowsClose));
26 | });
27 |
28 | var c = jxlgui.converter.Config.LoadOrCreateNew();
29 | this.Config = c.ToJson();
30 |
31 | if (InDesignMode())
32 | {
33 | configError = "Error";
34 | }
35 | }
36 |
37 | public static bool InDesignMode()
38 | {
39 | return !(Application.Current is App);
40 | }
41 |
42 | private void SaveCommandHandling()
43 | {
44 | if (this.Config == null)
45 | {
46 | System.Windows.MessageBox.Show("Config is null");
47 | return;
48 | }
49 |
50 | if (!jxlgui.converter.Config.IsJsonValid(this.Config))
51 | {
52 | System.Windows.MessageBox.Show("Config is not valid");
53 | return;
54 | }
55 |
56 | File.WriteAllText(Constants.ConfigPath, this.Config);
57 |
58 | var c = jxlgui.converter.Config.Load();
59 | if (c == null)
60 | return;
61 |
62 | this.Config = c.ToJson();
63 | }
64 |
65 | public required RelayCommand OnLoadCommand { get; set; }
66 | public required RelayCommand SaveCommand { get; set; }
67 | public required RelayCommand CancelCommand { get; set; }
68 |
69 | private string? config;
70 |
71 | public string? Config
72 | {
73 | get { return config; }
74 | set
75 | {
76 | this.SetProperty(ref this.config, value);
77 | if (this.Config == null){
78 | ConfigError = "Config is null";
79 | return;
80 | }
81 | ConfigError = converter.Config.IsJsonValid(this.Config) ? null : "Json is not valid";
82 | }
83 | }
84 |
85 | private string? configError;
86 |
87 | public string? ConfigError
88 | {
89 | get { return configError; }
90 | set { base.SetProperty(ref this.configError, value); }
91 | }
92 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/dhcgn/jxlgui/actions/workflows/dotnet.yml)
2 |
3 | # jxlgui
4 |
5 | jxlgui is a Windows Desktop App designed to make the conversion of images to the JPEG XL format straightforward and accessible to everyone. With JPEG XL, you can enjoy modern image format benefits such as impressive performance and lossless compression. This tool stands out by offering a portable single executable file, making it easy to use without a complex installation process.
6 |
7 | ## Motivation
8 |
9 | The motivation behind developing jxlgui was to increase the accessibility of the JPEG XL file format. We believe in the potential of JPEG XL to revolutionize image storage and transmission, and we want to contribute to its adoption by providing a user-friendly tool for image conversion.
10 |
11 | ## Key Features
12 |
13 | - **Portable**: jxlgui comes as a single executable file, requiring no installation.
14 | - **Batch Conversion**: Easily add multiple images to the app for batch conversion.
15 | - **Drag and Drop Interface**: Simply drag and drop your files into the app's drop area to start the conversion process.
16 | - **Supports Multiple Formats**: The input can be PNG, APNG, GIF, JPEG, PPM, PFM, or PGX, and a JPEG XL (JXL) file will be converted to PNG with ICC, JPG, or PPM/PFM.
17 |
18 | ## Installation
19 |
20 | No installation is required! Just copy the executable file to a convenient location on your computer and run it. jxlgui is built with .NET 8.0, so ensure your system meets the same requirements as .NET 8.0 for smooth operation.
21 |
22 | ## Usage
23 |
24 | Using jxlgui is as simple as dragging and dropping your image files into the app's drop area. For more detailed instructions and examples, please refer to the screenshots and video tutorials included in this README.
25 |
26 | 
27 |
28 | [Video Tutorial](https://user-images.githubusercontent.com/6566207/152654674-f232b6b7-c2d1-4f4e-a78d-1cbfe3bb6020.mp4)
29 |
30 | ## Contributing
31 |
32 | We welcome contributions! If you have ideas for improvements or want to contribute code, please feel free to add an issue or submit a pull request.
33 |
34 | ## Support
35 |
36 | If you encounter any issues or have questions, please use the GitHub Issues section of this repository. We are committed to providing support and addressing your concerns.
37 |
38 | ## Acknowledgments
39 |
40 | A big thank you to the developers and contributors of the JPEG XL file format. Your work inspires and enables projects like this.
41 |
42 | ## License
43 |
44 | This app includes libjxl, which is licensed under the conditions listed [here](https://github.com/libjxl/libjxl/blob/main/LICENSE). For the license of jxlgui itself, please refer to the LICENSE file in this repository.
--------------------------------------------------------------------------------
/jxlgui.converter/ExternalJxlResourceHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.Reflection;
3 | using System.Text.RegularExpressions;
4 |
5 | namespace jxlgui.converter;
6 |
7 | public class ExternalJxlResourceHandler
8 | {
9 | public enum JxlFileResultEnum
10 | {
11 | OK,
12 | FileNotFound,
13 | VersionNotReadable
14 | }
15 |
16 |
17 | public static JxlFileResult GetDecoderInformation()
18 | {
19 | return GetFileInformation(Constants.DecoderFilePath);
20 | }
21 |
22 | public static JxlFileResult GetEncoderInformation()
23 | {
24 | return GetFileInformation(Constants.EncoderFilePath);
25 | }
26 |
27 | private static JxlFileResult GetFileInformation(string path)
28 | {
29 | if (!File.Exists(path))
30 | return new JxlFileResult
31 | {
32 | Result = JxlFileResultEnum.FileNotFound
33 | };
34 |
35 | (string? version, string? commit) = GetExecutableVersion(path);
36 |
37 | if (version == null)
38 | return new JxlFileResult
39 | {
40 | Result = JxlFileResultEnum.VersionNotReadable
41 | };
42 |
43 | return new JxlFileResult
44 | {
45 | Result = JxlFileResultEnum.OK,
46 | Version = version,
47 | Commit = commit
48 | };
49 | }
50 |
51 |
52 | private static (string? version, string? commit) GetExecutableVersion(string path)
53 | {
54 | var proc = new Process
55 | {
56 | StartInfo = new ProcessStartInfo
57 | {
58 | FileName = path,
59 | Arguments = "-V",
60 | UseShellExecute = false,
61 | RedirectStandardOutput = true,
62 | CreateNoWindow = true
63 | }
64 | };
65 |
66 | proc.Start();
67 | var line = "";
68 | while (!proc.StandardOutput.EndOfStream) line += proc.StandardOutput.ReadLine();
69 |
70 | return (ParseVersion(line), ParseCommit(line));
71 | }
72 |
73 | private static string? ParseVersion(string input)
74 | {
75 | var r = Regex.Match(input, @"v(\d{1,}.\d{1,}.\d{1,})");
76 | if (r.Groups.Count != 2) return null;
77 |
78 | return r.Groups[1].Value;
79 | }
80 |
81 | private static string? ParseCommit(string input)
82 | {
83 | var r = Regex.Match(input, @"([a-f0-9]{6,})");
84 | if (r.Groups.Count != 2) return null;
85 |
86 | return r.Groups[1].Value;
87 | }
88 |
89 | public static void SaveFiles()
90 | {
91 | Directory.CreateDirectory(Constants.AppFolder);
92 |
93 | WriteResourceToFile("cjxl.exe", Constants.EncoderFilePath);
94 | WriteResourceToFile("djxl.exe", Constants.DecoderFilePath);
95 | }
96 |
97 | private static void WriteResourceToFile(string resourceName, string fileName)
98 | {
99 | var assembly = Assembly.GetExecutingAssembly();
100 | var name = assembly.GetManifestResourceNames().First(n => n.EndsWith(resourceName));
101 |
102 | using var resource = assembly.GetManifestResourceStream(name);
103 | if (resource == null)
104 | return;
105 |
106 | using var file = new FileStream(fileName, FileMode.Create, FileAccess.Write);
107 | resource.CopyTo(file);
108 | }
109 |
110 | public class JxlFileResult
111 | {
112 | public JxlFileResultEnum Result { get; init; }
113 | public string? Version { get; init; }
114 | public string? Commit { get; init; }
115 | }
116 | }
--------------------------------------------------------------------------------
/jxlgui.converter/assets/LICENSE.libjpeg-turbo:
--------------------------------------------------------------------------------
1 | libjpeg-turbo Licenses
2 | ======================
3 |
4 | libjpeg-turbo is covered by three compatible BSD-style open source licenses:
5 |
6 | - The IJG (Independent JPEG Group) License, which is listed in
7 | [README.ijg](README.ijg)
8 |
9 | This license applies to the libjpeg API library and associated programs
10 | (any code inherited from libjpeg, and any modifications to that code.)
11 |
12 | - The Modified (3-clause) BSD License, which is listed below
13 |
14 | This license covers the TurboJPEG API library and associated programs, as
15 | well as the build system.
16 |
17 | - The [zlib License](https://opensource.org/licenses/Zlib)
18 |
19 | This license is a subset of the other two, and it covers the libjpeg-turbo
20 | SIMD extensions.
21 |
22 |
23 | Complying with the libjpeg-turbo Licenses
24 | =========================================
25 |
26 | This section provides a roll-up of the libjpeg-turbo licensing terms, to the
27 | best of our understanding.
28 |
29 | 1. If you are distributing a modified version of the libjpeg-turbo source,
30 | then:
31 |
32 | 1. You cannot alter or remove any existing copyright or license notices
33 | from the source.
34 |
35 | **Origin**
36 | - Clause 1 of the IJG License
37 | - Clause 1 of the Modified BSD License
38 | - Clauses 1 and 3 of the zlib License
39 |
40 | 2. You must add your own copyright notice to the header of each source
41 | file you modified, so others can tell that you modified that file (if
42 | there is not an existing copyright header in that file, then you can
43 | simply add a notice stating that you modified the file.)
44 |
45 | **Origin**
46 | - Clause 1 of the IJG License
47 | - Clause 2 of the zlib License
48 |
49 | 3. You must include the IJG README file, and you must not alter any of the
50 | copyright or license text in that file.
51 |
52 | **Origin**
53 | - Clause 1 of the IJG License
54 |
55 | 2. If you are distributing only libjpeg-turbo binaries without the source, or
56 | if you are distributing an application that statically links with
57 | libjpeg-turbo, then:
58 |
59 | 1. Your product documentation must include a message stating:
60 |
61 | This software is based in part on the work of the Independent JPEG
62 | Group.
63 |
64 | **Origin**
65 | - Clause 2 of the IJG license
66 |
67 | 2. If your binary distribution includes or uses the TurboJPEG API, then
68 | your product documentation must include the text of the Modified BSD
69 | License (see below.)
70 |
71 | **Origin**
72 | - Clause 2 of the Modified BSD License
73 |
74 | 3. You cannot use the name of the IJG or The libjpeg-turbo Project or the
75 | contributors thereof in advertising, publicity, etc.
76 |
77 | **Origin**
78 | - IJG License
79 | - Clause 3 of the Modified BSD License
80 |
81 | 4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be
82 | free of defects, nor do we accept any liability for undesirable
83 | consequences resulting from your use of the software.
84 |
85 | **Origin**
86 | - IJG License
87 | - Modified BSD License
88 | - zlib License
89 |
90 |
91 | The Modified (3-clause) BSD License
92 | ===================================
93 |
94 | Copyright (C)2009-2020 D. R. Commander. All Rights Reserved.
95 | Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
96 |
97 | Redistribution and use in source and binary forms, with or without
98 | modification, are permitted provided that the following conditions are met:
99 |
100 | - Redistributions of source code must retain the above copyright notice,
101 | this list of conditions and the following disclaimer.
102 | - Redistributions in binary form must reproduce the above copyright notice,
103 | this list of conditions and the following disclaimer in the documentation
104 | and/or other materials provided with the distribution.
105 | - Neither the name of the libjpeg-turbo Project nor the names of its
106 | contributors may be used to endorse or promote products derived from this
107 | software without specific prior written permission.
108 |
109 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
110 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
111 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
112 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
113 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
114 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
115 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
116 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
117 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
118 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
119 | POSSIBILITY OF SUCH DAMAGE.
120 |
121 |
122 | Why Three Licenses?
123 | ===================
124 |
125 | The zlib License could have been used instead of the Modified (3-clause) BSD
126 | License, and since the IJG License effectively subsumes the distribution
127 | conditions of the zlib License, this would have effectively placed
128 | libjpeg-turbo binary distributions under the IJG License. However, the IJG
129 | License specifically refers to the Independent JPEG Group and does not extend
130 | attribution and endorsement protections to other entities. Thus, it was
131 | desirable to choose a license that granted us the same protections for new code
132 | that were granted to the IJG for code derived from their software.
133 |
--------------------------------------------------------------------------------
/jxlgui.wpf/ViewModels/MainViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Diagnostics;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using jxlgui.buildinfo;
9 | using jxlgui.converter;
10 | using jxlgui.wpf.Messenger;
11 | using CommunityToolkit.Mvvm.ComponentModel;
12 | using CommunityToolkit.Mvvm.Input;
13 | using CommunityToolkit.Mvvm.Messaging;
14 |
15 | namespace jxlgui.wpf.ViewModels;
16 |
17 | internal class MainViewModel : ObservableRecipient
18 | {
19 | private bool canEncode;
20 |
21 |
22 | public MainViewModel()
23 | {
24 | this.OnLoadCommand = new AsyncRelayCommand(this.OnLoadCommandHandlingAsync);
25 | JobManager jm = new();
26 |
27 | WeakReferenceMessenger.Default.Register(this, (r, m) =>
28 | {
29 | if (!this.CanEncode)
30 | return;
31 |
32 | var job = Job.Create(m.Value, Config.LoadOrCreateNew());
33 | jm.Add(job);
34 | this.Jobs.Add(job);
35 | });
36 |
37 | this.ShowSettingsCommand =
38 | new RelayCommand(() => this.Messenger.Send(new WindowMessage(WindowEnum.SettingsWindows)));
39 | this.OpenHelpCommand = new RelayCommand(() => OpenUrl(@"https://github.com/dhcgn/jxlgui/wiki"));
40 |
41 | this.Configs = new List { "built in" };
42 | this.SelectedConfig = this.Configs.First();
43 |
44 | if (InDesignMode())
45 | {
46 | this.Jobs.Add(Job.GetDesignDate(Job.JobStateEnum.Pending));
47 | this.Jobs.Add(Job.GetDesignDate(Job.JobStateEnum.Working));
48 | this.Jobs.Add(Job.GetDesignDate(Job.JobStateEnum.Done));
49 | this.Jobs.Add(Job.GetDesignDate(Job.JobStateEnum.Error));
50 |
51 | //for (int i = 0; i < 200; i++)
52 | //{
53 | // this.Jobs.Add(Job.GetDesignDate(Job.JobStateEnum.Done));
54 | //}
55 |
56 | this.CanEncode = false;
57 | }
58 | }
59 |
60 | public BuildInfos BuildInfos { get; } = BuildInfos.Get();
61 |
62 | public ObservableCollection Jobs { get; } = new();
63 |
64 | private string jxlEncVersion = "UNDEF";
65 |
66 | public string JxlEncVersion
67 | {
68 | get => this.jxlEncVersion;
69 | set => this.SetProperty(ref this.jxlEncVersion, value);
70 | }
71 |
72 | private string? jxlEncCommit = "0000000";
73 |
74 | public string? JxlEncCommit
75 | {
76 | get => this.jxlEncCommit;
77 | set => this.SetProperty(ref this.jxlEncCommit, value);
78 | }
79 |
80 | private string? jxlDecVersion = "UNDEF";
81 |
82 | public string? JxlDecVersion
83 | {
84 | get => this.jxlDecVersion;
85 | set => this.SetProperty(ref this.jxlDecVersion, value);
86 | }
87 |
88 | private string? jxlDecCommit = "0000000";
89 |
90 | public string? JxlDecCommit
91 | {
92 | get => this.jxlDecCommit;
93 | set => this.SetProperty(ref this.jxlDecCommit, value);
94 | }
95 |
96 | public required RelayCommand ShowSettingsCommand { get; set; }
97 | public required RelayCommand OpenHelpCommand { get; set; }
98 | public List Configs { get; }
99 | public string SelectedConfig { get; set; }
100 | public required IAsyncRelayCommand OnLoadCommand { get; set;}
101 |
102 | public bool CanEncode
103 | {
104 | get => this.canEncode;
105 | set => this.SetProperty(ref this.canEncode, value);
106 | }
107 |
108 | private void OpenUrl(string url)
109 | {
110 | try
111 | {
112 | Process.Start(url);
113 | }
114 | catch
115 | {
116 | // hack because of this: https://github.com/dotnet/corefx/issues/10361
117 | url = url.Replace("&", "^&");
118 | Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true });
119 | }
120 | }
121 |
122 | public static bool InDesignMode()
123 | {
124 | return !(Application.Current is App);
125 | }
126 |
127 | private async Task OnLoadCommandHandlingAsync()
128 | {
129 | void SetVersionCommit(Action SetVersion, Action SetCommit,
130 | ExternalJxlResourceHandler.JxlFileResult jxlFileResult)
131 | {
132 | if (jxlFileResult.Result == ExternalJxlResourceHandler.JxlFileResultEnum.FileNotFound)
133 | {
134 | SetVersion("FILE NOT FOUND");
135 | SetCommit("");
136 | this.CanEncode = false;
137 | }
138 | else if (jxlFileResult.Result == ExternalJxlResourceHandler.JxlFileResultEnum.VersionNotReadable)
139 | {
140 | SetVersion("ERROR");
141 | SetCommit("");
142 | this.CanEncode = false;
143 | }
144 | else if (jxlFileResult.Result == ExternalJxlResourceHandler.JxlFileResultEnum.OK)
145 | {
146 | SetVersion(jxlFileResult.Version);
147 | SetCommit(jxlFileResult.Commit);
148 | this.CanEncode = true;
149 | }
150 | }
151 |
152 | ExternalJxlResourceHandler.SaveFiles();
153 |
154 | await Task.Factory.StartNew(() =>
155 | {
156 | SetVersionCommit(v => this.JxlEncVersion = v ?? String.Empty, c => this.JxlEncCommit = c ?? String.Empty,
157 | ExternalJxlResourceHandler.GetEncoderInformation());
158 | SetVersionCommit(v => this.JxlDecVersion = v ?? String.Empty, c => this.JxlDecCommit = c ?? String.Empty,
159 | ExternalJxlResourceHandler.GetDecoderInformation());
160 | });
161 | }
162 | }
--------------------------------------------------------------------------------
/jxlgui.converter/assets/LICENSE.libpng:
--------------------------------------------------------------------------------
1 | COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
2 | =========================================
3 |
4 | PNG Reference Library License version 2
5 | ---------------------------------------
6 |
7 | * Copyright (c) 1995-2019 The PNG Reference Library Authors.
8 | * Copyright (c) 2018-2019 Cosmin Truta.
9 | * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
10 | * Copyright (c) 1996-1997 Andreas Dilger.
11 | * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
12 |
13 | The software is supplied "as is", without warranty of any kind,
14 | express or implied, including, without limitation, the warranties
15 | of merchantability, fitness for a particular purpose, title, and
16 | non-infringement. In no event shall the Copyright owners, or
17 | anyone distributing the software, be liable for any damages or
18 | other liability, whether in contract, tort or otherwise, arising
19 | from, out of, or in connection with the software, or the use or
20 | other dealings in the software, even if advised of the possibility
21 | of such damage.
22 |
23 | Permission is hereby granted to use, copy, modify, and distribute
24 | this software, or portions hereof, for any purpose, without fee,
25 | subject to the following restrictions:
26 |
27 | 1. The origin of this software must not be misrepresented; you
28 | must not claim that you wrote the original software. If you
29 | use this software in a product, an acknowledgment in the product
30 | documentation would be appreciated, but is not required.
31 |
32 | 2. Altered source versions must be plainly marked as such, and must
33 | not be misrepresented as being the original software.
34 |
35 | 3. This Copyright notice may not be removed or altered from any
36 | source or altered source distribution.
37 |
38 |
39 | PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
40 | -----------------------------------------------------------------------
41 |
42 | libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
43 | Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
44 | derived from libpng-1.0.6, and are distributed according to the same
45 | disclaimer and license as libpng-1.0.6 with the following individuals
46 | added to the list of Contributing Authors:
47 |
48 | Simon-Pierre Cadieux
49 | Eric S. Raymond
50 | Mans Rullgard
51 | Cosmin Truta
52 | Gilles Vollant
53 | James Yu
54 | Mandar Sahastrabuddhe
55 | Google Inc.
56 | Vadim Barkov
57 |
58 | and with the following additions to the disclaimer:
59 |
60 | There is no warranty against interference with your enjoyment of
61 | the library or against infringement. There is no warranty that our
62 | efforts or the library will fulfill any of your particular purposes
63 | or needs. This library is provided with all faults, and the entire
64 | risk of satisfactory quality, performance, accuracy, and effort is
65 | with the user.
66 |
67 | Some files in the "contrib" directory and some configure-generated
68 | files that are distributed with libpng have other copyright owners, and
69 | are released under other open source licenses.
70 |
71 | libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
72 | Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
73 | libpng-0.96, and are distributed according to the same disclaimer and
74 | license as libpng-0.96, with the following individuals added to the
75 | list of Contributing Authors:
76 |
77 | Tom Lane
78 | Glenn Randers-Pehrson
79 | Willem van Schaik
80 |
81 | libpng versions 0.89, June 1996, through 0.96, May 1997, are
82 | Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
83 | and are distributed according to the same disclaimer and license as
84 | libpng-0.88, with the following individuals added to the list of
85 | Contributing Authors:
86 |
87 | John Bowler
88 | Kevin Bracey
89 | Sam Bushell
90 | Magnus Holmgren
91 | Greg Roelofs
92 | Tom Tanner
93 |
94 | Some files in the "scripts" directory have other copyright owners,
95 | but are released under this license.
96 |
97 | libpng versions 0.5, May 1995, through 0.88, January 1996, are
98 | Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
99 |
100 | For the purposes of this copyright and license, "Contributing Authors"
101 | is defined as the following set of individuals:
102 |
103 | Andreas Dilger
104 | Dave Martindale
105 | Guy Eric Schalnat
106 | Paul Schmidt
107 | Tim Wegner
108 |
109 | The PNG Reference Library is supplied "AS IS". The Contributing
110 | Authors and Group 42, Inc. disclaim all warranties, expressed or
111 | implied, including, without limitation, the warranties of
112 | merchantability and of fitness for any purpose. The Contributing
113 | Authors and Group 42, Inc. assume no liability for direct, indirect,
114 | incidental, special, exemplary, or consequential damages, which may
115 | result from the use of the PNG Reference Library, even if advised of
116 | the possibility of such damage.
117 |
118 | Permission is hereby granted to use, copy, modify, and distribute this
119 | source code, or portions hereof, for any purpose, without fee, subject
120 | to the following restrictions:
121 |
122 | 1. The origin of this source code must not be misrepresented.
123 |
124 | 2. Altered versions must be plainly marked as such and must not
125 | be misrepresented as being the original source.
126 |
127 | 3. This Copyright notice may not be removed or altered from any
128 | source or altered source distribution.
129 |
130 | The Contributing Authors and Group 42, Inc. specifically permit,
131 | without fee, and encourage the use of this source code as a component
132 | to supporting the PNG file format in commercial products. If you use
133 | this source code in a product, acknowledgment is not required but would
134 | be appreciated.
135 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 | [Ll]ogs/
33 |
34 | # Visual Studio 2015/2017 cache/options directory
35 | .vs/
36 | # Uncomment if you have tasks that create the project's static files in wwwroot
37 | #wwwroot/
38 |
39 | # Visual Studio 2017 auto generated files
40 | Generated\ Files/
41 |
42 | # MSTest test Results
43 | [Tt]est[Rr]esult*/
44 | [Bb]uild[Ll]og.*
45 |
46 | # NUnit
47 | *.VisualState.xml
48 | TestResult.xml
49 | nunit-*.xml
50 |
51 | # Build Results of an ATL Project
52 | [Dd]ebugPS/
53 | [Rr]eleasePS/
54 | dlldata.c
55 |
56 | # Benchmark Results
57 | BenchmarkDotNet.Artifacts/
58 |
59 | # .NET Core
60 | project.lock.json
61 | project.fragment.lock.json
62 | artifacts/
63 |
64 | # StyleCop
65 | StyleCopReport.xml
66 |
67 | # Files built by Visual Studio
68 | *_i.c
69 | *_p.c
70 | *_h.h
71 | *.ilk
72 | *.meta
73 | *.obj
74 | *.iobj
75 | *.pch
76 | *.pdb
77 | *.ipdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *_wpftmp.csproj
88 | *.log
89 | *.vspscc
90 | *.vssscc
91 | .builds
92 | *.pidb
93 | *.svclog
94 | *.scc
95 |
96 | # Chutzpah Test files
97 | _Chutzpah*
98 |
99 | # Visual C++ cache files
100 | ipch/
101 | *.aps
102 | *.ncb
103 | *.opendb
104 | *.opensdf
105 | *.sdf
106 | *.cachefile
107 | *.VC.db
108 | *.VC.VC.opendb
109 |
110 | # Visual Studio profiler
111 | *.psess
112 | *.vsp
113 | *.vspx
114 | *.sap
115 |
116 | # Visual Studio Trace Files
117 | *.e2e
118 |
119 | # TFS 2012 Local Workspace
120 | $tf/
121 |
122 | # Guidance Automation Toolkit
123 | *.gpState
124 |
125 | # ReSharper is a .NET coding add-in
126 | _ReSharper*/
127 | *.[Rr]e[Ss]harper
128 | *.DotSettings.user
129 |
130 | # TeamCity is a build add-in
131 | _TeamCity*
132 |
133 | # DotCover is a Code Coverage Tool
134 | *.dotCover
135 |
136 | # AxoCover is a Code Coverage Tool
137 | .axoCover/*
138 | !.axoCover/settings.json
139 |
140 | # Visual Studio code coverage results
141 | *.coverage
142 | *.coveragexml
143 |
144 | # NCrunch
145 | _NCrunch_*
146 | .*crunch*.local.xml
147 | nCrunchTemp_*
148 |
149 | # MightyMoose
150 | *.mm.*
151 | AutoTest.Net/
152 |
153 | # Web workbench (sass)
154 | .sass-cache/
155 |
156 | # Installshield output folder
157 | [Ee]xpress/
158 |
159 | # DocProject is a documentation generator add-in
160 | DocProject/buildhelp/
161 | DocProject/Help/*.HxT
162 | DocProject/Help/*.HxC
163 | DocProject/Help/*.hhc
164 | DocProject/Help/*.hhk
165 | DocProject/Help/*.hhp
166 | DocProject/Help/Html2
167 | DocProject/Help/html
168 |
169 | # Click-Once directory
170 | publish/
171 |
172 | # Publish Web Output
173 | *.[Pp]ublish.xml
174 | *.azurePubxml
175 | # Note: Comment the next line if you want to checkin your web deploy settings,
176 | # but database connection strings (with potential passwords) will be unencrypted
177 | *.pubxml
178 | *.publishproj
179 |
180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
181 | # checkin your Azure Web App publish settings, but sensitive information contained
182 | # in these scripts will be unencrypted
183 | PublishScripts/
184 |
185 | # NuGet Packages
186 | *.nupkg
187 | # NuGet Symbol Packages
188 | *.snupkg
189 | # The packages folder can be ignored because of Package Restore
190 | **/[Pp]ackages/*
191 | # except build/, which is used as an MSBuild target.
192 | !**/[Pp]ackages/build/
193 | # Uncomment if necessary however generally it will be regenerated when needed
194 | #!**/[Pp]ackages/repositories.config
195 | # NuGet v3's project.json files produces more ignorable files
196 | *.nuget.props
197 | *.nuget.targets
198 |
199 | # Microsoft Azure Build Output
200 | csx/
201 | *.build.csdef
202 |
203 | # Microsoft Azure Emulator
204 | ecf/
205 | rcf/
206 |
207 | # Windows Store app package directories and files
208 | AppPackages/
209 | BundleArtifacts/
210 | Package.StoreAssociation.xml
211 | _pkginfo.txt
212 | *.appx
213 | *.appxbundle
214 | *.appxupload
215 |
216 | # Visual Studio cache files
217 | # files ending in .cache can be ignored
218 | *.[Cc]ache
219 | # but keep track of directories ending in .cache
220 | !?*.[Cc]ache/
221 |
222 | # Others
223 | ClientBin/
224 | ~$*
225 | *~
226 | *.dbmdl
227 | *.dbproj.schemaview
228 | *.jfm
229 | *.pfx
230 | *.publishsettings
231 | orleans.codegen.cs
232 |
233 | # Including strong name files can present a security risk
234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
235 | #*.snk
236 |
237 | # Since there are multiple workflows, uncomment next line to ignore bower_components
238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
239 | #bower_components/
240 |
241 | # RIA/Silverlight projects
242 | Generated_Code/
243 |
244 | # Backup & report files from converting an old project file
245 | # to a newer Visual Studio version. Backup files are not needed,
246 | # because we have git ;-)
247 | _UpgradeReport_Files/
248 | Backup*/
249 | UpgradeLog*.XML
250 | UpgradeLog*.htm
251 | ServiceFabricBackup/
252 | *.rptproj.bak
253 |
254 | # SQL Server files
255 | *.mdf
256 | *.ldf
257 | *.ndf
258 |
259 | # Business Intelligence projects
260 | *.rdl.data
261 | *.bim.layout
262 | *.bim_*.settings
263 | *.rptproj.rsuser
264 | *- [Bb]ackup.rdl
265 | *- [Bb]ackup ([0-9]).rdl
266 | *- [Bb]ackup ([0-9][0-9]).rdl
267 |
268 | # Microsoft Fakes
269 | FakesAssemblies/
270 |
271 | # GhostDoc plugin setting file
272 | *.GhostDoc.xml
273 |
274 | # Node.js Tools for Visual Studio
275 | .ntvs_analysis.dat
276 | node_modules/
277 |
278 | # Visual Studio 6 build log
279 | *.plg
280 |
281 | # Visual Studio 6 workspace options file
282 | *.opt
283 |
284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
285 | *.vbw
286 |
287 | # Visual Studio LightSwitch build output
288 | **/*.HTMLClient/GeneratedArtifacts
289 | **/*.DesktopClient/GeneratedArtifacts
290 | **/*.DesktopClient/ModelManifest.xml
291 | **/*.Server/GeneratedArtifacts
292 | **/*.Server/ModelManifest.xml
293 | _Pvt_Extensions
294 |
295 | # Paket dependency manager
296 | .paket/paket.exe
297 | paket-files/
298 |
299 | # FAKE - F# Make
300 | .fake/
301 |
302 | # CodeRush personal settings
303 | .cr/personal
304 |
305 | # Python Tools for Visual Studio (PTVS)
306 | __pycache__/
307 | *.pyc
308 |
309 | # Cake - Uncomment if you are using it
310 | # tools/**
311 | # !tools/packages.config
312 |
313 | # Tabs Studio
314 | *.tss
315 |
316 | # Telerik's JustMock configuration file
317 | *.jmconfig
318 |
319 | # BizTalk build output
320 | *.btp.cs
321 | *.btm.cs
322 | *.odx.cs
323 | *.xsd.cs
324 |
325 | # OpenCover UI analysis results
326 | OpenCover/
327 |
328 | # Azure Stream Analytics local run output
329 | ASALocalRun/
330 |
331 | # MSBuild Binary and Structured Log
332 | *.binlog
333 |
334 | # NVidia Nsight GPU debugger configuration file
335 | *.nvuser
336 |
337 | # MFractors (Xamarin productivity tool) working folder
338 | .mfractor/
339 |
340 | # Local History for Visual Studio
341 | .localhistory/
342 |
343 | # BeatPulse healthcheck temp database
344 | healthchecksdb
345 |
346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
347 | MigrationBackup/
348 |
349 | # Ionide (cross platform F# VS Code tools) working folder
350 | .ionide/
351 |
352 | jxlgui.buildinfo/assets/commitid
353 | jxlgui.buildinfo/assets/date
354 | jxlgui.buildinfo/assets/version
355 | hooks/
356 | lfs/
357 |
--------------------------------------------------------------------------------
/jxlgui.wpf/Views/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
51 |
52 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
85 |
86 |
87 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
111 |
112 |
113 |
115 |
116 |
117 |
118 |
120 |
121 |
122 |
124 |
126 |
127 |
128 |
129 |
130 |
132 |
133 |
134 |
136 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
148 |
150 |
151 |
152 |
153 |
--------------------------------------------------------------------------------
/jxlgui.converter/JobManager.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.Threading.Tasks.Dataflow;
3 | using CommunityToolkit.Mvvm.ComponentModel;
4 |
5 | namespace jxlgui.converter;
6 |
7 | public class JobManager
8 | {
9 | private readonly BufferBlock jobs = new();
10 |
11 | public JobManager()
12 | {
13 | var consumerTask = ConsumeAsync(this.jobs);
14 | }
15 |
16 | public void Add(Job job)
17 | {
18 | this.jobs.Post(job);
19 | }
20 |
21 | private static async Task ConsumeAsync(ISourceBlock source)
22 | {
23 | while (await source.OutputAvailableAsync())
24 | {
25 | var job = await source.ReceiveAsync();
26 | job.State = Job.JobStateEnum.Working;
27 | var result = await ExecuteImageOperationAsync(job);
28 |
29 | job.State = result.State;
30 | job.ProcessOutput = result.Output;
31 | }
32 |
33 | return 0;
34 | }
35 |
36 | private static async Task ExecuteImageOperationAsync(Job job)
37 | {
38 | var filename = GetFileName(job);
39 | var arguments = GetArguments(job);
40 |
41 | var r = await RunProcessAsync(filename, arguments);
42 |
43 |
44 | var state = r.returnCode == 0 ? Job.JobStateEnum.Done : Job.JobStateEnum.Error;
45 |
46 | return new ExecuteImageOperationResult
47 | {
48 | State = state,
49 | Output = r.output
50 | };
51 | }
52 |
53 | private static string GetArguments(Job job)
54 | {
55 | if (job == null)
56 | throw new ArgumentNullException(nameof(job));
57 |
58 | string? targetFilePath;
59 | FileInfo fileInfo = new FileInfo(job.FilePath);
60 | if (!fileInfo.Exists)
61 | throw new FileNotFoundException(job.FilePath);
62 |
63 | var directoryName = fileInfo.DirectoryName;
64 | if (directoryName == null)
65 | throw new Exception("Directory name is null");
66 |
67 | switch (job.Operation)
68 | {
69 | case Job.OperationEnum.Encode:
70 | targetFilePath = $"{Path.Combine(directoryName, job.FileName)}.jxl";
71 | break;
72 | case Job.OperationEnum.Decode:
73 | targetFilePath = $"{Path.Combine(directoryName, job.FileName)}.png";
74 | break;
75 | default:
76 | throw new Exception($"{job.Operation} should be Encode or Decode");
77 | }
78 |
79 | job.TargetFilePath = targetFilePath;
80 |
81 | switch (job.Operation)
82 | {
83 | case Job.OperationEnum.Encode:
84 | if (job.Config == null)
85 | throw new ArgumentNullException(nameof(job.Config));
86 |
87 | var args = $"-e {job.Config.Effort} ";
88 |
89 | if (job.Config.Quality.HasValue)
90 | {
91 | var quality = job.Config.Quality.Value.ToString("N3", System.Globalization.CultureInfo.InvariantCulture);
92 | args+= $" -q {quality} ";
93 | }
94 |
95 | if (job.Config.Distance.HasValue)
96 | {
97 | var distance = job.Config.Distance.Value.ToString("N3", System.Globalization.CultureInfo.InvariantCulture);
98 | args+= $" --distance {distance} ";
99 | }
100 |
101 | args += $" \"{job.FilePath}\" \"{job.TargetFilePath}\" ";
102 | return args;
103 |
104 | case Job.OperationEnum.Decode:
105 | return $" \"{job.FilePath}\" \"{job.TargetFilePath}\"";
106 | default:
107 | throw new Exception($"{job.Operation} should be Encode or Decode");
108 | }
109 | }
110 |
111 | private static string GetFileName(Job job)
112 | {
113 | switch (job.Operation)
114 | {
115 | case Job.OperationEnum.Encode:
116 | return Constants.EncoderFilePath;
117 | case Job.OperationEnum.Decode:
118 | return Constants.DecoderFilePath;
119 | default:
120 | throw new Exception($"{job.Operation} should be Encode or Decode");
121 | }
122 | }
123 |
124 | private static Task<(int returnCode, string output)> RunProcessAsync(string fileName, string arguments)
125 | {
126 | var tcs = new TaskCompletionSource<(int returnCode, string output)>();
127 |
128 | var process = new Process
129 | {
130 | StartInfo =
131 | {
132 | FileName = fileName,
133 | Arguments = arguments,
134 | WindowStyle = ProcessWindowStyle.Hidden,
135 | UseShellExecute = false,
136 | RedirectStandardOutput = true,
137 | RedirectStandardError = true,
138 | CreateNoWindow = true
139 | },
140 | EnableRaisingEvents = true
141 | };
142 |
143 |
144 | process.Exited += (sender, args) =>
145 | {
146 | var line = "";
147 | while (!process.StandardOutput.EndOfStream)
148 | line += process.StandardOutput.ReadLine() + Environment.NewLine;
149 | while (!process.StandardError.EndOfStream)
150 | line += process.StandardError.ReadLine() + Environment.NewLine;
151 |
152 | tcs.SetResult((process.ExitCode, line));
153 | process.Dispose();
154 | };
155 |
156 | process.Start();
157 |
158 | return tcs.Task;
159 | }
160 |
161 | private class ExecuteImageOperationResult
162 | {
163 | public Job.JobStateEnum State { get; internal set; }
164 | public required string Output { get; set; }
165 | }
166 | }
167 |
168 | ///
169 | /// TODO ObservableObject should not be here
170 | ///
171 | public class Job : ObservableObject
172 | {
173 | public enum JobStateEnum
174 | {
175 | Pending,
176 | Done,
177 | Error,
178 | Working
179 | }
180 |
181 | public enum OperationEnum
182 | {
183 | Undef,
184 | Encode,
185 | Decode
186 | }
187 |
188 | private JobStateEnum state;
189 | private string? targetFileFormattedLength;
190 |
191 |
192 | public required string FilePath { get; init; }
193 | public required string FileName { get; init; }
194 | public long Length { get; init; }
195 |
196 | public JobStateEnum State
197 | {
198 | get => this.state;
199 | internal set
200 | {
201 | this.SetProperty(ref this.state, value);
202 | if (value == JobStateEnum.Done && this.TargetFilePath != null)
203 | {
204 | var fi = new FileInfo(this.TargetFilePath);
205 | if (fi.Exists)
206 | {
207 | this.TargetFileLength = fi.Length;
208 | this.TargetFileFormattedLength = GetFormattedLength(fi.Length);
209 | }
210 | }
211 | }
212 | }
213 |
214 | public required FileInfo FileInfo { get; init; }
215 |
216 | public OperationEnum Operation => GetOperation(this.FileInfo);
217 |
218 | public required string FormattedLength { get; init; }
219 |
220 | private Config? config;
221 |
222 | public Config? Config
223 | {
224 | get => config;
225 | set => base.SetProperty(ref config, value);
226 | }
227 |
228 | public string? TargetFilePath { get; internal set; }
229 | public long TargetFileLength { get; internal set; }
230 |
231 | public string? TargetFileFormattedLength
232 | {
233 | get => this.targetFileFormattedLength;
234 | internal set => this.SetProperty(ref this.targetFileFormattedLength, value);
235 | }
236 |
237 | public string ProcessOutput { get; set; } = "Waiting for process output";
238 |
239 | public static Job Create(string filepath, Config config)
240 | {
241 | var fi = new FileInfo(filepath);
242 | var job = new Job
243 | {
244 | FilePath = fi.FullName,
245 | FileName = fi.Name,
246 | Length = fi.Length,
247 | FileInfo = fi,
248 | FormattedLength = GetFormattedLength(fi.Length),
249 | Config = GetOperation(fi) == OperationEnum.Encode ? config : null,
250 | };
251 |
252 | return job;
253 | }
254 |
255 | private static string GetFormattedLength(double len)
256 | {
257 | string[] sizes = { "B", "KB", "MB", "GB", "TB" };
258 | var order = 0;
259 | while (len >= 1024 && order < sizes.Length - 1)
260 | {
261 | order++;
262 | len = len / 1024;
263 | }
264 |
265 | // Adjust the format string to your preferences. For example "{0:0.#}{1}" would
266 | // show a single decimal place, and no space.
267 | var result = $"{len:0.##} {sizes[order]}";
268 | return result;
269 | }
270 |
271 | private static OperationEnum GetOperation(FileInfo fileInfo)
272 | {
273 | if (fileInfo == null)
274 | return OperationEnum.Undef;
275 |
276 | var ext = fileInfo.Extension.ToLowerInvariant();
277 |
278 | if (Constants.ExtensionsDecode.Any(e => e == ext)) return OperationEnum.Decode;
279 | if (Constants.ExtensionsEncode.Any(e => e == ext)) return OperationEnum.Encode;
280 | return OperationEnum.Undef;
281 | }
282 |
283 | public static Job GetDesignDate(JobStateEnum state)
284 | {
285 | if (state is JobStateEnum.Pending)
286 | {
287 | return new Job
288 | {
289 | FileName = "pic1.png",
290 | FilePath = "C:\\Users\\User\\Pictures\\pic1.png",
291 | TargetFilePath = "C:\\Users\\User\\Pictures\\pic1.png.avif",
292 | FileInfo = new FileInfo("C:\\Users\\User\\Pictures\\pic1.png"),
293 | State = state,
294 | FormattedLength = "131 KB",
295 | Config = null
296 | };
297 | }
298 |
299 | if (state is JobStateEnum.Working)
300 | {
301 | return new Job
302 | {
303 | FileName = "pic1.png",
304 | FilePath = "C:\\Users\\User\\Pictures\\pic1.png",
305 | TargetFilePath = "C:\\Users\\User\\Pictures\\pic1.png.avif",
306 | FileInfo = new FileInfo("C:\\Users\\User\\Pictures\\pic1.png"),
307 | State = state,
308 | FormattedLength = "131 KB",
309 | Config = new Config
310 | {
311 | Quality = 90,
312 | Effort = 6,
313 | }
314 | };
315 | }
316 |
317 | return new Job
318 | {
319 | FileName = "pic1.png",
320 | FilePath = "C:\\Users\\User\\Pictures\\pic1.png",
321 | TargetFilePath = "C:\\Users\\User\\Pictures\\pic1.png.avif",
322 | FileInfo = new FileInfo("C:\\Users\\User\\Pictures\\pic1.png"),
323 | State = state,
324 | FormattedLength = "132 KB",
325 | TargetFileFormattedLength = "80 KB",
326 | Config = new Config
327 | {
328 | Quality = 90,
329 | Effort = 6,
330 | }
331 | };
332 | }
333 | }
--------------------------------------------------------------------------------
/jxlgui.converter/assets/LICENSE.highway:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
--------------------------------------------------------------------------------
/jxlgui.converter/assets/LICENSE.sjpeg:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------