diff --git a/ComicRack.Engine/EngineConfiguration.cs b/ComicRack.Engine/EngineConfiguration.cs index 51062817..4066bb4a 100644 --- a/ComicRack.Engine/EngineConfiguration.cs +++ b/ComicRack.Engine/EngineConfiguration.cs @@ -588,9 +588,15 @@ public bool DisableNTFS set; } - public static EngineConfiguration Default => defaultConfig ?? (defaultConfig = IniFile.Default.Register()); + [DefaultValue(7)] // Valid value are 1-9 + public int JpegXLEncoderEffort { get; set; } - public EngineConfiguration() + public static EngineConfiguration Default => defaultConfig ?? (defaultConfig = IniFile.Default.Register()); + + [DefaultValue(false)] + public bool ForceJpegReconstruction { get; set; } // This is for the JpegXL encoder to force lossless reconstruction to JPEGs, tricks the conversion by saving the Bitmap to a Jpeg byte array so the resulting image is reconstrutable. Only applies when using the lossless compression export setting. Should not be used as it will cause a quality loss because of the Jpeg conversion step. + + public EngineConfiguration() { PageScrollingDuration = 1000; AnimationDuration = 250; @@ -650,7 +656,9 @@ public EngineConfiguration() PdfEngineToUse = PdfEngine.Pdfium; PdfiumImageSize = new Size(1920, 2540); DisableNTFS = false; - } + JpegXLEncoderEffort = 7; + ForceJpegReconstruction = false; + } public string GetTempFileName() { diff --git a/ComicRack.Engine/IO/Provider/ImageProvider.cs b/ComicRack.Engine/IO/Provider/ImageProvider.cs index 5a81c674..2b6fc2b2 100644 --- a/ComicRack.Engine/IO/Provider/ImageProvider.cs +++ b/ComicRack.Engine/IO/Provider/ImageProvider.cs @@ -259,7 +259,8 @@ private byte[] RetrieveSourceByteImage(int n, bool keepSourceFormat = false) array = WebpImage.ConvertToJpeg(array); array = HeifAvifImage.ConvertToJpeg(array); array = Jpeg2000Image.ConvertToJpeg(array); - } + array = JpegXLImage.ConvertToJpeg(array); + } return array; } catch (Exception) diff --git a/ComicRack.Engine/IO/Provider/JpegXLImage.cs b/ComicRack.Engine/IO/Provider/JpegXLImage.cs new file mode 100644 index 00000000..f1a1cadd --- /dev/null +++ b/ComicRack.Engine/IO/Provider/JpegXLImage.cs @@ -0,0 +1,781 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Imaging; +using System.Linq; +using System.Runtime.InteropServices; +using cYo.Common.Drawing; + +namespace cYo.Projects.ComicRack.Engine.IO.Provider +{ + /// + /// Provides JPEG XL encoding and decoding functionality using libjxl. + /// + public static class JpegXLImage + { + #region Native Methods + + public static class NativeMethods + { + private const string JxlLibrary = "jxl.dll"; + + #region Decoder Functions + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr JxlDecoderCreate(IntPtr memoryManager); + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern void JxlDecoderDestroy(IntPtr decoder); + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlDecoderStatus JxlDecoderSubscribeEvents(IntPtr decoder, int eventsWanted); + + [CLSCompliant(false)] + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlDecoderStatus JxlDecoderSetInput(IntPtr decoder, byte[] data, UIntPtr size); + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlDecoderStatus JxlDecoderProcessInput(IntPtr decoder); + + [CLSCompliant(false)] + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlDecoderStatus JxlDecoderGetBasicInfo(IntPtr decoder, out JxlBasicInfo info); + + [CLSCompliant(false)] + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlDecoderStatus JxlDecoderImageOutBufferSize(IntPtr decoder, ref JxlPixelFormat format, out UIntPtr size); + + [CLSCompliant(false)] + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlDecoderStatus JxlDecoderSetImageOutBuffer(IntPtr decoder, ref JxlPixelFormat format, IntPtr buffer, UIntPtr size); + + #endregion + + #region Encoder Functions + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr JxlEncoderCreate(IntPtr memoryManager); + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern void JxlEncoderDestroy(IntPtr encoder); + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr JxlEncoderFrameSettingsCreate(IntPtr encoder, IntPtr frameSettingsSource); + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlEncoderStatus JxlEncoderSetFrameDistance(IntPtr frameSettings, float distance); + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlEncoderStatus JxlEncoderSetFrameLossless(IntPtr frameSettings, int lossless); + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlEncoderStatus JxlEncoderFrameSettingsSetOption(IntPtr frameSettings, JxlEncoderFrameSettingId option, long value); + + [CLSCompliant(false)] + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlEncoderStatus JxlEncoderSetBasicInfo(IntPtr encoder, ref JxlBasicInfo info); + + [CLSCompliant(false)] + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlEncoderStatus JxlEncoderAddImageFrame(IntPtr frameSettings, ref JxlPixelFormat format, IntPtr buffer, UIntPtr size); + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern void JxlEncoderCloseFrames(IntPtr encoder); + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern void JxlEncoderCloseInput(IntPtr encoder); + + [CLSCompliant(false)] + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static unsafe extern JxlEncoderStatus JxlEncoderProcessOutput(IntPtr encoder, byte** nextOut, UIntPtr* availOut); + + [CLSCompliant(false)] + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern void JxlColorEncodingSetToSRGB(ref JxlColorEncoding colorEncoding, int isGray); + + [CLSCompliant(false)] + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlEncoderStatus JxlEncoderSetColorEncoding(IntPtr encoder, ref JxlColorEncoding colorEncoding); + + [CLSCompliant(false)] + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlEncoderStatus JxlEncoderAddJPEGFrame(IntPtr frameSettings, byte[] buffer, UIntPtr size); + + [DllImport(JxlLibrary, CallingConvention = CallingConvention.Cdecl)] + public static extern JxlEncoderStatus JxlEncoderStoreJPEGMetadata(IntPtr encoder, int storeJpegMetadata); + + #endregion + + #region Enums + + public enum JxlDecoderStatus + { + Success = 0, + Error = 1, + NeedMoreInput = 2, + NeedImageOutBuffer = 5, + BasicInfo = 0x40, + FullImage = 0x1000, + } + + public enum JxlEncoderStatus + { + Success = 0, + Error = 1, + NeedMoreOutput = 2, + } + + public enum JxlDataType + { + Uint8 = 2, + } + + public enum JxlEncoderFrameSettingId + { + /// + /// Sets encoder effort/speed level without affecting decoding speed. Valid + /// values are, from faster to slower speed: 1:lightning 2:thunder 3:falcon + /// 4:cheetah 5:hare 6:wombat 7:squirrel 8:kitten 9:tortoise. + /// Default: squirrel (7). + /// + Effort = 0, + + /// + /// Sets the decoding speed tier for the provided options. Minimum is 0 + /// (slowest to decode, best quality/density), and maximum is 4 (fastest to + /// decode, at the cost of some quality/density). Default is 0. + /// + DecodingSpeed = 1, + } + + #endregion + + #region Structures + + [CLSCompliant(false)] + [StructLayout(LayoutKind.Sequential)] + public struct JxlPixelFormat + { + public uint num_channels; + public JxlDataType data_type; + public uint endianness; + public UIntPtr align; + } + + [CLSCompliant(false)] + [StructLayout(LayoutKind.Sequential)] + public struct JxlBasicInfo + { + public uint have_container; + public uint xsize; + public uint ysize; + public uint bits_per_sample; + public uint exponent_bits_per_sample; + public float intensity_target; + public float min_nits; + public uint relative_to_max_display; + public float linear_below; + public uint uses_original_profile; + public uint have_preview; + public uint have_animation; + public uint orientation; + public uint num_color_channels; + public uint num_extra_channels; + public uint alpha_bits; + public uint alpha_exponent_bits; + public uint alpha_premultiplied; + public uint preview_xsize; + public uint preview_ysize; + public ulong animation_tps_numerator; + public ulong animation_tps_denominator; + public uint animation_num_loops; + public uint animation_have_timecodes; + public uint intrinsic_xsize; + public uint intrinsic_ysize; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public byte[] padding; + } + + [CLSCompliant(false)] + [StructLayout(LayoutKind.Sequential)] + public struct JxlColorEncoding + { + public uint color_space; // JxlColorSpace + public uint white_point; // JxlWhitePoint + public uint primaries; // JxlPrimaries + public uint transfer_function; // JxlTransferFunction + public uint rendering_intent; // JxlRenderingIntent + } + + #endregion + } + + #endregion + + #region API + + /// + /// Converts a JPEG XL byte array to JPEG format. + /// + /// JPEG XL image data + /// JPEG image data, or original data if not a valid JXL file + public static byte[] ConvertToJpeg(byte[] data) + { + if (!IsSupported(data)) + return data; + + try + { + using (Bitmap image = DecodeFromBytes(data)) + { + return image.ImageToJpegBytes(); + } + } + catch (Exception) + { + return data; + } + } + + /// + /// Decodes JPEG XL data into a Bitmap. + /// + private static Bitmap DecodeFromBytes(byte[] data) + { + IntPtr decoder = NativeMethods.JxlDecoderCreate(IntPtr.Zero); + if (decoder == IntPtr.Zero) + throw new Exception("Failed to create JXL decoder"); + + try + { + // Subscribe to basic info and full image events + const int eventsWanted = (int)(NativeMethods.JxlDecoderStatus.BasicInfo | NativeMethods.JxlDecoderStatus.FullImage); + CheckDecoderStatus( + NativeMethods.JxlDecoderSubscribeEvents(decoder, eventsWanted), + "Failed to subscribe to decoder events"); + + // Set input data + CheckDecoderStatus( + NativeMethods.JxlDecoderSetInput(decoder, data, new UIntPtr((ulong)data.Length)), + "Failed to set decoder input"); + + // Process decoder events and get image + return ProcessDecoderEvents(decoder); + } + finally + { + NativeMethods.JxlDecoderDestroy(decoder); + } + } + + /// + /// Checks if the data is a valid JPEG XL file. + /// + public static bool IsSupported(byte[] data) + { + if (data == null || data.Length < 2 || !Environment.Is64BitProcess) + return false; + + // Check for JXL container format header + if (data.Length >= 12) + { + byte[] jxlSignature = { 0x00, 0x00, 0x00, 0x0C, 0x4A, 0x58, 0x4C, 0x20, 0x0D, 0x0A, 0x87, 0x0A }; + if (data.Take(12).SequenceEqual(jxlSignature)) + return true; + } + + // Check for JXL codestream header + if (data.Length >= 2) + { + byte[] jxlSignature = { 0xFF, 0x0A }; + if (data.Take(2).SequenceEqual(jxlSignature)) + return true; + } + + return false; + } + + private static bool IsJpeg(byte[] data) + { + if (data == null || data.Length < 2) + return false; + + // Check for JPEG SOI marker + byte[] jxlSignature = { 0xFF, 0xD8 }; + if (data.Take(2).SequenceEqual(jxlSignature)) + return true; + + return false; + } + + /// + /// Converts a Bitmap to JPEG XL format. + /// + /// Source bitmap + /// Quality level 0-100 (only for lossy compression) + /// Use lossless compression + /// Compression effort 1-9 (higher = better compression but slower) + /// JPEG XL encoded data + public static byte[] ConvertToJpegXL(Bitmap bitmap, int quality = 70, bool lossless = true, int effort = 7, bool forceJpeg = false) + { + if (bitmap == null) + throw new ArgumentNullException(nameof(bitmap)); + + if (forceJpeg && lossless) + { + // If forcing JPEG, encode to JPEG first and then use lossless JPEG recompression + byte[] jpegData = bitmap.ImageToJpegBytes(quality); + return ConvertJpegToJpegXL(jpegData, effort); + } + + IntPtr encoder = NativeMethods.JxlEncoderCreate(IntPtr.Zero); + if (encoder == IntPtr.Zero) + throw new Exception("Failed to create JXL encoder"); + + try + { + // Configure encoder with image metadata + ConfigureEncoder(encoder, bitmap); + + // Get frame settings and configure quality/effort + IntPtr frameSettings = NativeMethods.JxlEncoderFrameSettingsCreate(encoder, IntPtr.Zero); + ConfigureFrameSettings(frameSettings, quality, lossless, effort); + + // Convert bitmap to raw pixel data and add to encoder + AddBitmapFrame(encoder, frameSettings, bitmap); + + // Finalize and get encoded output + return GetEncodedOutput(encoder); + } + finally + { + NativeMethods.JxlEncoderDestroy(encoder); + } + } + + /// + /// Converts JPEG data to JPEG XL using lossless JPEG recompression. + /// This preserves the original JPEG and allows perfect reconstruction. + /// + /// Original JPEG file bytes + /// Compression effort 1-9 + /// JPEG XL encoded data that can be perfectly reconstructed to the original JPEG + public static byte[] ConvertJpegToJpegXL(byte[] jpegData, int effort = 7) + { + // Verify it's actually a JPEG + if (!IsJpeg(jpegData)) + throw new ArgumentException("Input is not a valid JPEG file"); + + IntPtr encoder = NativeMethods.JxlEncoderCreate(IntPtr.Zero); + if (encoder == IntPtr.Zero) + throw new Exception("Failed to create JXL encoder"); + + try + { + // Enable JPEG metadata storage for perfect reconstruction + CheckEncoderStatus( + NativeMethods.JxlEncoderStoreJPEGMetadata(encoder, 1), + "Failed to enable JPEG metadata storage"); + + // Get frame settings and configure quality/effort + IntPtr frameSettings = NativeMethods.JxlEncoderFrameSettingsCreate(encoder, IntPtr.Zero); + ConfigureFrameSettings(frameSettings, quality: 100, lossless: true, effort); + + // Add JPEG frame directly - this reads JPEG headers and sets basic info automatically + CheckEncoderStatus( + NativeMethods.JxlEncoderAddJPEGFrame(frameSettings, jpegData, new UIntPtr((ulong)jpegData.Length)), + "Failed to add JPEG frame"); + + return GetEncodedOutput(encoder); + } + finally + { + NativeMethods.JxlEncoderDestroy(encoder); + } + } + + #endregion + + #region Decoding + + /// + /// Processes decoder events and extracts the image. + /// + private static Bitmap ProcessDecoderEvents(IntPtr decoder) + { + NativeMethods.JxlBasicInfo info = default; + IntPtr pixels = IntPtr.Zero; + int width = 0, height = 0; + bool hasAlpha = false; + + try + { + while (true) + { + var status = NativeMethods.JxlDecoderProcessInput(decoder); + + switch (status) + { + case NativeMethods.JxlDecoderStatus.BasicInfo: + CheckDecoderStatus( + NativeMethods.JxlDecoderGetBasicInfo(decoder, out info), + "Failed to get basic info"); + + width = (int)info.xsize; + height = (int)info.ysize; + hasAlpha = info.num_extra_channels > 0; + break; + + case NativeMethods.JxlDecoderStatus.NeedImageOutBuffer: + pixels = AllocateDecoderBuffer(decoder, width, height, hasAlpha); + break; + + case NativeMethods.JxlDecoderStatus.FullImage: + case NativeMethods.JxlDecoderStatus.Success: + return ConvertPixelsToBitmap(pixels, width, height, hasAlpha); + + default: + throw new Exception($"Decoder error: {status}"); + } + } + } + finally + { + if (pixels != IntPtr.Zero) + Marshal.FreeHGlobal(pixels); + } + } + + /// + /// Allocates buffer for decoded image data. + /// + private static IntPtr AllocateDecoderBuffer(IntPtr decoder, int width, int height, bool hasAlpha) + { + var format = new NativeMethods.JxlPixelFormat + { + num_channels = hasAlpha ? 4u : 3u, + data_type = NativeMethods.JxlDataType.Uint8, + endianness = 0, + align = UIntPtr.Zero + }; + + CheckDecoderStatus( + NativeMethods.JxlDecoderImageOutBufferSize(decoder, ref format, out UIntPtr bufferSize), + "Failed to get buffer size"); + + IntPtr pixels = Marshal.AllocHGlobal((int)bufferSize); + + CheckDecoderStatus( + NativeMethods.JxlDecoderSetImageOutBuffer(decoder, ref format, pixels, bufferSize), + "Failed to set output buffer"); + + return pixels; + } + + /// + /// Converts raw pixel data to a Bitmap, swapping RGB to BGR. + /// + private static Bitmap ConvertPixelsToBitmap(IntPtr pixels, int width, int height, bool hasAlpha) + { + if (pixels == IntPtr.Zero) + throw new InvalidOperationException("No pixel data available"); + + var pixelFormat = hasAlpha ? PixelFormat.Format32bppArgb : PixelFormat.Format24bppRgb; + Bitmap bitmap = new Bitmap(width, height, pixelFormat); + + BitmapData bmpData = bitmap.LockBits( + new Rectangle(0, 0, width, height), + ImageLockMode.WriteOnly, + pixelFormat); + + try + { + int srcBytesPerPixel = hasAlpha ? 4 : 3; + int srcStride = width * srcBytesPerPixel; + int dstBytesPerPixel = hasAlpha ? 4 : 3; + + unsafe + { + // Convert RGB(A) from JXL to BGR(A) for Bitmap + CopyAndSwapChannels( + width, height, + srcStride, bmpData.Stride, + (byte*)pixels, (byte*)bmpData.Scan0, + hasAlpha, srcBytesPerPixel, dstBytesPerPixel, + rgbToBgr: true); + } + + return bitmap; + } + catch + { + bitmap.Dispose(); + throw; + } + finally + { + bitmap.UnlockBits(bmpData); + } + } + + #endregion + + #region Encoding + + /// + /// Configures encoder with basic image information. + /// + private static void ConfigureEncoder(IntPtr encoder, Bitmap bitmap) + { + bool hasAlpha = bitmap.PixelFormat == PixelFormat.Format32bppArgb; + + var info = new NativeMethods.JxlBasicInfo + { + have_container = 0, + xsize = (uint)bitmap.Width, // required + ysize = (uint)bitmap.Height, // required + bits_per_sample = 8, // required + exponent_bits_per_sample = 0, + intensity_target = 255.0f, // SDR brightness + min_nits = 0.0f, + relative_to_max_display = 0, + linear_below = 0.0f, + uses_original_profile = 0, // setting this to 1 when lossless will include the original color profile instead of simply sRGB. But it increases size by 250%, not sure it is worth it especially since it requires special decoding options + have_preview = 0, + have_animation = 0, + orientation = 1, // required to prevent "Failed to set basic info" + num_color_channels = 3,// required + num_extra_channels = hasAlpha ? 1u : 0u, // required + alpha_bits = hasAlpha ? 8u : 0u, // important if hasAlpha is true + alpha_exponent_bits = 0, + alpha_premultiplied = 0, + preview_xsize = 0, + preview_ysize = 0, + animation_tps_numerator = 0, + animation_tps_denominator = 0, + animation_num_loops = 0, + animation_have_timecodes = 0, + intrinsic_xsize = (uint)bitmap.Width, + intrinsic_ysize = (uint)bitmap.Height, + padding = new byte[4] + }; + + CheckEncoderStatus( + NativeMethods.JxlEncoderSetBasicInfo(encoder, ref info), + "Failed to set basic info"); + + // Set sRGB color encoding + var colorEncoding = new NativeMethods.JxlColorEncoding(); + NativeMethods.JxlColorEncodingSetToSRGB(ref colorEncoding, 0); + + CheckEncoderStatus( + NativeMethods.JxlEncoderSetColorEncoding(encoder, ref colorEncoding), + "Failed to set color encoding"); + } + + /// + /// Configures frame settings for quality and compression. + /// + private static void ConfigureFrameSettings(IntPtr frameSettings, int quality, bool lossless, int effort) + { + if (lossless) + { + // this overrides a set of existing options (such as distance, modular mode and color transform) that enables bit-for-bit lossless encoding. + NativeMethods.JxlEncoderSetFrameLossless(frameSettings, 1); + } + else + { + // Convert quality (0-100) to distance (0.0-15.0) + // 0.0 = mathematically lossless, 1.0 = visually lossless, recommended range: 0.5 to 3.0 (95% to 67%) + float distance = 0.1f + (100 - quality) * 0.09f; + CheckEncoderStatus( + NativeMethods.JxlEncoderSetFrameDistance(frameSettings, distance), + "Failed to set frame distance"); + } + + // Set compression effort (1-9) + CheckEncoderStatus( + NativeMethods.JxlEncoderFrameSettingsSetOption( + frameSettings, + NativeMethods.JxlEncoderFrameSettingId.Effort, + effort), + "Failed to set effort"); + } + + /// + /// Converts bitmap to raw pixels and adds to encoder. + /// + private static void AddBitmapFrame(IntPtr encoder, IntPtr frameSettings, Bitmap bitmap) + { + bool hasAlpha = bitmap.PixelFormat == PixelFormat.Format32bppArgb; + int bytesPerPixel = hasAlpha ? 4 : 3; + int stride = bitmap.Width * bytesPerPixel; + int bufferSize = bitmap.Height * stride; + + IntPtr pixels = Marshal.AllocHGlobal(bufferSize); + try + { + // Lock bitmap and copy pixel data + BitmapData bmpData = bitmap.LockBits( + new Rectangle(0, 0, bitmap.Width, bitmap.Height), + ImageLockMode.ReadOnly, + bitmap.PixelFormat); + + try + { + int srcBytesPerPixel = hasAlpha ? 4 : 3; + + unsafe + { + // Convert BGR(A) from Bitmap to RGB(A) for JXL + CopyAndSwapChannels( + bitmap.Width, bitmap.Height, + bmpData.Stride, stride, + (byte*)bmpData.Scan0, (byte*)pixels, + hasAlpha, srcBytesPerPixel, bytesPerPixel, + rgbToBgr: false); + } + } + finally + { + bitmap.UnlockBits(bmpData); + } + + // Configure pixel format + var format = new NativeMethods.JxlPixelFormat + { + num_channels = (uint)bytesPerPixel, + data_type = NativeMethods.JxlDataType.Uint8, + endianness = 0, + align = new UIntPtr((ulong)stride) // Must match stride + }; + + // Add frame to encoder + CheckEncoderStatus( + NativeMethods.JxlEncoderAddImageFrame(frameSettings, ref format, pixels, new UIntPtr((ulong)bufferSize)), + "Failed to add image frame"); + } + finally + { + if (pixels != IntPtr.Zero) + Marshal.FreeHGlobal(pixels); + } + } + + /// + /// Finalizes encoding and retrieves output data. + /// + private static byte[] GetEncodedOutput(IntPtr encoder) + { + // Finalize the encoding + NativeMethods.JxlEncoderCloseFrames(encoder); + NativeMethods.JxlEncoderCloseInput(encoder); + + var outputList = new List(); + byte[] outputBuffer = new byte[64 * 1024]; + + GCHandle handle = GCHandle.Alloc(outputBuffer, GCHandleType.Pinned); + try + { + unsafe + { + byte* bufferPtr = (byte*)handle.AddrOfPinnedObject(); + + while (true) + { + byte* nextOut = bufferPtr; + UIntPtr availOut = new UIntPtr((ulong)outputBuffer.Length); + + var status = NativeMethods.JxlEncoderProcessOutput(encoder, &nextOut, &availOut); + + // Calculate bytes written (nextOut advances as data is written) + int bytesWritten = (int)(nextOut - bufferPtr); + + if (bytesWritten > 0) + outputList.AddRange(outputBuffer.Take(bytesWritten)); + + if (status == NativeMethods.JxlEncoderStatus.Success) + break; + else if (status == NativeMethods.JxlEncoderStatus.NeedMoreOutput) + continue; + else + throw new Exception($"Encoder error: {status}"); + } + } + } + finally + { + handle.Free(); + } + + return outputList.ToArray(); + } + + #endregion + + #region Helper Methods + + /// + /// Copies and swaps RGB/BGR channels between buffers. + /// + private static unsafe void CopyAndSwapChannels( + int width, int height, + int srcStride, int dstStride, + byte* srcScan0, byte* dstScan0, + bool hasAlpha, + int srcBytesPerPixel, int dstBytesPerPixel, + bool rgbToBgr) + { + for (int y = 0; y < height; y++) + { + byte* srcRow = srcScan0 + (y * srcStride); + byte* dstRow = dstScan0 + (y * dstStride); + + for (int x = 0; x < width; x++) + { + int srcPos = x * srcBytesPerPixel; + int dstPos = x * dstBytesPerPixel; + + if (rgbToBgr) + { + // RGB(A) to BGR(A) - for decoding + dstRow[dstPos + 0] = srcRow[srcPos + 2]; // B + dstRow[dstPos + 1] = srcRow[srcPos + 1]; // G + dstRow[dstPos + 2] = srcRow[srcPos + 0]; // R + if (hasAlpha) + dstRow[dstPos + 3] = srcRow[srcPos + 3]; // A + } + else + { + // BGR(A) to RGB(A) - for encoding + dstRow[dstPos + 0] = srcRow[srcPos + 2]; // R + dstRow[dstPos + 1] = srcRow[srcPos + 1]; // G + dstRow[dstPos + 2] = srcRow[srcPos + 0]; // B + if (hasAlpha) + dstRow[dstPos + 3] = srcRow[srcPos + 3]; // A + } + } + } + } + + /// + /// Validates decoder status and throws on error. + /// + private static void CheckDecoderStatus(NativeMethods.JxlDecoderStatus status, string message) + { + if (status != NativeMethods.JxlDecoderStatus.Success) + throw new Exception($"{message}: {status}"); + } + + /// + /// Validates encoder status and throws on error. + /// + private static void CheckEncoderStatus(NativeMethods.JxlEncoderStatus status, string message) + { + if (status != NativeMethods.JxlEncoderStatus.Success) + throw new Exception($"{message}: {status}"); + } + + #endregion + } +} \ No newline at end of file diff --git a/ComicRack.Engine/IO/Provider/Readers/ComicProvider.cs b/ComicRack.Engine/IO/Provider/Readers/ComicProvider.cs index b99acf0b..2b1b4783 100644 --- a/ComicRack.Engine/IO/Provider/Readers/ComicProvider.cs +++ b/ComicRack.Engine/IO/Provider/Readers/ComicProvider.cs @@ -26,7 +26,7 @@ public abstract class ComicProvider : ImageProvider, IInfoStorage "avif", "jp2", "j2k", - //"jxl", + "jxl", }; public bool UpdateEnabled => GetType().GetAttributes().FirstOrDefault((FileFormatAttribute f) => f.Format.Supports(base.Source))?.EnableUpdate ?? false; diff --git a/ComicRack.Engine/IO/Provider/StorageProvider.cs b/ComicRack.Engine/IO/Provider/StorageProvider.cs index 7585c549..a0b02e70 100644 --- a/ComicRack.Engine/IO/Provider/StorageProvider.cs +++ b/ComicRack.Engine/IO/Provider/StorageProvider.cs @@ -48,7 +48,8 @@ public Bitmap GetImage() array = DjVuImage.ConvertToJpeg(data); array = HeifAvifImage.ConvertToJpeg(data); array = Jpeg2000Image.ConvertToJpeg(data); - return BitmapExtensions.BitmapFromBytes(array); + array = JpegXLImage.ConvertToJpeg(data); + return BitmapExtensions.BitmapFromBytes(array); } public byte[] GetThumbnailData(StorageSetting setting) @@ -373,9 +374,9 @@ public static PageResult[] GetImages(IImageProvider provider, ComicPageInfo cpi, ".webp" => StoragePageType.Webp, ".heif" or ".heic" => StoragePageType.Heif, ".avif" => StoragePageType.Avif, - //".jp2" or ".j2k" => StoragePageType.Jpeg2000, - //".jxl" => StoragePageType.JpegXL, - _ => StoragePageType.Jpeg, + //".jp2" or ".j2k" => StoragePageType.Jpeg2000, + ".jxl" => StoragePageType.JpegXL, + _ => StoragePageType.Jpeg, }; private static string GetExtensionFromStoragePageType(StoragePageType storagePageType) => storagePageType switch @@ -389,23 +390,27 @@ public static PageResult[] GetImages(IImageProvider provider, ComicPageInfo cpi, StoragePageType.Heif => ".heif", StoragePageType.Avif => ".avif", //StoragePageType.Jpeg2000 => ".jp2", - //StoragePageType.JpegXL => ".jxl", + StoragePageType.JpegXL => ".jxl", // We can't infer if it's lossless or lossy from the extension _ => ".jpg", }; - private static byte[] ConvertImage(StoragePageType storagePageType, Bitmap bitmap, StorageSetting setting) => storagePageType switch + private static byte[] ConvertImage(StoragePageType storagePageType, Bitmap bitmap, StorageSetting setting) { - StoragePageType.Tiff => bitmap.ImageToBytes(ImageFormat.Tiff, 24), - StoragePageType.Png => bitmap.ImageToBytes(ImageFormat.Png, 24), - StoragePageType.Bmp => bitmap.ImageToBytes(ImageFormat.Bmp, 24), - StoragePageType.Gif => bitmap.ImageToBytes(ImageFormat.Gif, 8), - StoragePageType.Djvu => DjVuImage.ConvertToDjVu(bitmap), - StoragePageType.Webp => WebpImage.ConvertoToWebp(bitmap, setting.PageCompression), - StoragePageType.Heif => HeifAvifImage.ConvertToHeif(bitmap, setting.PageCompression, false), - StoragePageType.Avif => HeifAvifImage.ConvertToHeif(bitmap, setting.PageCompression, true), - //StoragePageType.Jpeg2000 => Jpeg2000Image.ConvertToJpeg2000(bitmap, setting.PageCompression, true), - //StoragePageType.JpegXL => JpegXLImage.ConvertToJpegXL(bitmap), - _ => bitmap.ImageToBytes(ImageFormat.Jpeg, 24, setting.PageCompression), - }; + EngineConfiguration ec = EngineConfiguration.Default; + return storagePageType switch + { + StoragePageType.Tiff => bitmap.ImageToBytes(ImageFormat.Tiff, 24), + StoragePageType.Png => bitmap.ImageToBytes(ImageFormat.Png, 24), + StoragePageType.Bmp => bitmap.ImageToBytes(ImageFormat.Bmp, 24), + StoragePageType.Gif => bitmap.ImageToBytes(ImageFormat.Gif, 8), + StoragePageType.Djvu => DjVuImage.ConvertToDjVu(bitmap), + StoragePageType.Webp => WebpImage.ConvertoToWebp(bitmap, setting.PageCompression), + StoragePageType.Heif => HeifAvifImage.ConvertToHeif(bitmap, setting.PageCompression, false), + StoragePageType.Avif => HeifAvifImage.ConvertToHeif(bitmap, setting.PageCompression, true), + //StoragePageType.Jpeg2000 => Jpeg2000Image.ConvertToJpeg2000(bitmap, setting.PageCompression, true), + StoragePageType.JpegXL => JpegXLImage.ConvertToJpegXL(bitmap, setting.PageCompression, setting.Lossless, ec.JpegXLEncoderEffort, ec.ForceJpegReconstruction), + _ => bitmap.ImageToBytes(ImageFormat.Jpeg, 24, setting.PageCompression), + }; + } } } diff --git a/ComicRack.Engine/IO/StoragePageType.cs b/ComicRack.Engine/IO/StoragePageType.cs index 7e5e0cbc..1961fda7 100644 --- a/ComicRack.Engine/IO/StoragePageType.cs +++ b/ComicRack.Engine/IO/StoragePageType.cs @@ -13,6 +13,6 @@ public enum StoragePageType Heif, Avif, //Jpeg2000, - //JpegXL, + JpegXL, } } diff --git a/ComicRack.Engine/IO/StorageSetting.cs b/ComicRack.Engine/IO/StorageSetting.cs index 9f77dc21..e63d6623 100644 --- a/ComicRack.Engine/IO/StorageSetting.cs +++ b/ComicRack.Engine/IO/StorageSetting.cs @@ -23,7 +23,14 @@ public ExportCompression ComicCompression set; } - [DefaultValue(true)] + [DefaultValue(false)] + public bool Lossless + { + get; + set; + } + + [DefaultValue(true)] public bool EmbedComicInfo { get; @@ -156,7 +163,8 @@ public StorageSetting() PageWidth = 1000; PageResize = StoragePageResize.Original; PageCompression = 75; - PageType = StoragePageType.Original; + Lossless = false; + PageType = StoragePageType.Original; RemovePages = true; RemovePageFilter = ComicPageType.Deleted; EmbedComicInfo = true; diff --git a/ComicRack/Dialogs/ExportComicsDialog.Designer.cs b/ComicRack/Dialogs/ExportComicsDialog.Designer.cs index 2f847a04..baedc14f 100644 --- a/ComicRack/Dialogs/ExportComicsDialog.Designer.cs +++ b/ComicRack/Dialogs/ExportComicsDialog.Designer.cs @@ -26,517 +26,519 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.contextRemovePageFilter = new System.Windows.Forms.ContextMenuStrip(this.components); - this.btCancel = new System.Windows.Forms.Button(); - this.btOK = new System.Windows.Forms.Button(); - this.tvPresets = new System.Windows.Forms.TreeView(); - this.btSavePreset = new System.Windows.Forms.Button(); - this.btRemovePreset = new System.Windows.Forms.Button(); - this.exportSettings = new System.Windows.Forms.Panel(); - this.grpImageProcessing = new cYo.Common.Windows.Forms.CollapsibleGroupBox(); - this.grpCustomProcessing = new System.Windows.Forms.GroupBox(); - this.labelGamma = new System.Windows.Forms.Label(); - this.tbGamma = new cYo.Common.Windows.Forms.TrackBarLite(); - this.tbSaturation = new cYo.Common.Windows.Forms.TrackBarLite(); - this.labelContrast = new System.Windows.Forms.Label(); - this.tbBrightness = new cYo.Common.Windows.Forms.TrackBarLite(); - this.labelSaturation = new System.Windows.Forms.Label(); - this.tbSharpening = new cYo.Common.Windows.Forms.TrackBarLite(); - this.tbContrast = new cYo.Common.Windows.Forms.TrackBarLite(); - this.labelSharpening = new System.Windows.Forms.Label(); - this.labelBrightness = new System.Windows.Forms.Label(); - this.btResetColors = new System.Windows.Forms.Button(); - this.labelImageProcessingCustom = new System.Windows.Forms.Label(); - this.cbImageProcessingSource = new System.Windows.Forms.ComboBox(); - this.labelImagProcessingSource = new System.Windows.Forms.Label(); - this.chkAutoContrast = new System.Windows.Forms.CheckBox(); - this.grpPageFormat = new cYo.Common.Windows.Forms.CollapsibleGroupBox(); - this.chkKeepOriginalNames = new System.Windows.Forms.CheckBox(); - this.labelDoublePages = new System.Windows.Forms.Label(); - this.cbDoublePages = new System.Windows.Forms.ComboBox(); - this.chkIgnoreErrorPages = new System.Windows.Forms.CheckBox(); - this.txHeight = new System.Windows.Forms.NumericUpDown(); - this.txWidth = new System.Windows.Forms.NumericUpDown(); - this.chkDontEnlarge = new System.Windows.Forms.CheckBox(); - this.labelPageResize = new System.Windows.Forms.Label(); - this.cbPageResize = new System.Windows.Forms.ComboBox(); - this.labelPageFormat = new System.Windows.Forms.Label(); - this.cbPageFormat = new System.Windows.Forms.ComboBox(); - this.labelPageQuality = new System.Windows.Forms.Label(); - this.tbQuality = new cYo.Common.Windows.Forms.TrackBarLite(); - this.labelX = new System.Windows.Forms.Label(); - this.grpFileFormat = new cYo.Common.Windows.Forms.CollapsibleGroupBox(); - this.txTagsToAppend = new cYo.Common.Windows.Forms.TextBoxEx(); - this.labelTagToAppend = new System.Windows.Forms.Label(); - this.txIncludePages = new System.Windows.Forms.TextBox(); - this.labelIncludePages = new System.Windows.Forms.Label(); - this.btRemovePageFilter = new System.Windows.Forms.Button(); - this.cbCompression = new System.Windows.Forms.ComboBox(); - this.labelCompression = new System.Windows.Forms.Label(); - this.chkEmbedComicInfo = new System.Windows.Forms.CheckBox(); - this.cbComicFormat = new System.Windows.Forms.ComboBox(); - this.labelComicFormat = new System.Windows.Forms.Label(); - this.txRemovedPages = new System.Windows.Forms.Label(); - this.labelRemovePageFilter = new System.Windows.Forms.Label(); - this.grpFileNaming = new cYo.Common.Windows.Forms.CollapsibleGroupBox(); - this.txCustomStartIndex = new System.Windows.Forms.NumericUpDown(); - this.labelCustomStartIndex = new System.Windows.Forms.Label(); - this.txCustomName = new System.Windows.Forms.TextBox(); - this.labelCustomNaming = new System.Windows.Forms.Label(); - this.cbNamingTemplate = new System.Windows.Forms.ComboBox(); - this.labelNamingTemplate = new System.Windows.Forms.Label(); - this.grpExportLocation = new cYo.Common.Windows.Forms.CollapsibleGroupBox(); - this.chkCombine = new System.Windows.Forms.CheckBox(); - this.chkOverwrite = new System.Windows.Forms.CheckBox(); - this.chkAddNewToLibrary = new System.Windows.Forms.CheckBox(); - this.chkDeleteOriginal = new System.Windows.Forms.CheckBox(); - this.btChooseFolder = new System.Windows.Forms.Button(); - this.txFolder = new System.Windows.Forms.Label(); - this.labelFolder = new System.Windows.Forms.Label(); - this.cbExport = new System.Windows.Forms.ComboBox(); - this.labelExportTo = new System.Windows.Forms.Label(); - this.toolTip = new System.Windows.Forms.ToolTip(this.components); - this.exportSettings.SuspendLayout(); - this.grpImageProcessing.SuspendLayout(); - this.grpCustomProcessing.SuspendLayout(); - this.grpPageFormat.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.txHeight)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.txWidth)).BeginInit(); - this.grpFileFormat.SuspendLayout(); - this.grpFileNaming.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.txCustomStartIndex)).BeginInit(); - this.grpExportLocation.SuspendLayout(); - this.SuspendLayout(); - // - // contextRemovePageFilter - // - this.contextRemovePageFilter.Name = "contextRemovePageFilter"; - this.contextRemovePageFilter.Size = new System.Drawing.Size(61, 4); - // - // btCancel - // - this.btCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.btCancel.Location = new System.Drawing.Point(660, 440); - this.btCancel.Name = "btCancel"; - this.btCancel.Size = new System.Drawing.Size(80, 24); - this.btCancel.TabIndex = 7; - this.btCancel.Text = "&Cancel"; - // - // btOK - // - this.btOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btOK.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.btOK.Location = new System.Drawing.Point(574, 440); - this.btOK.Name = "btOK"; - this.btOK.Size = new System.Drawing.Size(80, 24); - this.btOK.TabIndex = 6; - this.btOK.Text = "&OK"; - // - // tvPresets - // - this.tvPresets.Location = new System.Drawing.Point(14, 18); - this.tvPresets.Name = "tvPresets"; - this.tvPresets.ShowNodeToolTips = true; - this.tvPresets.Size = new System.Drawing.Size(220, 387); - this.tvPresets.TabIndex = 3; - this.tvPresets.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvPresets_AfterSelect); - // - // btSavePreset - // - this.btSavePreset.Location = new System.Drawing.Point(14, 411); - this.btSavePreset.Name = "btSavePreset"; - this.btSavePreset.Size = new System.Drawing.Size(107, 23); - this.btSavePreset.TabIndex = 4; - this.btSavePreset.Text = "Save,,,"; - this.btSavePreset.UseVisualStyleBackColor = true; - this.btSavePreset.Click += new System.EventHandler(this.btAddPreset_Click); - // - // btRemovePreset - // - this.btRemovePreset.Location = new System.Drawing.Point(127, 411); - this.btRemovePreset.Name = "btRemovePreset"; - this.btRemovePreset.Size = new System.Drawing.Size(107, 23); - this.btRemovePreset.TabIndex = 5; - this.btRemovePreset.Text = "Remove"; - this.btRemovePreset.UseVisualStyleBackColor = true; - this.btRemovePreset.Click += new System.EventHandler(this.btRemovePreset_Click); - // - // exportSettings - // - this.exportSettings.AutoScroll = true; - this.exportSettings.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.exportSettings.Controls.Add(this.grpImageProcessing); - this.exportSettings.Controls.Add(this.grpPageFormat); - this.exportSettings.Controls.Add(this.grpFileFormat); - this.exportSettings.Controls.Add(this.grpFileNaming); - this.exportSettings.Controls.Add(this.grpExportLocation); - this.exportSettings.Location = new System.Drawing.Point(240, 18); - this.exportSettings.Name = "exportSettings"; - this.exportSettings.Padding = new System.Windows.Forms.Padding(4); - this.exportSettings.Size = new System.Drawing.Size(500, 416); - this.exportSettings.TabIndex = 8; - // - // grpImageProcessing - // - this.grpImageProcessing.Controls.Add(this.grpCustomProcessing); - this.grpImageProcessing.Controls.Add(this.labelImageProcessingCustom); - this.grpImageProcessing.Controls.Add(this.cbImageProcessingSource); - this.grpImageProcessing.Controls.Add(this.labelImagProcessingSource); - this.grpImageProcessing.Controls.Add(this.chkAutoContrast); - this.grpImageProcessing.Dock = System.Windows.Forms.DockStyle.Top; - this.grpImageProcessing.Location = new System.Drawing.Point(4, 757); - this.grpImageProcessing.Name = "grpImageProcessing"; - this.grpImageProcessing.Size = new System.Drawing.Size(473, 290); - this.grpImageProcessing.TabIndex = 9; - this.grpImageProcessing.Text = "Image Processing"; - // - // grpCustomProcessing - // - this.grpCustomProcessing.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.components = new System.ComponentModel.Container(); + this.contextRemovePageFilter = new System.Windows.Forms.ContextMenuStrip(this.components); + this.btCancel = new System.Windows.Forms.Button(); + this.btOK = new System.Windows.Forms.Button(); + this.tvPresets = new System.Windows.Forms.TreeView(); + this.btSavePreset = new System.Windows.Forms.Button(); + this.btRemovePreset = new System.Windows.Forms.Button(); + this.exportSettings = new System.Windows.Forms.Panel(); + this.grpImageProcessing = new cYo.Common.Windows.Forms.CollapsibleGroupBox(); + this.grpCustomProcessing = new System.Windows.Forms.GroupBox(); + this.labelGamma = new System.Windows.Forms.Label(); + this.tbGamma = new cYo.Common.Windows.Forms.TrackBarLite(); + this.tbSaturation = new cYo.Common.Windows.Forms.TrackBarLite(); + this.labelContrast = new System.Windows.Forms.Label(); + this.tbBrightness = new cYo.Common.Windows.Forms.TrackBarLite(); + this.labelSaturation = new System.Windows.Forms.Label(); + this.tbSharpening = new cYo.Common.Windows.Forms.TrackBarLite(); + this.tbContrast = new cYo.Common.Windows.Forms.TrackBarLite(); + this.labelSharpening = new System.Windows.Forms.Label(); + this.labelBrightness = new System.Windows.Forms.Label(); + this.btResetColors = new System.Windows.Forms.Button(); + this.labelImageProcessingCustom = new System.Windows.Forms.Label(); + this.cbImageProcessingSource = new System.Windows.Forms.ComboBox(); + this.labelImagProcessingSource = new System.Windows.Forms.Label(); + this.chkAutoContrast = new System.Windows.Forms.CheckBox(); + this.grpPageFormat = new cYo.Common.Windows.Forms.CollapsibleGroupBox(); + this.chkKeepOriginalNames = new System.Windows.Forms.CheckBox(); + this.labelDoublePages = new System.Windows.Forms.Label(); + this.cbDoublePages = new System.Windows.Forms.ComboBox(); + this.chkIgnoreErrorPages = new System.Windows.Forms.CheckBox(); + this.txHeight = new System.Windows.Forms.NumericUpDown(); + this.txWidth = new System.Windows.Forms.NumericUpDown(); + this.chkDontEnlarge = new System.Windows.Forms.CheckBox(); + this.labelPageResize = new System.Windows.Forms.Label(); + this.cbPageResize = new System.Windows.Forms.ComboBox(); + this.labelPageFormat = new System.Windows.Forms.Label(); + this.cbPageFormat = new System.Windows.Forms.ComboBox(); + this.labelPageQuality = new System.Windows.Forms.Label(); + this.tbQuality = new cYo.Common.Windows.Forms.TrackBarLite(); + this.labelX = new System.Windows.Forms.Label(); + this.grpFileFormat = new cYo.Common.Windows.Forms.CollapsibleGroupBox(); + this.txTagsToAppend = new cYo.Common.Windows.Forms.TextBoxEx(); + this.labelTagToAppend = new System.Windows.Forms.Label(); + this.txIncludePages = new System.Windows.Forms.TextBox(); + this.labelIncludePages = new System.Windows.Forms.Label(); + this.btRemovePageFilter = new System.Windows.Forms.Button(); + this.cbCompression = new System.Windows.Forms.ComboBox(); + this.labelCompression = new System.Windows.Forms.Label(); + this.chkEmbedComicInfo = new System.Windows.Forms.CheckBox(); + this.cbComicFormat = new System.Windows.Forms.ComboBox(); + this.labelComicFormat = new System.Windows.Forms.Label(); + this.txRemovedPages = new System.Windows.Forms.Label(); + this.labelRemovePageFilter = new System.Windows.Forms.Label(); + this.grpFileNaming = new cYo.Common.Windows.Forms.CollapsibleGroupBox(); + this.txCustomStartIndex = new System.Windows.Forms.NumericUpDown(); + this.labelCustomStartIndex = new System.Windows.Forms.Label(); + this.txCustomName = new System.Windows.Forms.TextBox(); + this.labelCustomNaming = new System.Windows.Forms.Label(); + this.cbNamingTemplate = new System.Windows.Forms.ComboBox(); + this.labelNamingTemplate = new System.Windows.Forms.Label(); + this.grpExportLocation = new cYo.Common.Windows.Forms.CollapsibleGroupBox(); + this.chkCombine = new System.Windows.Forms.CheckBox(); + this.chkOverwrite = new System.Windows.Forms.CheckBox(); + this.chkAddNewToLibrary = new System.Windows.Forms.CheckBox(); + this.chkDeleteOriginal = new System.Windows.Forms.CheckBox(); + this.btChooseFolder = new System.Windows.Forms.Button(); + this.txFolder = new System.Windows.Forms.Label(); + this.labelFolder = new System.Windows.Forms.Label(); + this.cbExport = new System.Windows.Forms.ComboBox(); + this.labelExportTo = new System.Windows.Forms.Label(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.chkLossless = new System.Windows.Forms.CheckBox(); + this.exportSettings.SuspendLayout(); + this.grpImageProcessing.SuspendLayout(); + this.grpCustomProcessing.SuspendLayout(); + this.grpPageFormat.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.txHeight)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txWidth)).BeginInit(); + this.grpFileFormat.SuspendLayout(); + this.grpFileNaming.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.txCustomStartIndex)).BeginInit(); + this.grpExportLocation.SuspendLayout(); + this.SuspendLayout(); + // + // contextRemovePageFilter + // + this.contextRemovePageFilter.Name = "contextRemovePageFilter"; + this.contextRemovePageFilter.Size = new System.Drawing.Size(61, 4); + // + // btCancel + // + this.btCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btCancel.Location = new System.Drawing.Point(660, 440); + this.btCancel.Name = "btCancel"; + this.btCancel.Size = new System.Drawing.Size(80, 24); + this.btCancel.TabIndex = 7; + this.btCancel.Text = "&Cancel"; + // + // btOK + // + this.btOK.DialogResult = System.Windows.Forms.DialogResult.OK; + this.btOK.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btOK.Location = new System.Drawing.Point(574, 440); + this.btOK.Name = "btOK"; + this.btOK.Size = new System.Drawing.Size(80, 24); + this.btOK.TabIndex = 6; + this.btOK.Text = "&OK"; + // + // tvPresets + // + this.tvPresets.Location = new System.Drawing.Point(14, 18); + this.tvPresets.Name = "tvPresets"; + this.tvPresets.ShowNodeToolTips = true; + this.tvPresets.Size = new System.Drawing.Size(220, 387); + this.tvPresets.TabIndex = 3; + this.tvPresets.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvPresets_AfterSelect); + // + // btSavePreset + // + this.btSavePreset.Location = new System.Drawing.Point(14, 411); + this.btSavePreset.Name = "btSavePreset"; + this.btSavePreset.Size = new System.Drawing.Size(107, 23); + this.btSavePreset.TabIndex = 4; + this.btSavePreset.Text = "Save,,,"; + this.btSavePreset.UseVisualStyleBackColor = true; + this.btSavePreset.Click += new System.EventHandler(this.btAddPreset_Click); + // + // btRemovePreset + // + this.btRemovePreset.Location = new System.Drawing.Point(127, 411); + this.btRemovePreset.Name = "btRemovePreset"; + this.btRemovePreset.Size = new System.Drawing.Size(107, 23); + this.btRemovePreset.TabIndex = 5; + this.btRemovePreset.Text = "Remove"; + this.btRemovePreset.UseVisualStyleBackColor = true; + this.btRemovePreset.Click += new System.EventHandler(this.btRemovePreset_Click); + // + // exportSettings + // + this.exportSettings.AutoScroll = true; + this.exportSettings.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.exportSettings.Controls.Add(this.grpImageProcessing); + this.exportSettings.Controls.Add(this.grpPageFormat); + this.exportSettings.Controls.Add(this.grpFileFormat); + this.exportSettings.Controls.Add(this.grpFileNaming); + this.exportSettings.Controls.Add(this.grpExportLocation); + this.exportSettings.Location = new System.Drawing.Point(240, 18); + this.exportSettings.Name = "exportSettings"; + this.exportSettings.Padding = new System.Windows.Forms.Padding(4); + this.exportSettings.Size = new System.Drawing.Size(500, 416); + this.exportSettings.TabIndex = 8; + // + // grpImageProcessing + // + this.grpImageProcessing.Controls.Add(this.grpCustomProcessing); + this.grpImageProcessing.Controls.Add(this.labelImageProcessingCustom); + this.grpImageProcessing.Controls.Add(this.cbImageProcessingSource); + this.grpImageProcessing.Controls.Add(this.labelImagProcessingSource); + this.grpImageProcessing.Controls.Add(this.chkAutoContrast); + this.grpImageProcessing.Dock = System.Windows.Forms.DockStyle.Top; + this.grpImageProcessing.Location = new System.Drawing.Point(4, 784); + this.grpImageProcessing.Name = "grpImageProcessing"; + this.grpImageProcessing.Size = new System.Drawing.Size(473, 290); + this.grpImageProcessing.TabIndex = 9; + this.grpImageProcessing.Text = "Image Processing"; + // + // grpCustomProcessing + // + this.grpCustomProcessing.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.grpCustomProcessing.Controls.Add(this.labelGamma); - this.grpCustomProcessing.Controls.Add(this.tbGamma); - this.grpCustomProcessing.Controls.Add(this.tbSaturation); - this.grpCustomProcessing.Controls.Add(this.labelContrast); - this.grpCustomProcessing.Controls.Add(this.tbBrightness); - this.grpCustomProcessing.Controls.Add(this.labelSaturation); - this.grpCustomProcessing.Controls.Add(this.tbSharpening); - this.grpCustomProcessing.Controls.Add(this.tbContrast); - this.grpCustomProcessing.Controls.Add(this.labelSharpening); - this.grpCustomProcessing.Controls.Add(this.labelBrightness); - this.grpCustomProcessing.Controls.Add(this.btResetColors); - this.grpCustomProcessing.Location = new System.Drawing.Point(110, 66); - this.grpCustomProcessing.Name = "grpCustomProcessing"; - this.grpCustomProcessing.Size = new System.Drawing.Size(346, 183); - this.grpCustomProcessing.TabIndex = 3; - this.grpCustomProcessing.TabStop = false; - // - // labelGamma - // - this.labelGamma.AutoSize = true; - this.labelGamma.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold); - this.labelGamma.Location = new System.Drawing.Point(6, 97); - this.labelGamma.Name = "labelGamma"; - this.labelGamma.Size = new System.Drawing.Size(43, 12); - this.labelGamma.TabIndex = 6; - this.labelGamma.Text = "Gamma"; - // - // tbGamma - // - this.tbGamma.Location = new System.Drawing.Point(95, 91); - this.tbGamma.Minimum = -100; - this.tbGamma.Name = "tbGamma"; - this.tbGamma.Size = new System.Drawing.Size(245, 18); - this.tbGamma.TabIndex = 7; - this.tbGamma.Text = "tbSaturation"; - this.tbGamma.ThumbSize = new System.Drawing.Size(8, 16); - this.tbGamma.TickFrequency = 16; - this.tbGamma.TickStyle = System.Windows.Forms.TickStyle.BottomRight; - this.tbGamma.ValueChanged += new System.EventHandler(this.AdjustmentSliderChanged); - // - // tbSaturation - // - this.tbSaturation.Location = new System.Drawing.Point(95, 19); - this.tbSaturation.Minimum = -100; - this.tbSaturation.Name = "tbSaturation"; - this.tbSaturation.Size = new System.Drawing.Size(245, 18); - this.tbSaturation.TabIndex = 1; - this.tbSaturation.ThumbSize = new System.Drawing.Size(8, 16); - this.tbSaturation.TickFrequency = 16; - this.tbSaturation.TickStyle = System.Windows.Forms.TickStyle.BottomRight; - this.tbSaturation.ValueChanged += new System.EventHandler(this.AdjustmentSliderChanged); - // - // labelContrast - // - this.labelContrast.AutoSize = true; - this.labelContrast.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold); - this.labelContrast.Location = new System.Drawing.Point(6, 73); - this.labelContrast.Name = "labelContrast"; - this.labelContrast.Size = new System.Drawing.Size(49, 12); - this.labelContrast.TabIndex = 4; - this.labelContrast.Text = "Contrast"; - // - // tbBrightness - // - this.tbBrightness.Location = new System.Drawing.Point(95, 43); - this.tbBrightness.Minimum = -100; - this.tbBrightness.Name = "tbBrightness"; - this.tbBrightness.Size = new System.Drawing.Size(245, 18); - this.tbBrightness.TabIndex = 3; - this.tbBrightness.Text = "trackBarLite3"; - this.tbBrightness.ThumbSize = new System.Drawing.Size(8, 16); - this.tbBrightness.TickFrequency = 16; - this.tbBrightness.TickStyle = System.Windows.Forms.TickStyle.BottomRight; - this.tbBrightness.ValueChanged += new System.EventHandler(this.AdjustmentSliderChanged); - // - // labelSaturation - // - this.labelSaturation.AutoSize = true; - this.labelSaturation.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold); - this.labelSaturation.Location = new System.Drawing.Point(6, 25); - this.labelSaturation.Name = "labelSaturation"; - this.labelSaturation.Size = new System.Drawing.Size(57, 12); - this.labelSaturation.TabIndex = 0; - this.labelSaturation.Text = "Saturation"; - // - // tbSharpening - // - this.tbSharpening.LargeChange = 1; - this.tbSharpening.Location = new System.Drawing.Point(95, 117); - this.tbSharpening.Maximum = 3; - this.tbSharpening.Name = "tbSharpening"; - this.tbSharpening.Size = new System.Drawing.Size(245, 18); - this.tbSharpening.TabIndex = 9; - this.tbSharpening.Text = "tbSaturation"; - this.tbSharpening.ThumbSize = new System.Drawing.Size(8, 16); - this.tbSharpening.TickFrequency = 1; - this.tbSharpening.TickStyle = System.Windows.Forms.TickStyle.BottomRight; - // - // tbContrast - // - this.tbContrast.Location = new System.Drawing.Point(95, 67); - this.tbContrast.Minimum = -100; - this.tbContrast.Name = "tbContrast"; - this.tbContrast.Size = new System.Drawing.Size(245, 18); - this.tbContrast.TabIndex = 5; - this.tbContrast.Text = "tbSaturation"; - this.tbContrast.ThumbSize = new System.Drawing.Size(8, 16); - this.tbContrast.TickFrequency = 16; - this.tbContrast.TickStyle = System.Windows.Forms.TickStyle.BottomRight; - this.tbContrast.ValueChanged += new System.EventHandler(this.AdjustmentSliderChanged); - // - // labelSharpening - // - this.labelSharpening.AutoSize = true; - this.labelSharpening.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold); - this.labelSharpening.Location = new System.Drawing.Point(6, 123); - this.labelSharpening.Name = "labelSharpening"; - this.labelSharpening.Size = new System.Drawing.Size(61, 12); - this.labelSharpening.TabIndex = 8; - this.labelSharpening.Text = "Sharpening"; - // - // labelBrightness - // - this.labelBrightness.AutoSize = true; - this.labelBrightness.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold); - this.labelBrightness.Location = new System.Drawing.Point(6, 49); - this.labelBrightness.Name = "labelBrightness"; - this.labelBrightness.Size = new System.Drawing.Size(59, 12); - this.labelBrightness.TabIndex = 2; - this.labelBrightness.Text = "Brightness"; - // - // btResetColors - // - this.btResetColors.Location = new System.Drawing.Point(257, 149); - this.btResetColors.Name = "btResetColors"; - this.btResetColors.Size = new System.Drawing.Size(77, 24); - this.btResetColors.TabIndex = 10; - this.btResetColors.Text = "Reset"; - this.btResetColors.UseVisualStyleBackColor = true; - this.btResetColors.Click += new System.EventHandler(this.btResetColors_Click); - // - // labelImageProcessingCustom - // - this.labelImageProcessingCustom.Location = new System.Drawing.Point(0, 66); - this.labelImageProcessingCustom.Name = "labelImageProcessingCustom"; - this.labelImageProcessingCustom.Size = new System.Drawing.Size(104, 21); - this.labelImageProcessingCustom.TabIndex = 2; - this.labelImageProcessingCustom.Text = "Custom:"; - this.labelImageProcessingCustom.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // cbImageProcessingSource - // - this.cbImageProcessingSource.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.grpCustomProcessing.Controls.Add(this.labelGamma); + this.grpCustomProcessing.Controls.Add(this.tbGamma); + this.grpCustomProcessing.Controls.Add(this.tbSaturation); + this.grpCustomProcessing.Controls.Add(this.labelContrast); + this.grpCustomProcessing.Controls.Add(this.tbBrightness); + this.grpCustomProcessing.Controls.Add(this.labelSaturation); + this.grpCustomProcessing.Controls.Add(this.tbSharpening); + this.grpCustomProcessing.Controls.Add(this.tbContrast); + this.grpCustomProcessing.Controls.Add(this.labelSharpening); + this.grpCustomProcessing.Controls.Add(this.labelBrightness); + this.grpCustomProcessing.Controls.Add(this.btResetColors); + this.grpCustomProcessing.Location = new System.Drawing.Point(110, 66); + this.grpCustomProcessing.Name = "grpCustomProcessing"; + this.grpCustomProcessing.Size = new System.Drawing.Size(346, 183); + this.grpCustomProcessing.TabIndex = 3; + this.grpCustomProcessing.TabStop = false; + // + // labelGamma + // + this.labelGamma.AutoSize = true; + this.labelGamma.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold); + this.labelGamma.Location = new System.Drawing.Point(6, 97); + this.labelGamma.Name = "labelGamma"; + this.labelGamma.Size = new System.Drawing.Size(43, 12); + this.labelGamma.TabIndex = 6; + this.labelGamma.Text = "Gamma"; + // + // tbGamma + // + this.tbGamma.Location = new System.Drawing.Point(95, 91); + this.tbGamma.Minimum = -100; + this.tbGamma.Name = "tbGamma"; + this.tbGamma.Size = new System.Drawing.Size(245, 18); + this.tbGamma.TabIndex = 7; + this.tbGamma.Text = "tbSaturation"; + this.tbGamma.ThumbSize = new System.Drawing.Size(8, 16); + this.tbGamma.TickFrequency = 16; + this.tbGamma.TickStyle = System.Windows.Forms.TickStyle.BottomRight; + this.tbGamma.ValueChanged += new System.EventHandler(this.AdjustmentSliderChanged); + // + // tbSaturation + // + this.tbSaturation.Location = new System.Drawing.Point(95, 19); + this.tbSaturation.Minimum = -100; + this.tbSaturation.Name = "tbSaturation"; + this.tbSaturation.Size = new System.Drawing.Size(245, 18); + this.tbSaturation.TabIndex = 1; + this.tbSaturation.ThumbSize = new System.Drawing.Size(8, 16); + this.tbSaturation.TickFrequency = 16; + this.tbSaturation.TickStyle = System.Windows.Forms.TickStyle.BottomRight; + this.tbSaturation.ValueChanged += new System.EventHandler(this.AdjustmentSliderChanged); + // + // labelContrast + // + this.labelContrast.AutoSize = true; + this.labelContrast.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold); + this.labelContrast.Location = new System.Drawing.Point(6, 73); + this.labelContrast.Name = "labelContrast"; + this.labelContrast.Size = new System.Drawing.Size(49, 12); + this.labelContrast.TabIndex = 4; + this.labelContrast.Text = "Contrast"; + // + // tbBrightness + // + this.tbBrightness.Location = new System.Drawing.Point(95, 43); + this.tbBrightness.Minimum = -100; + this.tbBrightness.Name = "tbBrightness"; + this.tbBrightness.Size = new System.Drawing.Size(245, 18); + this.tbBrightness.TabIndex = 3; + this.tbBrightness.Text = "trackBarLite3"; + this.tbBrightness.ThumbSize = new System.Drawing.Size(8, 16); + this.tbBrightness.TickFrequency = 16; + this.tbBrightness.TickStyle = System.Windows.Forms.TickStyle.BottomRight; + this.tbBrightness.ValueChanged += new System.EventHandler(this.AdjustmentSliderChanged); + // + // labelSaturation + // + this.labelSaturation.AutoSize = true; + this.labelSaturation.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold); + this.labelSaturation.Location = new System.Drawing.Point(6, 25); + this.labelSaturation.Name = "labelSaturation"; + this.labelSaturation.Size = new System.Drawing.Size(57, 12); + this.labelSaturation.TabIndex = 0; + this.labelSaturation.Text = "Saturation"; + // + // tbSharpening + // + this.tbSharpening.LargeChange = 1; + this.tbSharpening.Location = new System.Drawing.Point(95, 117); + this.tbSharpening.Maximum = 3; + this.tbSharpening.Name = "tbSharpening"; + this.tbSharpening.Size = new System.Drawing.Size(245, 18); + this.tbSharpening.TabIndex = 9; + this.tbSharpening.Text = "tbSaturation"; + this.tbSharpening.ThumbSize = new System.Drawing.Size(8, 16); + this.tbSharpening.TickFrequency = 1; + this.tbSharpening.TickStyle = System.Windows.Forms.TickStyle.BottomRight; + // + // tbContrast + // + this.tbContrast.Location = new System.Drawing.Point(95, 67); + this.tbContrast.Minimum = -100; + this.tbContrast.Name = "tbContrast"; + this.tbContrast.Size = new System.Drawing.Size(245, 18); + this.tbContrast.TabIndex = 5; + this.tbContrast.Text = "tbSaturation"; + this.tbContrast.ThumbSize = new System.Drawing.Size(8, 16); + this.tbContrast.TickFrequency = 16; + this.tbContrast.TickStyle = System.Windows.Forms.TickStyle.BottomRight; + this.tbContrast.ValueChanged += new System.EventHandler(this.AdjustmentSliderChanged); + // + // labelSharpening + // + this.labelSharpening.AutoSize = true; + this.labelSharpening.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold); + this.labelSharpening.Location = new System.Drawing.Point(6, 123); + this.labelSharpening.Name = "labelSharpening"; + this.labelSharpening.Size = new System.Drawing.Size(61, 12); + this.labelSharpening.TabIndex = 8; + this.labelSharpening.Text = "Sharpening"; + // + // labelBrightness + // + this.labelBrightness.AutoSize = true; + this.labelBrightness.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold); + this.labelBrightness.Location = new System.Drawing.Point(6, 49); + this.labelBrightness.Name = "labelBrightness"; + this.labelBrightness.Size = new System.Drawing.Size(59, 12); + this.labelBrightness.TabIndex = 2; + this.labelBrightness.Text = "Brightness"; + // + // btResetColors + // + this.btResetColors.Location = new System.Drawing.Point(257, 149); + this.btResetColors.Name = "btResetColors"; + this.btResetColors.Size = new System.Drawing.Size(77, 24); + this.btResetColors.TabIndex = 10; + this.btResetColors.Text = "Reset"; + this.btResetColors.UseVisualStyleBackColor = true; + this.btResetColors.Click += new System.EventHandler(this.btResetColors_Click); + // + // labelImageProcessingCustom + // + this.labelImageProcessingCustom.Location = new System.Drawing.Point(0, 66); + this.labelImageProcessingCustom.Name = "labelImageProcessingCustom"; + this.labelImageProcessingCustom.Size = new System.Drawing.Size(104, 21); + this.labelImageProcessingCustom.TabIndex = 2; + this.labelImageProcessingCustom.Text = "Custom:"; + this.labelImageProcessingCustom.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // cbImageProcessingSource + // + this.cbImageProcessingSource.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.cbImageProcessingSource.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbImageProcessingSource.FormattingEnabled = true; - this.cbImageProcessingSource.Items.AddRange(new object[] { + this.cbImageProcessingSource.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbImageProcessingSource.FormattingEnabled = true; + this.cbImageProcessingSource.Items.AddRange(new object[] { "Custom Settings", "Book Settings are applied"}); - this.cbImageProcessingSource.Location = new System.Drawing.Point(110, 40); - this.cbImageProcessingSource.Name = "cbImageProcessingSource"; - this.cbImageProcessingSource.Size = new System.Drawing.Size(346, 21); - this.cbImageProcessingSource.TabIndex = 1; - // - // labelImagProcessingSource - // - this.labelImagProcessingSource.Location = new System.Drawing.Point(3, 39); - this.labelImagProcessingSource.Name = "labelImagProcessingSource"; - this.labelImagProcessingSource.Size = new System.Drawing.Size(101, 21); - this.labelImagProcessingSource.TabIndex = 0; - this.labelImagProcessingSource.Text = "Source:"; - this.labelImagProcessingSource.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // chkAutoContrast - // - this.chkAutoContrast.AutoSize = true; - this.chkAutoContrast.Location = new System.Drawing.Point(110, 255); - this.chkAutoContrast.Name = "chkAutoContrast"; - this.chkAutoContrast.Size = new System.Drawing.Size(184, 17); - this.chkAutoContrast.TabIndex = 4; - this.chkAutoContrast.Text = "Automatic Contrast Enhancement"; - this.chkAutoContrast.UseVisualStyleBackColor = true; - // - // grpPageFormat - // - this.grpPageFormat.Controls.Add(this.chkKeepOriginalNames); - this.grpPageFormat.Controls.Add(this.labelDoublePages); - this.grpPageFormat.Controls.Add(this.cbDoublePages); - this.grpPageFormat.Controls.Add(this.chkIgnoreErrorPages); - this.grpPageFormat.Controls.Add(this.txHeight); - this.grpPageFormat.Controls.Add(this.txWidth); - this.grpPageFormat.Controls.Add(this.chkDontEnlarge); - this.grpPageFormat.Controls.Add(this.labelPageResize); - this.grpPageFormat.Controls.Add(this.cbPageResize); - this.grpPageFormat.Controls.Add(this.labelPageFormat); - this.grpPageFormat.Controls.Add(this.cbPageFormat); - this.grpPageFormat.Controls.Add(this.labelPageQuality); - this.grpPageFormat.Controls.Add(this.tbQuality); - this.grpPageFormat.Controls.Add(this.labelX); - this.grpPageFormat.Dock = System.Windows.Forms.DockStyle.Top; - this.grpPageFormat.Location = new System.Drawing.Point(4, 552); - this.grpPageFormat.Name = "grpPageFormat"; - this.grpPageFormat.Size = new System.Drawing.Size(473, 205); - this.grpPageFormat.TabIndex = 2; - this.grpPageFormat.TabStop = false; - this.grpPageFormat.Text = "Page Format"; - // - // chkKeepOriginalNames - // - this.chkKeepOriginalNames.AutoSize = true; - this.chkKeepOriginalNames.Location = new System.Drawing.Point(110, 178); - this.chkKeepOriginalNames.Name = "chkKeepOriginalNames"; - this.chkKeepOriginalNames.Size = new System.Drawing.Size(148, 17); - this.chkKeepOriginalNames.TabIndex = 13; - this.chkKeepOriginalNames.Text = "Keep original page names"; - this.chkKeepOriginalNames.UseVisualStyleBackColor = true; - // - // labelDoublePages - // - this.labelDoublePages.Location = new System.Drawing.Point(6, 96); - this.labelDoublePages.Name = "labelDoublePages"; - this.labelDoublePages.Size = new System.Drawing.Size(98, 21); - this.labelDoublePages.TabIndex = 9; - this.labelDoublePages.Text = "Double Pages:"; - this.labelDoublePages.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // cbDoublePages - // - this.cbDoublePages.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.cbImageProcessingSource.Location = new System.Drawing.Point(110, 40); + this.cbImageProcessingSource.Name = "cbImageProcessingSource"; + this.cbImageProcessingSource.Size = new System.Drawing.Size(346, 21); + this.cbImageProcessingSource.TabIndex = 1; + // + // labelImagProcessingSource + // + this.labelImagProcessingSource.Location = new System.Drawing.Point(3, 39); + this.labelImagProcessingSource.Name = "labelImagProcessingSource"; + this.labelImagProcessingSource.Size = new System.Drawing.Size(101, 21); + this.labelImagProcessingSource.TabIndex = 0; + this.labelImagProcessingSource.Text = "Source:"; + this.labelImagProcessingSource.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // chkAutoContrast + // + this.chkAutoContrast.AutoSize = true; + this.chkAutoContrast.Location = new System.Drawing.Point(110, 255); + this.chkAutoContrast.Name = "chkAutoContrast"; + this.chkAutoContrast.Size = new System.Drawing.Size(184, 17); + this.chkAutoContrast.TabIndex = 4; + this.chkAutoContrast.Text = "Automatic Contrast Enhancement"; + this.chkAutoContrast.UseVisualStyleBackColor = true; + // + // grpPageFormat + // + this.grpPageFormat.Controls.Add(this.chkLossless); + this.grpPageFormat.Controls.Add(this.chkKeepOriginalNames); + this.grpPageFormat.Controls.Add(this.labelDoublePages); + this.grpPageFormat.Controls.Add(this.cbDoublePages); + this.grpPageFormat.Controls.Add(this.chkIgnoreErrorPages); + this.grpPageFormat.Controls.Add(this.txHeight); + this.grpPageFormat.Controls.Add(this.txWidth); + this.grpPageFormat.Controls.Add(this.chkDontEnlarge); + this.grpPageFormat.Controls.Add(this.labelPageResize); + this.grpPageFormat.Controls.Add(this.cbPageResize); + this.grpPageFormat.Controls.Add(this.labelPageFormat); + this.grpPageFormat.Controls.Add(this.cbPageFormat); + this.grpPageFormat.Controls.Add(this.labelPageQuality); + this.grpPageFormat.Controls.Add(this.tbQuality); + this.grpPageFormat.Controls.Add(this.labelX); + this.grpPageFormat.Dock = System.Windows.Forms.DockStyle.Top; + this.grpPageFormat.Location = new System.Drawing.Point(4, 562); + this.grpPageFormat.Name = "grpPageFormat"; + this.grpPageFormat.Size = new System.Drawing.Size(473, 222); + this.grpPageFormat.TabIndex = 2; + this.grpPageFormat.TabStop = false; + this.grpPageFormat.Text = "Page Format"; + // + // chkKeepOriginalNames + // + this.chkKeepOriginalNames.AutoSize = true; + this.chkKeepOriginalNames.Location = new System.Drawing.Point(110, 178); + this.chkKeepOriginalNames.Name = "chkKeepOriginalNames"; + this.chkKeepOriginalNames.Size = new System.Drawing.Size(148, 17); + this.chkKeepOriginalNames.TabIndex = 13; + this.chkKeepOriginalNames.Text = "Keep original page names"; + this.chkKeepOriginalNames.UseVisualStyleBackColor = true; + // + // labelDoublePages + // + this.labelDoublePages.Location = new System.Drawing.Point(6, 96); + this.labelDoublePages.Name = "labelDoublePages"; + this.labelDoublePages.Size = new System.Drawing.Size(98, 21); + this.labelDoublePages.TabIndex = 9; + this.labelDoublePages.Text = "Double Pages:"; + this.labelDoublePages.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // cbDoublePages + // + this.cbDoublePages.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.cbDoublePages.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbDoublePages.FormattingEnabled = true; - this.cbDoublePages.Items.AddRange(new object[] { + this.cbDoublePages.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbDoublePages.FormattingEnabled = true; + this.cbDoublePages.Items.AddRange(new object[] { "Keep", "Split", "Rotate 90°", "Adapt Width"}); - this.cbDoublePages.Location = new System.Drawing.Point(110, 96); - this.cbDoublePages.Name = "cbDoublePages"; - this.cbDoublePages.Size = new System.Drawing.Size(157, 21); - this.cbDoublePages.TabIndex = 10; - // - // chkIgnoreErrorPages - // - this.chkIgnoreErrorPages.AutoSize = true; - this.chkIgnoreErrorPages.Location = new System.Drawing.Point(110, 155); - this.chkIgnoreErrorPages.Name = "chkIgnoreErrorPages"; - this.chkIgnoreErrorPages.Size = new System.Drawing.Size(237, 17); - this.chkIgnoreErrorPages.TabIndex = 12; - this.chkIgnoreErrorPages.Text = "Ignore Pages with errors and continue export"; - this.chkIgnoreErrorPages.UseVisualStyleBackColor = true; - // - // txHeight - // - this.txHeight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.txHeight.Location = new System.Drawing.Point(391, 71); - this.txHeight.Maximum = new decimal(new int[] { + this.cbDoublePages.Location = new System.Drawing.Point(110, 96); + this.cbDoublePages.Name = "cbDoublePages"; + this.cbDoublePages.Size = new System.Drawing.Size(157, 21); + this.cbDoublePages.TabIndex = 10; + // + // chkIgnoreErrorPages + // + this.chkIgnoreErrorPages.AutoSize = true; + this.chkIgnoreErrorPages.Location = new System.Drawing.Point(110, 155); + this.chkIgnoreErrorPages.Name = "chkIgnoreErrorPages"; + this.chkIgnoreErrorPages.Size = new System.Drawing.Size(237, 17); + this.chkIgnoreErrorPages.TabIndex = 12; + this.chkIgnoreErrorPages.Text = "Ignore Pages with errors and continue export"; + this.chkIgnoreErrorPages.UseVisualStyleBackColor = true; + // + // txHeight + // + this.txHeight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.txHeight.Location = new System.Drawing.Point(391, 71); + this.txHeight.Maximum = new decimal(new int[] { 8000, 0, 0, 0}); - this.txHeight.Name = "txHeight"; - this.txHeight.Size = new System.Drawing.Size(65, 20); - this.txHeight.TabIndex = 8; - this.txHeight.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.txHeight.Value = new decimal(new int[] { + this.txHeight.Name = "txHeight"; + this.txHeight.Size = new System.Drawing.Size(65, 20); + this.txHeight.TabIndex = 8; + this.txHeight.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txHeight.Value = new decimal(new int[] { 1000, 0, 0, 0}); - // - // txWidth - // - this.txWidth.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.txWidth.Location = new System.Drawing.Point(291, 72); - this.txWidth.Maximum = new decimal(new int[] { + // + // txWidth + // + this.txWidth.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.txWidth.Location = new System.Drawing.Point(291, 72); + this.txWidth.Maximum = new decimal(new int[] { 8000, 0, 0, 0}); - this.txWidth.Name = "txWidth"; - this.txWidth.Size = new System.Drawing.Size(67, 20); - this.txWidth.TabIndex = 6; - this.txWidth.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.txWidth.Value = new decimal(new int[] { + this.txWidth.Name = "txWidth"; + this.txWidth.Size = new System.Drawing.Size(67, 20); + this.txWidth.TabIndex = 6; + this.txWidth.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txWidth.Value = new decimal(new int[] { 1000, 0, 0, 0}); - // - // chkDontEnlarge - // - this.chkDontEnlarge.AutoSize = true; - this.chkDontEnlarge.Location = new System.Drawing.Point(110, 132); - this.chkDontEnlarge.Name = "chkDontEnlarge"; - this.chkDontEnlarge.Size = new System.Drawing.Size(89, 17); - this.chkDontEnlarge.TabIndex = 11; - this.chkDontEnlarge.Text = "Don\'t enlarge"; - this.chkDontEnlarge.UseVisualStyleBackColor = true; - // - // labelPageResize - // - this.labelPageResize.Location = new System.Drawing.Point(6, 69); - this.labelPageResize.Name = "labelPageResize"; - this.labelPageResize.Size = new System.Drawing.Size(98, 21); - this.labelPageResize.TabIndex = 4; - this.labelPageResize.Text = "Resize Pages:"; - this.labelPageResize.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // cbPageResize - // - this.cbPageResize.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + // chkDontEnlarge + // + this.chkDontEnlarge.AutoSize = true; + this.chkDontEnlarge.Location = new System.Drawing.Point(110, 132); + this.chkDontEnlarge.Name = "chkDontEnlarge"; + this.chkDontEnlarge.Size = new System.Drawing.Size(89, 17); + this.chkDontEnlarge.TabIndex = 11; + this.chkDontEnlarge.Text = "Don\'t enlarge"; + this.chkDontEnlarge.UseVisualStyleBackColor = true; + // + // labelPageResize + // + this.labelPageResize.Location = new System.Drawing.Point(6, 69); + this.labelPageResize.Name = "labelPageResize"; + this.labelPageResize.Size = new System.Drawing.Size(98, 21); + this.labelPageResize.TabIndex = 4; + this.labelPageResize.Text = "Resize Pages:"; + this.labelPageResize.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // cbPageResize + // + this.cbPageResize.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.cbPageResize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbPageResize.FormattingEnabled = true; - this.cbPageResize.Items.AddRange(new object[] { + this.cbPageResize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbPageResize.FormattingEnabled = true; + this.cbPageResize.Items.AddRange(new object[] { "Preserve Original", "Best fit Width & Height", "Set Width", "Set Height"}); - this.cbPageResize.Location = new System.Drawing.Point(110, 69); - this.cbPageResize.Name = "cbPageResize"; - this.cbPageResize.Size = new System.Drawing.Size(157, 21); - this.cbPageResize.TabIndex = 5; - // - // labelPageFormat - // - this.labelPageFormat.Location = new System.Drawing.Point(3, 42); - this.labelPageFormat.Name = "labelPageFormat"; - this.labelPageFormat.Size = new System.Drawing.Size(101, 21); - this.labelPageFormat.TabIndex = 0; - this.labelPageFormat.Text = "Format:"; - this.labelPageFormat.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // cbPageFormat - // - this.cbPageFormat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.cbPageResize.Location = new System.Drawing.Point(110, 69); + this.cbPageResize.Name = "cbPageResize"; + this.cbPageResize.Size = new System.Drawing.Size(157, 21); + this.cbPageResize.TabIndex = 5; + // + // labelPageFormat + // + this.labelPageFormat.Location = new System.Drawing.Point(3, 42); + this.labelPageFormat.Name = "labelPageFormat"; + this.labelPageFormat.Size = new System.Drawing.Size(101, 21); + this.labelPageFormat.TabIndex = 0; + this.labelPageFormat.Text = "Format:"; + this.labelPageFormat.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // cbPageFormat + // + this.cbPageFormat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.cbPageFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbPageFormat.FormattingEnabled = true; - this.cbPageFormat.Items.AddRange(new object[] { + this.cbPageFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbPageFormat.FormattingEnabled = true; + this.cbPageFormat.Items.AddRange(new object[] { "Preserve Original", "JPEG", "PNG", @@ -545,434 +547,444 @@ private void InitializeComponent() "BMP", "DJVU", "WEBP"}); - this.cbPageFormat.Location = new System.Drawing.Point(110, 42); - this.cbPageFormat.Name = "cbPageFormat"; - this.cbPageFormat.Size = new System.Drawing.Size(157, 21); - this.cbPageFormat.TabIndex = 1; - // - // labelPageQuality - // - this.labelPageQuality.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.labelPageQuality.Location = new System.Drawing.Point(273, 41); - this.labelPageQuality.Name = "labelPageQuality"; - this.labelPageQuality.Size = new System.Drawing.Size(77, 21); - this.labelPageQuality.TabIndex = 2; - this.labelPageQuality.Text = "Quality:"; - this.labelPageQuality.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // tbQuality - // - this.tbQuality.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.tbQuality.Location = new System.Drawing.Point(349, 41); - this.tbQuality.Name = "tbQuality"; - this.tbQuality.Size = new System.Drawing.Size(107, 21); - this.tbQuality.TabIndex = 3; - this.tbQuality.ThumbSize = new System.Drawing.Size(8, 14); - this.tbQuality.ValueChanged += new System.EventHandler(this.tbQuality_ValueChanged); - // - // labelX - // - this.labelX.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.labelX.Location = new System.Drawing.Point(364, 71); - this.labelX.Name = "labelX"; - this.labelX.Size = new System.Drawing.Size(21, 21); - this.labelX.TabIndex = 7; - this.labelX.Text = "x"; - this.labelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // grpFileFormat - // - this.grpFileFormat.Controls.Add(this.txTagsToAppend); - this.grpFileFormat.Controls.Add(this.labelTagToAppend); - this.grpFileFormat.Controls.Add(this.txIncludePages); - this.grpFileFormat.Controls.Add(this.labelIncludePages); - this.grpFileFormat.Controls.Add(this.btRemovePageFilter); - this.grpFileFormat.Controls.Add(this.cbCompression); - this.grpFileFormat.Controls.Add(this.labelCompression); - this.grpFileFormat.Controls.Add(this.chkEmbedComicInfo); - this.grpFileFormat.Controls.Add(this.cbComicFormat); - this.grpFileFormat.Controls.Add(this.labelComicFormat); - this.grpFileFormat.Controls.Add(this.txRemovedPages); - this.grpFileFormat.Controls.Add(this.labelRemovePageFilter); - this.grpFileFormat.Dock = System.Windows.Forms.DockStyle.Top; - this.grpFileFormat.Location = new System.Drawing.Point(4, 356); - this.grpFileFormat.Name = "grpFileFormat"; - this.grpFileFormat.Size = new System.Drawing.Size(473, 206); - this.grpFileFormat.TabIndex = 1; - this.grpFileFormat.TabStop = false; - this.grpFileFormat.Text = "File Format"; - // - // txTagsToAppend - // - this.txTagsToAppend.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.cbPageFormat.Location = new System.Drawing.Point(110, 42); + this.cbPageFormat.Name = "cbPageFormat"; + this.cbPageFormat.Size = new System.Drawing.Size(157, 21); + this.cbPageFormat.TabIndex = 1; + // + // labelPageQuality + // + this.labelPageQuality.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.labelPageQuality.Location = new System.Drawing.Point(273, 41); + this.labelPageQuality.Name = "labelPageQuality"; + this.labelPageQuality.Size = new System.Drawing.Size(77, 21); + this.labelPageQuality.TabIndex = 2; + this.labelPageQuality.Text = "Quality:"; + this.labelPageQuality.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // tbQuality + // + this.tbQuality.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.tbQuality.Location = new System.Drawing.Point(349, 41); + this.tbQuality.Name = "tbQuality"; + this.tbQuality.Size = new System.Drawing.Size(107, 21); + this.tbQuality.TabIndex = 3; + this.tbQuality.ThumbSize = new System.Drawing.Size(8, 14); + this.tbQuality.ValueChanged += new System.EventHandler(this.tbQuality_ValueChanged); + // + // labelX + // + this.labelX.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.labelX.Location = new System.Drawing.Point(364, 71); + this.labelX.Name = "labelX"; + this.labelX.Size = new System.Drawing.Size(21, 21); + this.labelX.TabIndex = 7; + this.labelX.Text = "x"; + this.labelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // grpFileFormat + // + this.grpFileFormat.Controls.Add(this.txTagsToAppend); + this.grpFileFormat.Controls.Add(this.labelTagToAppend); + this.grpFileFormat.Controls.Add(this.txIncludePages); + this.grpFileFormat.Controls.Add(this.labelIncludePages); + this.grpFileFormat.Controls.Add(this.btRemovePageFilter); + this.grpFileFormat.Controls.Add(this.cbCompression); + this.grpFileFormat.Controls.Add(this.labelCompression); + this.grpFileFormat.Controls.Add(this.chkEmbedComicInfo); + this.grpFileFormat.Controls.Add(this.cbComicFormat); + this.grpFileFormat.Controls.Add(this.labelComicFormat); + this.grpFileFormat.Controls.Add(this.txRemovedPages); + this.grpFileFormat.Controls.Add(this.labelRemovePageFilter); + this.grpFileFormat.Dock = System.Windows.Forms.DockStyle.Top; + this.grpFileFormat.Location = new System.Drawing.Point(4, 356); + this.grpFileFormat.Name = "grpFileFormat"; + this.grpFileFormat.Size = new System.Drawing.Size(473, 206); + this.grpFileFormat.TabIndex = 1; + this.grpFileFormat.TabStop = false; + this.grpFileFormat.Text = "File Format"; + // + // txTagsToAppend + // + this.txTagsToAppend.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txTagsToAppend.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.txTagsToAppend.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; - this.txTagsToAppend.Location = new System.Drawing.Point(116, 176); - this.txTagsToAppend.Name = "txTagsToAppend"; - this.txTagsToAppend.Size = new System.Drawing.Size(340, 20); - this.txTagsToAppend.TabIndex = 11; - this.txTagsToAppend.Tag = ""; - // - // labelTagToAppend - // - this.labelTagToAppend.Location = new System.Drawing.Point(15, 176); - this.labelTagToAppend.Name = "labelTagToAppend"; - this.labelTagToAppend.Size = new System.Drawing.Size(98, 21); - this.labelTagToAppend.TabIndex = 10; - this.labelTagToAppend.Text = "Tags to Append: "; - this.labelTagToAppend.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // txIncludePages - // - this.txIncludePages.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txTagsToAppend.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; + this.txTagsToAppend.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource; + this.txTagsToAppend.Location = new System.Drawing.Point(116, 176); + this.txTagsToAppend.Name = "txTagsToAppend"; + this.txTagsToAppend.Size = new System.Drawing.Size(340, 20); + this.txTagsToAppend.TabIndex = 11; + this.txTagsToAppend.Tag = ""; + // + // labelTagToAppend + // + this.labelTagToAppend.Location = new System.Drawing.Point(15, 176); + this.labelTagToAppend.Name = "labelTagToAppend"; + this.labelTagToAppend.Size = new System.Drawing.Size(98, 21); + this.labelTagToAppend.TabIndex = 10; + this.labelTagToAppend.Text = "Tags to Append: "; + this.labelTagToAppend.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txIncludePages + // + this.txIncludePages.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txIncludePages.Location = new System.Drawing.Point(116, 112); - this.txIncludePages.Name = "txIncludePages"; - this.txIncludePages.Size = new System.Drawing.Size(340, 20); - this.txIncludePages.TabIndex = 6; - // - // labelIncludePages - // - this.labelIncludePages.Location = new System.Drawing.Point(15, 111); - this.labelIncludePages.Name = "labelIncludePages"; - this.labelIncludePages.Size = new System.Drawing.Size(98, 21); - this.labelIncludePages.TabIndex = 5; - this.labelIncludePages.Text = "Include Pages:"; - this.labelIncludePages.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // btRemovePageFilter - // - this.btRemovePageFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btRemovePageFilter.Image = global::cYo.Projects.ComicRack.Viewer.Properties.Resources.SmallArrowDown; - this.btRemovePageFilter.Location = new System.Drawing.Point(434, 139); - this.btRemovePageFilter.Name = "btRemovePageFilter"; - this.btRemovePageFilter.Size = new System.Drawing.Size(22, 23); - this.btRemovePageFilter.TabIndex = 9; - this.btRemovePageFilter.UseVisualStyleBackColor = true; - this.btRemovePageFilter.Click += new System.EventHandler(this.btRemovePageFilter_Click); - // - // cbCompression - // - this.cbCompression.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txIncludePages.Location = new System.Drawing.Point(116, 112); + this.txIncludePages.Name = "txIncludePages"; + this.txIncludePages.Size = new System.Drawing.Size(340, 20); + this.txIncludePages.TabIndex = 6; + // + // labelIncludePages + // + this.labelIncludePages.Location = new System.Drawing.Point(15, 111); + this.labelIncludePages.Name = "labelIncludePages"; + this.labelIncludePages.Size = new System.Drawing.Size(98, 21); + this.labelIncludePages.TabIndex = 5; + this.labelIncludePages.Text = "Include Pages:"; + this.labelIncludePages.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // btRemovePageFilter + // + this.btRemovePageFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btRemovePageFilter.Image = global::cYo.Projects.ComicRack.Viewer.Properties.Resources.SmallArrowDown; + this.btRemovePageFilter.Location = new System.Drawing.Point(434, 139); + this.btRemovePageFilter.Name = "btRemovePageFilter"; + this.btRemovePageFilter.Size = new System.Drawing.Size(22, 23); + this.btRemovePageFilter.TabIndex = 9; + this.btRemovePageFilter.UseVisualStyleBackColor = true; + this.btRemovePageFilter.Click += new System.EventHandler(this.btRemovePageFilter_Click); + // + // cbCompression + // + this.cbCompression.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.cbCompression.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbCompression.FormattingEnabled = true; - this.cbCompression.Items.AddRange(new object[] { + this.cbCompression.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbCompression.FormattingEnabled = true; + this.cbCompression.Items.AddRange(new object[] { "None", "Medium", "Strong"}); - this.cbCompression.Location = new System.Drawing.Point(116, 70); - this.cbCompression.Name = "cbCompression"; - this.cbCompression.Size = new System.Drawing.Size(151, 21); - this.cbCompression.TabIndex = 3; - // - // labelCompression - // - this.labelCompression.Location = new System.Drawing.Point(12, 70); - this.labelCompression.Name = "labelCompression"; - this.labelCompression.Size = new System.Drawing.Size(98, 21); - this.labelCompression.TabIndex = 2; - this.labelCompression.Text = "Compression:"; - this.labelCompression.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // chkEmbedComicInfo - // - this.chkEmbedComicInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.chkEmbedComicInfo.AutoSize = true; - this.chkEmbedComicInfo.Location = new System.Drawing.Point(295, 73); - this.chkEmbedComicInfo.Name = "chkEmbedComicInfo"; - this.chkEmbedComicInfo.Size = new System.Drawing.Size(108, 17); - this.chkEmbedComicInfo.TabIndex = 4; - this.chkEmbedComicInfo.Text = "Embed Book Info"; - this.chkEmbedComicInfo.UseVisualStyleBackColor = true; - // - // cbComicFormat - // - this.cbComicFormat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.cbCompression.Location = new System.Drawing.Point(116, 70); + this.cbCompression.Name = "cbCompression"; + this.cbCompression.Size = new System.Drawing.Size(151, 21); + this.cbCompression.TabIndex = 3; + // + // labelCompression + // + this.labelCompression.Location = new System.Drawing.Point(12, 70); + this.labelCompression.Name = "labelCompression"; + this.labelCompression.Size = new System.Drawing.Size(98, 21); + this.labelCompression.TabIndex = 2; + this.labelCompression.Text = "Compression:"; + this.labelCompression.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // chkEmbedComicInfo + // + this.chkEmbedComicInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chkEmbedComicInfo.AutoSize = true; + this.chkEmbedComicInfo.Location = new System.Drawing.Point(295, 73); + this.chkEmbedComicInfo.Name = "chkEmbedComicInfo"; + this.chkEmbedComicInfo.Size = new System.Drawing.Size(108, 17); + this.chkEmbedComicInfo.TabIndex = 4; + this.chkEmbedComicInfo.Text = "Embed Book Info"; + this.chkEmbedComicInfo.UseVisualStyleBackColor = true; + // + // cbComicFormat + // + this.cbComicFormat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.cbComicFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbComicFormat.FormattingEnabled = true; - this.cbComicFormat.Items.AddRange(new object[] { + this.cbComicFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbComicFormat.FormattingEnabled = true; + this.cbComicFormat.Items.AddRange(new object[] { "Same as Original"}); - this.cbComicFormat.Location = new System.Drawing.Point(116, 43); - this.cbComicFormat.Name = "cbComicFormat"; - this.cbComicFormat.Size = new System.Drawing.Size(340, 21); - this.cbComicFormat.TabIndex = 1; - // - // labelComicFormat - // - this.labelComicFormat.Location = new System.Drawing.Point(9, 43); - this.labelComicFormat.Name = "labelComicFormat"; - this.labelComicFormat.Size = new System.Drawing.Size(101, 21); - this.labelComicFormat.TabIndex = 0; - this.labelComicFormat.Text = "Format:"; - this.labelComicFormat.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // txRemovedPages - // - this.txRemovedPages.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.cbComicFormat.Location = new System.Drawing.Point(116, 43); + this.cbComicFormat.Name = "cbComicFormat"; + this.cbComicFormat.Size = new System.Drawing.Size(340, 21); + this.cbComicFormat.TabIndex = 1; + // + // labelComicFormat + // + this.labelComicFormat.Location = new System.Drawing.Point(9, 43); + this.labelComicFormat.Name = "labelComicFormat"; + this.labelComicFormat.Size = new System.Drawing.Size(101, 21); + this.labelComicFormat.TabIndex = 0; + this.labelComicFormat.Text = "Format:"; + this.labelComicFormat.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txRemovedPages + // + this.txRemovedPages.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txRemovedPages.AutoEllipsis = true; - this.txRemovedPages.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.txRemovedPages.Location = new System.Drawing.Point(116, 141); - this.txRemovedPages.Name = "txRemovedPages"; - this.txRemovedPages.Size = new System.Drawing.Size(312, 21); - this.txRemovedPages.TabIndex = 8; - this.txRemovedPages.Text = "Lorem Ipsum"; - this.txRemovedPages.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.txRemovedPages.UseMnemonic = false; - // - // labelRemovePageFilter - // - this.labelRemovePageFilter.Location = new System.Drawing.Point(9, 141); - this.labelRemovePageFilter.Name = "labelRemovePageFilter"; - this.labelRemovePageFilter.Size = new System.Drawing.Size(101, 21); - this.labelRemovePageFilter.TabIndex = 7; - this.labelRemovePageFilter.Text = "Remove Pages:"; - this.labelRemovePageFilter.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // grpFileNaming - // - this.grpFileNaming.Controls.Add(this.txCustomStartIndex); - this.grpFileNaming.Controls.Add(this.labelCustomStartIndex); - this.grpFileNaming.Controls.Add(this.txCustomName); - this.grpFileNaming.Controls.Add(this.labelCustomNaming); - this.grpFileNaming.Controls.Add(this.cbNamingTemplate); - this.grpFileNaming.Controls.Add(this.labelNamingTemplate); - this.grpFileNaming.Dock = System.Windows.Forms.DockStyle.Top; - this.grpFileNaming.Location = new System.Drawing.Point(4, 226); - this.grpFileNaming.Name = "grpFileNaming"; - this.grpFileNaming.Size = new System.Drawing.Size(473, 130); - this.grpFileNaming.TabIndex = 9; - this.grpFileNaming.Text = "File Naming"; - // - // txCustomStartIndex - // - this.txCustomStartIndex.Location = new System.Drawing.Point(116, 98); - this.txCustomStartIndex.Maximum = new decimal(new int[] { + this.txRemovedPages.AutoEllipsis = true; + this.txRemovedPages.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.txRemovedPages.Location = new System.Drawing.Point(116, 141); + this.txRemovedPages.Name = "txRemovedPages"; + this.txRemovedPages.Size = new System.Drawing.Size(312, 21); + this.txRemovedPages.TabIndex = 8; + this.txRemovedPages.Text = "Lorem Ipsum"; + this.txRemovedPages.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.txRemovedPages.UseMnemonic = false; + // + // labelRemovePageFilter + // + this.labelRemovePageFilter.Location = new System.Drawing.Point(9, 141); + this.labelRemovePageFilter.Name = "labelRemovePageFilter"; + this.labelRemovePageFilter.Size = new System.Drawing.Size(101, 21); + this.labelRemovePageFilter.TabIndex = 7; + this.labelRemovePageFilter.Text = "Remove Pages:"; + this.labelRemovePageFilter.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // grpFileNaming + // + this.grpFileNaming.Controls.Add(this.txCustomStartIndex); + this.grpFileNaming.Controls.Add(this.labelCustomStartIndex); + this.grpFileNaming.Controls.Add(this.txCustomName); + this.grpFileNaming.Controls.Add(this.labelCustomNaming); + this.grpFileNaming.Controls.Add(this.cbNamingTemplate); + this.grpFileNaming.Controls.Add(this.labelNamingTemplate); + this.grpFileNaming.Dock = System.Windows.Forms.DockStyle.Top; + this.grpFileNaming.Location = new System.Drawing.Point(4, 226); + this.grpFileNaming.Name = "grpFileNaming"; + this.grpFileNaming.Size = new System.Drawing.Size(473, 130); + this.grpFileNaming.TabIndex = 9; + this.grpFileNaming.Text = "File Naming"; + // + // txCustomStartIndex + // + this.txCustomStartIndex.Location = new System.Drawing.Point(116, 98); + this.txCustomStartIndex.Maximum = new decimal(new int[] { 100000, 0, 0, 0}); - this.txCustomStartIndex.Name = "txCustomStartIndex"; - this.txCustomStartIndex.Size = new System.Drawing.Size(67, 20); - this.txCustomStartIndex.TabIndex = 5; - this.txCustomStartIndex.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.txCustomStartIndex.Value = new decimal(new int[] { + this.txCustomStartIndex.Name = "txCustomStartIndex"; + this.txCustomStartIndex.Size = new System.Drawing.Size(67, 20); + this.txCustomStartIndex.TabIndex = 5; + this.txCustomStartIndex.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txCustomStartIndex.Value = new decimal(new int[] { 1000, 0, 0, 0}); - // - // labelCustomStartIndex - // - this.labelCustomStartIndex.Location = new System.Drawing.Point(6, 98); - this.labelCustomStartIndex.Name = "labelCustomStartIndex"; - this.labelCustomStartIndex.Size = new System.Drawing.Size(104, 21); - this.labelCustomStartIndex.TabIndex = 4; - this.labelCustomStartIndex.Text = "Start:"; - this.labelCustomStartIndex.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // txCustomName - // - this.txCustomName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + // labelCustomStartIndex + // + this.labelCustomStartIndex.Location = new System.Drawing.Point(6, 98); + this.labelCustomStartIndex.Name = "labelCustomStartIndex"; + this.labelCustomStartIndex.Size = new System.Drawing.Size(104, 21); + this.labelCustomStartIndex.TabIndex = 4; + this.labelCustomStartIndex.Text = "Start:"; + this.labelCustomStartIndex.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txCustomName + // + this.txCustomName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txCustomName.Location = new System.Drawing.Point(116, 72); - this.txCustomName.Name = "txCustomName"; - this.txCustomName.Size = new System.Drawing.Size(340, 20); - this.txCustomName.TabIndex = 3; - // - // labelCustomNaming - // - this.labelCustomNaming.Location = new System.Drawing.Point(6, 71); - this.labelCustomNaming.Name = "labelCustomNaming"; - this.labelCustomNaming.Size = new System.Drawing.Size(104, 21); - this.labelCustomNaming.TabIndex = 2; - this.labelCustomNaming.Text = "Custom:"; - this.labelCustomNaming.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // cbNamingTemplate - // - this.cbNamingTemplate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txCustomName.Location = new System.Drawing.Point(116, 72); + this.txCustomName.Name = "txCustomName"; + this.txCustomName.Size = new System.Drawing.Size(340, 20); + this.txCustomName.TabIndex = 3; + // + // labelCustomNaming + // + this.labelCustomNaming.Location = new System.Drawing.Point(6, 71); + this.labelCustomNaming.Name = "labelCustomNaming"; + this.labelCustomNaming.Size = new System.Drawing.Size(104, 21); + this.labelCustomNaming.TabIndex = 2; + this.labelCustomNaming.Text = "Custom:"; + this.labelCustomNaming.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // cbNamingTemplate + // + this.cbNamingTemplate.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.cbNamingTemplate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbNamingTemplate.FormattingEnabled = true; - this.cbNamingTemplate.Items.AddRange(new object[] { + this.cbNamingTemplate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbNamingTemplate.FormattingEnabled = true; + this.cbNamingTemplate.Items.AddRange(new object[] { "Filename", "Book Caption", "Custom"}); - this.cbNamingTemplate.Location = new System.Drawing.Point(116, 45); - this.cbNamingTemplate.Name = "cbNamingTemplate"; - this.cbNamingTemplate.Size = new System.Drawing.Size(340, 21); - this.cbNamingTemplate.TabIndex = 1; - this.cbNamingTemplate.SelectedIndexChanged += new System.EventHandler(this.cbNamingTemplate_SelectedIndexChanged); - // - // labelNamingTemplate - // - this.labelNamingTemplate.Location = new System.Drawing.Point(6, 45); - this.labelNamingTemplate.Name = "labelNamingTemplate"; - this.labelNamingTemplate.Size = new System.Drawing.Size(104, 21); - this.labelNamingTemplate.TabIndex = 0; - this.labelNamingTemplate.Text = "Template:"; - this.labelNamingTemplate.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // grpExportLocation - // - this.grpExportLocation.Controls.Add(this.chkCombine); - this.grpExportLocation.Controls.Add(this.chkOverwrite); - this.grpExportLocation.Controls.Add(this.chkAddNewToLibrary); - this.grpExportLocation.Controls.Add(this.chkDeleteOriginal); - this.grpExportLocation.Controls.Add(this.btChooseFolder); - this.grpExportLocation.Controls.Add(this.txFolder); - this.grpExportLocation.Controls.Add(this.labelFolder); - this.grpExportLocation.Controls.Add(this.cbExport); - this.grpExportLocation.Controls.Add(this.labelExportTo); - this.grpExportLocation.Dock = System.Windows.Forms.DockStyle.Top; - this.grpExportLocation.Location = new System.Drawing.Point(4, 4); - this.grpExportLocation.Name = "grpExportLocation"; - this.grpExportLocation.Size = new System.Drawing.Size(473, 222); - this.grpExportLocation.TabIndex = 0; - this.grpExportLocation.TabStop = false; - this.grpExportLocation.Text = "Export Location"; - // - // chkCombine - // - this.chkCombine.AutoSize = true; - this.chkCombine.Location = new System.Drawing.Point(117, 113); - this.chkCombine.Name = "chkCombine"; - this.chkCombine.Size = new System.Drawing.Size(147, 17); - this.chkCombine.TabIndex = 5; - this.chkCombine.Text = "Combine all selected Files"; - this.chkCombine.UseVisualStyleBackColor = true; - // - // chkOverwrite - // - this.chkOverwrite.AutoSize = true; - this.chkOverwrite.Location = new System.Drawing.Point(117, 136); - this.chkOverwrite.Name = "chkOverwrite"; - this.chkOverwrite.Size = new System.Drawing.Size(133, 17); - this.chkOverwrite.TabIndex = 6; - this.chkOverwrite.Text = "Overwrite existing Files"; - this.chkOverwrite.UseVisualStyleBackColor = true; - // - // chkAddNewToLibrary - // - this.chkAddNewToLibrary.AutoSize = true; - this.chkAddNewToLibrary.Location = new System.Drawing.Point(117, 182); - this.chkAddNewToLibrary.Name = "chkAddNewToLibrary"; - this.chkAddNewToLibrary.Size = new System.Drawing.Size(188, 17); - this.chkAddNewToLibrary.TabIndex = 8; - this.chkAddNewToLibrary.Text = "Add newly created Book to Library"; - this.chkAddNewToLibrary.UseVisualStyleBackColor = true; - // - // chkDeleteOriginal - // - this.chkDeleteOriginal.AutoSize = true; - this.chkDeleteOriginal.Location = new System.Drawing.Point(117, 159); - this.chkDeleteOriginal.Name = "chkDeleteOriginal"; - this.chkDeleteOriginal.Size = new System.Drawing.Size(231, 17); - this.chkDeleteOriginal.TabIndex = 7; - this.chkDeleteOriginal.Text = "Delete original Book after successful Export"; - this.chkDeleteOriginal.UseVisualStyleBackColor = true; - // - // btChooseFolder - // - this.btChooseFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btChooseFolder.Location = new System.Drawing.Point(381, 70); - this.btChooseFolder.Name = "btChooseFolder"; - this.btChooseFolder.Size = new System.Drawing.Size(75, 23); - this.btChooseFolder.TabIndex = 4; - this.btChooseFolder.Text = "Choose..."; - this.btChooseFolder.UseVisualStyleBackColor = true; - this.btChooseFolder.Click += new System.EventHandler(this.btChooseFolder_Click); - // - // txFolder - // - this.txFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.cbNamingTemplate.Location = new System.Drawing.Point(116, 45); + this.cbNamingTemplate.Name = "cbNamingTemplate"; + this.cbNamingTemplate.Size = new System.Drawing.Size(340, 21); + this.cbNamingTemplate.TabIndex = 1; + this.cbNamingTemplate.SelectedIndexChanged += new System.EventHandler(this.cbNamingTemplate_SelectedIndexChanged); + // + // labelNamingTemplate + // + this.labelNamingTemplate.Location = new System.Drawing.Point(6, 45); + this.labelNamingTemplate.Name = "labelNamingTemplate"; + this.labelNamingTemplate.Size = new System.Drawing.Size(104, 21); + this.labelNamingTemplate.TabIndex = 0; + this.labelNamingTemplate.Text = "Template:"; + this.labelNamingTemplate.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // grpExportLocation + // + this.grpExportLocation.Controls.Add(this.chkCombine); + this.grpExportLocation.Controls.Add(this.chkOverwrite); + this.grpExportLocation.Controls.Add(this.chkAddNewToLibrary); + this.grpExportLocation.Controls.Add(this.chkDeleteOriginal); + this.grpExportLocation.Controls.Add(this.btChooseFolder); + this.grpExportLocation.Controls.Add(this.txFolder); + this.grpExportLocation.Controls.Add(this.labelFolder); + this.grpExportLocation.Controls.Add(this.cbExport); + this.grpExportLocation.Controls.Add(this.labelExportTo); + this.grpExportLocation.Dock = System.Windows.Forms.DockStyle.Top; + this.grpExportLocation.Location = new System.Drawing.Point(4, 4); + this.grpExportLocation.Name = "grpExportLocation"; + this.grpExportLocation.Size = new System.Drawing.Size(473, 222); + this.grpExportLocation.TabIndex = 0; + this.grpExportLocation.TabStop = false; + this.grpExportLocation.Text = "Export Location"; + // + // chkCombine + // + this.chkCombine.AutoSize = true; + this.chkCombine.Location = new System.Drawing.Point(117, 113); + this.chkCombine.Name = "chkCombine"; + this.chkCombine.Size = new System.Drawing.Size(147, 17); + this.chkCombine.TabIndex = 5; + this.chkCombine.Text = "Combine all selected Files"; + this.chkCombine.UseVisualStyleBackColor = true; + // + // chkOverwrite + // + this.chkOverwrite.AutoSize = true; + this.chkOverwrite.Location = new System.Drawing.Point(117, 136); + this.chkOverwrite.Name = "chkOverwrite"; + this.chkOverwrite.Size = new System.Drawing.Size(133, 17); + this.chkOverwrite.TabIndex = 6; + this.chkOverwrite.Text = "Overwrite existing Files"; + this.chkOverwrite.UseVisualStyleBackColor = true; + // + // chkAddNewToLibrary + // + this.chkAddNewToLibrary.AutoSize = true; + this.chkAddNewToLibrary.Location = new System.Drawing.Point(117, 182); + this.chkAddNewToLibrary.Name = "chkAddNewToLibrary"; + this.chkAddNewToLibrary.Size = new System.Drawing.Size(188, 17); + this.chkAddNewToLibrary.TabIndex = 8; + this.chkAddNewToLibrary.Text = "Add newly created Book to Library"; + this.chkAddNewToLibrary.UseVisualStyleBackColor = true; + // + // chkDeleteOriginal + // + this.chkDeleteOriginal.AutoSize = true; + this.chkDeleteOriginal.Location = new System.Drawing.Point(117, 159); + this.chkDeleteOriginal.Name = "chkDeleteOriginal"; + this.chkDeleteOriginal.Size = new System.Drawing.Size(231, 17); + this.chkDeleteOriginal.TabIndex = 7; + this.chkDeleteOriginal.Text = "Delete original Book after successful Export"; + this.chkDeleteOriginal.UseVisualStyleBackColor = true; + // + // btChooseFolder + // + this.btChooseFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btChooseFolder.Location = new System.Drawing.Point(381, 70); + this.btChooseFolder.Name = "btChooseFolder"; + this.btChooseFolder.Size = new System.Drawing.Size(75, 23); + this.btChooseFolder.TabIndex = 4; + this.btChooseFolder.Text = "Choose..."; + this.btChooseFolder.UseVisualStyleBackColor = true; + this.btChooseFolder.Click += new System.EventHandler(this.btChooseFolder_Click); + // + // txFolder + // + this.txFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txFolder.AutoEllipsis = true; - this.txFolder.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.txFolder.Location = new System.Drawing.Point(116, 72); - this.txFolder.Name = "txFolder"; - this.txFolder.Size = new System.Drawing.Size(259, 21); - this.txFolder.TabIndex = 3; - this.txFolder.Text = "Lorem Ipsum"; - this.txFolder.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.txFolder.UseMnemonic = false; - // - // labelFolder - // - this.labelFolder.Location = new System.Drawing.Point(9, 73); - this.labelFolder.Name = "labelFolder"; - this.labelFolder.Size = new System.Drawing.Size(101, 21); - this.labelFolder.TabIndex = 2; - this.labelFolder.Text = "Folder:"; - this.labelFolder.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // cbExport - // - this.cbExport.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txFolder.AutoEllipsis = true; + this.txFolder.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.txFolder.Location = new System.Drawing.Point(116, 72); + this.txFolder.Name = "txFolder"; + this.txFolder.Size = new System.Drawing.Size(259, 21); + this.txFolder.TabIndex = 3; + this.txFolder.Text = "Lorem Ipsum"; + this.txFolder.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.txFolder.UseMnemonic = false; + // + // labelFolder + // + this.labelFolder.Location = new System.Drawing.Point(9, 73); + this.labelFolder.Name = "labelFolder"; + this.labelFolder.Size = new System.Drawing.Size(101, 21); + this.labelFolder.TabIndex = 2; + this.labelFolder.Text = "Folder:"; + this.labelFolder.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // cbExport + // + this.cbExport.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.cbExport.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbExport.FormattingEnabled = true; - this.cbExport.Items.AddRange(new object[] { + this.cbExport.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbExport.FormattingEnabled = true; + this.cbExport.Items.AddRange(new object[] { "Select a Folder", "Same Folder as the original Book", "Same Folder and replace in Library", "Ask before Export"}); - this.cbExport.Location = new System.Drawing.Point(116, 43); - this.cbExport.Name = "cbExport"; - this.cbExport.Size = new System.Drawing.Size(340, 21); - this.cbExport.TabIndex = 1; - // - // labelExportTo - // - this.labelExportTo.Location = new System.Drawing.Point(6, 43); - this.labelExportTo.Name = "labelExportTo"; - this.labelExportTo.Size = new System.Drawing.Size(104, 21); - this.labelExportTo.TabIndex = 0; - this.labelExportTo.Text = "Export To:"; - this.labelExportTo.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // ExportComicsDialog - // - this.AcceptButton = this.btOK; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btCancel; - this.ClientSize = new System.Drawing.Size(752, 472); - this.Controls.Add(this.exportSettings); - this.Controls.Add(this.btRemovePreset); - this.Controls.Add(this.btSavePreset); - this.Controls.Add(this.tvPresets); - this.Controls.Add(this.btOK); - this.Controls.Add(this.btCancel); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ExportComicsDialog"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Export Books"; - this.exportSettings.ResumeLayout(false); - this.grpImageProcessing.ResumeLayout(false); - this.grpImageProcessing.PerformLayout(); - this.grpCustomProcessing.ResumeLayout(false); - this.grpCustomProcessing.PerformLayout(); - this.grpPageFormat.ResumeLayout(false); - this.grpPageFormat.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.txHeight)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.txWidth)).EndInit(); - this.grpFileFormat.ResumeLayout(false); - this.grpFileFormat.PerformLayout(); - this.grpFileNaming.ResumeLayout(false); - this.grpFileNaming.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.txCustomStartIndex)).EndInit(); - this.grpExportLocation.ResumeLayout(false); - this.grpExportLocation.PerformLayout(); - this.ResumeLayout(false); + this.cbExport.Location = new System.Drawing.Point(116, 43); + this.cbExport.Name = "cbExport"; + this.cbExport.Size = new System.Drawing.Size(340, 21); + this.cbExport.TabIndex = 1; + // + // labelExportTo + // + this.labelExportTo.Location = new System.Drawing.Point(6, 43); + this.labelExportTo.Name = "labelExportTo"; + this.labelExportTo.Size = new System.Drawing.Size(104, 21); + this.labelExportTo.TabIndex = 0; + this.labelExportTo.Text = "Export To:"; + this.labelExportTo.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // chkLossless + // + this.chkLossless.AutoSize = true; + this.chkLossless.Location = new System.Drawing.Point(110, 201); + this.chkLossless.Name = "chkLossless"; + this.chkLossless.Size = new System.Drawing.Size(128, 17); + this.chkLossless.TabIndex = 14; + this.chkLossless.Text = "Lossless compression"; + this.chkLossless.UseVisualStyleBackColor = true; + // + // ExportComicsDialog + // + this.AcceptButton = this.btOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btCancel; + this.ClientSize = new System.Drawing.Size(752, 472); + this.Controls.Add(this.exportSettings); + this.Controls.Add(this.btRemovePreset); + this.Controls.Add(this.btSavePreset); + this.Controls.Add(this.tvPresets); + this.Controls.Add(this.btOK); + this.Controls.Add(this.btCancel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ExportComicsDialog"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Export Books"; + this.exportSettings.ResumeLayout(false); + this.grpImageProcessing.ResumeLayout(false); + this.grpImageProcessing.PerformLayout(); + this.grpCustomProcessing.ResumeLayout(false); + this.grpCustomProcessing.PerformLayout(); + this.grpPageFormat.ResumeLayout(false); + this.grpPageFormat.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.txHeight)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txWidth)).EndInit(); + this.grpFileFormat.ResumeLayout(false); + this.grpFileFormat.PerformLayout(); + this.grpFileNaming.ResumeLayout(false); + this.grpFileNaming.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.txCustomStartIndex)).EndInit(); + this.grpExportLocation.ResumeLayout(false); + this.grpExportLocation.PerformLayout(); + this.ResumeLayout(false); } @@ -1046,5 +1058,6 @@ private void InitializeComponent() private CheckBox chkKeepOriginalNames; private TextBoxEx txTagsToAppend; private Label labelTagToAppend; - } + private CheckBox chkLossless; + } } diff --git a/ComicRack/Dialogs/ExportComicsDialog.cs b/ComicRack/Dialogs/ExportComicsDialog.cs index 08c6452d..fcb5022b 100644 --- a/ComicRack/Dialogs/ExportComicsDialog.cs +++ b/ComicRack/Dialogs/ExportComicsDialog.cs @@ -110,7 +110,8 @@ public ExportSetting Setting IncludePages = txIncludePages.Text, PageType = (StoragePageType)cbPageFormat.SelectedIndex, PageCompression = tbQuality.Value, - PageResize = (StoragePageResize)cbPageResize.SelectedIndex, + Lossless = chkLossless.Checked, + PageResize = (StoragePageResize)cbPageResize.SelectedIndex, PageWidth = (int)txWidth.Value, PageHeight = (int)txHeight.Value, DontEnlarge = chkDontEnlarge.Checked, @@ -141,7 +142,8 @@ public ExportSetting Setting txIncludePages.Text = value.IncludePages; cbPageFormat.SelectedIndex = (int)value.PageType < cbPageFormat.Items.Count ? (int)value.PageType : 0; tbQuality.Value = value.PageCompression; - cbPageResize.SelectedIndex = (int)value.PageResize; + chkLossless.Checked = value.Lossless; + cbPageResize.SelectedIndex = (int)value.PageResize; txWidth.Value = value.PageWidth; txHeight.Value = value.PageHeight; chkDontEnlarge.Checked = value.DontEnlarge; @@ -163,7 +165,7 @@ public ExportComicsDialog() { LocalizeUtility.UpdateRightToLeft(this); InitializeComponent(); - if (Environment.Is64BitProcess) this.cbPageFormat.Items.AddRange(new object[] { "HEIF", "AVIF" }); + if (Environment.Is64BitProcess) this.cbPageFormat.Items.AddRange(new object[] { "HEIF", "AVIF", "JpegXL" }); LocalizeUtility.Localize(this, null); foreach (ComboBox control in this.GetControls()) { @@ -202,8 +204,10 @@ private void OnIdle(object sender, EventArgs e) checkBox.Enabled = enabled; txCustomStartIndex.Enabled = setting.Naming == ExportNaming.Custom; txCustomName.Enabled = setting.Naming == ExportNaming.Custom || setting.Naming == ExportNaming.Caption; - tbQuality.Enabled = setting.PageType == StoragePageType.Jpeg || setting.PageType == StoragePageType.Webp || setting.PageType == StoragePageType.Heif || setting.PageType == StoragePageType.Avif; - txWidth.Enabled = setting.PageResize != StoragePageResize.Height && setting.PageResize != StoragePageResize.Original; + chkLossless.Enabled = setting.PageType == StoragePageType.JpegXL; // Only enable Lossless option for JpegXL format, as it's the only one that supports it + chkLossless.Checked = setting.PageType == StoragePageType.JpegXL ? setting.Lossless : false; // Force Lossless to be unchecked for formats that don't support it + tbQuality.Enabled = setting.PageType == StoragePageType.Jpeg || setting.PageType == StoragePageType.Webp || setting.PageType == StoragePageType.Heif || setting.PageType == StoragePageType.Avif || (setting.PageType == StoragePageType.JpegXL && !setting.Lossless); + txWidth.Enabled = setting.PageResize != StoragePageResize.Height && setting.PageResize != StoragePageResize.Original; txHeight.Enabled = setting.PageResize != StoragePageResize.Width && setting.PageResize != StoragePageResize.Original; chkDontEnlarge.Enabled = setting.PageResize != StoragePageResize.Original; btRemovePreset.Enabled = tvPresets.SelectedNode != null && tvPresets.SelectedNode.Parent != null && (bool)tvPresets.SelectedNode.Parent.Tag; diff --git a/ComicRack/Output/ComicRack.ini b/ComicRack/Output/ComicRack.ini index 4440e50d..343ad245 100644 --- a/ComicRack/Output/ComicRack.ini +++ b/ComicRack/Output/ComicRack.ini @@ -262,6 +262,17 @@ ; Set this to limit the size of generated pages ; DjVuSizeLimit = 2000, 2000 +; ------------------------------------------------------------------ +; JpegXL + +; Compression effort 1-9 (higher = better compression but slower) +; JpegXLEncoderEffort = 7 + +; Only applies when using the lossless compression export setting with JpegXL. (Default is false) +; Force lossless reconstruction to JPEGs, is not true JPEG Reconstruction. It's just a trick to make it work since it ignores original JPEGs. +; Should not be used as it will cause a quality loss since it introduces a JPEG conversion step. +; ForceJpegReconstruction = true + ; ------------------------------------------------------------------ ; Background Graphic for lists diff --git a/ComicRack/Output/Languages/fr/ExportComicsDialog.xml b/ComicRack/Output/Languages/fr/ExportComicsDialog.xml index 88a998e3..c7092b77 100644 --- a/ComicRack/Output/Languages/fr/ExportComicsDialog.xml +++ b/ComicRack/Output/Languages/fr/ExportComicsDialog.xml @@ -68,5 +68,6 @@ + \ No newline at end of file diff --git a/ComicRack/Output/ReadMe.txt b/ComicRack/Output/ReadMe.txt index 7e45fd18..8c0409d1 100644 --- a/ComicRack/Output/ReadMe.txt +++ b/ComicRack/Output/ReadMe.txt @@ -4,10 +4,6 @@ ComicRack is a Comic Reader / Manager for Windows Computers. You can think of it as an ITunes for electronic Comics. -ComicRack is donation-ware. -You are encouraged to donate a small amount to support this project and keep it running. -ComicRack has no functional limitation whatsover if no donation is made. - 2) FEATURE LIST =============== @@ -25,6 +21,7 @@ ComicRack has no functional limitation whatsover if no donation is made. * Batch converting of eComics to all supported formats * Scriptable and extendable * Android with syncinc capabilities +* Dark mode * And much, much more.... This is still a beta version. @@ -67,7 +64,8 @@ Internally: * WEBP * HEIF & HEIC * AVIF - * Jpeg2000 + * Jpeg2000 (read only) + * JpegXl (Lossy & Lossless) 4) NOTABLE UNSUPPORTED ITEMS ============================ diff --git a/ComicRack/Output/Resources/brotlicommon.dll b/ComicRack/Output/Resources/brotlicommon.dll new file mode 100644 index 00000000..8588635e Binary files /dev/null and b/ComicRack/Output/Resources/brotlicommon.dll differ diff --git a/ComicRack/Output/Resources/brotlidec.dll b/ComicRack/Output/Resources/brotlidec.dll new file mode 100644 index 00000000..d7f5a4df Binary files /dev/null and b/ComicRack/Output/Resources/brotlidec.dll differ diff --git a/ComicRack/Output/Resources/brotlienc.dll b/ComicRack/Output/Resources/brotlienc.dll new file mode 100644 index 00000000..f326433b Binary files /dev/null and b/ComicRack/Output/Resources/brotlienc.dll differ diff --git a/ComicRack/Output/Resources/jxl.dll b/ComicRack/Output/Resources/jxl.dll new file mode 100644 index 00000000..32c0f5f4 Binary files /dev/null and b/ComicRack/Output/Resources/jxl.dll differ diff --git a/ComicRack/Output/Resources/jxl_cms.dll b/ComicRack/Output/Resources/jxl_cms.dll new file mode 100644 index 00000000..fbeeb7d5 Binary files /dev/null and b/ComicRack/Output/Resources/jxl_cms.dll differ