Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions ComicRack.Engine/EngineConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,15 @@ public bool DisableNTFS
set;
}

public static EngineConfiguration Default => defaultConfig ?? (defaultConfig = IniFile.Default.Register<EngineConfiguration>());
[DefaultValue(7)] // Valid value are 1-9
public int JpegXLEncoderEffort { get; set; }

public EngineConfiguration()
public static EngineConfiguration Default => defaultConfig ?? (defaultConfig = IniFile.Default.Register<EngineConfiguration>());

[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;
Expand Down Expand Up @@ -650,7 +656,9 @@ public EngineConfiguration()
PdfEngineToUse = PdfEngine.Pdfium;
PdfiumImageSize = new Size(1920, 2540);
DisableNTFS = false;
}
JpegXLEncoderEffort = 7;
ForceJpegReconstruction = false;
}

public string GetTempFileName()
{
Expand Down
3 changes: 2 additions & 1 deletion ComicRack.Engine/IO/Provider/ImageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading