├── 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 | 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 | --------------------------------------------------------------------------------