diff --git a/baseunits/Img2Pdf.pas b/baseunits/Img2Pdf.pas
index c29f113fe..17c97bacf 100644
--- a/baseunits/Img2Pdf.pas
+++ b/baseunits/Img2Pdf.pas
@@ -36,7 +36,7 @@ interface
uses
Classes, SysUtils, LazFileUtils, FPimage, ImgInfos, MemBitmap,
FPReadJPEG, FPWriteJPEG, FPReadPNG, JPEGLib, JdAPImin, JDataSrc, Jerror,
- zstream, AnimatedGif, MultiLog;
+ zstream, AnimatedGif, MultiLog, Process, ImageMagickManager;
type
TCompressionQuality = 0..100;
@@ -458,6 +458,9 @@ procedure ImageToPageInfo(const PageInfo: TPageInfo);
end;
procedure TPageInfo.LoadImageData;
+var
+ tmpFile, tmpDir: String;
+ proc: TProcess;
begin
if Assigned(Stream) then Exit;
if Ext = '' then Exit;
@@ -480,6 +483,42 @@ procedure TPageInfo.LoadImageData;
else
ImageToPageInfo(Self);
except
+ on E: Exception do
+ begin
+ FreeAndNil(Stream);
+ if TImageMagickManager.Instance.Enabled then
+ begin
+ tmpDir := ExtractFilePath(FileName);
+ tmpFile := tmpDir + 'pdf_tmp_' + ChangeFileExt(ExtractFileName(FileName), '.jpg');
+ proc := TProcess.Create(nil);
+ try
+ if TImageMagickManager.Instance.PathFound then
+ proc.Executable := TImageMagickManager.Instance.MagickPath + 'magick'
+ else
+ proc.Executable := 'magick';
+ proc.Parameters.Add(FileName);
+ proc.Parameters.Add('-quality');
+ proc.Parameters.Add(IntToStr(Owner.CompressionQuality));
+ proc.Parameters.Add(tmpFile);
+ proc.Options := [poUsePipes, poStderrToOutPut, poNoConsole];
+ proc.ShowWindow := swoHIDE;
+ proc.Execute;
+ proc.WaitOnExit;
+ if FileExists(tmpFile) then
+ begin
+ Ext := 'jpg';
+ Width := 0;
+ Height := 0;
+ GetImageInfos;
+ Stream := TMemoryStream.Create;
+ JPEGToPageInfo(Self);
+ DeleteFile(tmpFile);
+ end;
+ finally
+ proc.Free;
+ end;
+ end;
+ end;
end;
end;
diff --git a/baseunits/ImgInfos.pas b/baseunits/ImgInfos.pas
index c891ceff4..e87199a6c 100644
--- a/baseunits/ImgInfos.pas
+++ b/baseunits/ImgInfos.pas
@@ -629,6 +629,103 @@ procedure WEBPGetImageSize(const Stream: TStream; out Width, Height: Integer);
end;
end;
+function AVIFCheckImageStream(const Stream: TStream): Boolean;
+var
+ Hdr: array[0..3] of Char = (#0, #0, #0, #0);
+begin
+ // Skip box size (bytes 0-3), read 'ftyp' box type at bytes 4-7
+ Result := (Stream.Seek(4, soFromBeginning) = 4) and
+ (Stream.Read(Hdr, 4) = 4) and (Hdr = 'ftyp');
+ if not Result then Exit;
+ // Read major brand at bytes 8-11
+ Result := (Stream.Read(Hdr, 4) = 4) and
+ ((Hdr = 'avif') or (Hdr = 'avis') or (Hdr = 'avio') or (Hdr = 'mif1') or (Hdr = 'msf1'));
+end;
+
+procedure AVIFGetImageSize(const Stream: TStream; out Width, Height: Integer);
+begin
+ Width := 0;
+ Height := 0;
+end;
+
+function JXLCheckImageStream(const Stream: TStream): Boolean;
+var
+ Hdr: array[0..11] of Byte;
+begin
+ Result := Stream.Read(Hdr[0], 12) = 12;
+ if not Result then Exit;
+ // Check for JPEG XL magic: FF 0A (codestream) or 00 00 00 0C 4A 58 4C 20 0D 0A 87 0A (box format)
+ if (Hdr[0] = $FF) and (Hdr[1] = $0A) then
+ Exit(True);
+ if (Hdr[0] = $00) and (Hdr[1] = $00) and (Hdr[2] = $00) and (Hdr[3] = $0C) and
+ (Hdr[4] = $4A) and (Hdr[5] = $58) and (Hdr[6] = $4C) and (Hdr[7] = $20) and
+ (Hdr[8] = $0D) and (Hdr[9] = $0A) and (Hdr[10] = $87) and (Hdr[11] = $0A) then
+ Exit(True);
+ Result := False;
+end;
+
+procedure JXLGetImageSize(const Stream: TStream; out Width, Height: Integer);
+begin
+ Width := 0;
+ Height := 0;
+end;
+
+function HEICCheckImageStream(const Stream: TStream): Boolean;
+var
+ Hdr: array[0..3] of Char = (#0, #0, #0, #0);
+begin
+ Result := (Stream.Read(Hdr, 4) = 4) and (Hdr = 'ftyp');
+ if not Result then Exit;
+ Result := (Stream.Seek(4, soFromCurrent) = 8) and
+ (Stream.Read(Hdr, 4) = 4) and ((Hdr = 'heic') or (Hdr = 'heix') or (Hdr = 'mif1'));
+end;
+
+procedure HEICGetImageSize(const Stream: TStream; out Width, Height: Integer);
+begin
+ Width := 0;
+ Height := 0;
+end;
+
+function TGACheckImageStream(const Stream: TStream): Boolean;
+var
+ Hdr: array[0..1] of Byte;
+ imgType: Byte;
+begin
+ Stream.Read(Hdr[0], 2);
+ imgType := Hdr[1];
+ Result := ((imgType >= 1) and (imgType <= 3)) or ((imgType >= 9) and (imgType <= 11)) or
+ (imgType = 32) or (imgType = 33);
+end;
+
+procedure TGAGetImageSize(const Stream: TStream; out Width, Height: Integer);
+var
+ w, h: Word;
+begin
+ Width := 0;
+ Height := 0;
+ if Stream.Seek(12, soFromBeginning) <> 12 then Exit;
+ if Stream.Read(w, 2) <> 2 then Exit;
+ if Stream.Read(h, 2) <> 2 then Exit;
+ Width := LEtoN(w);
+ Height := LEtoN(h);
+end;
+
+function JP2CheckImageStream(const Stream: TStream): Boolean;
+var
+ Hdr: array[0..11] of Byte = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+begin
+ Result := (Stream.Read(Hdr, 12) = 12) and
+ (Hdr[0] = $00) and (Hdr[1] = $00) and (Hdr[2] = $00) and (Hdr[3] = $0C) and
+ (Hdr[4] = $6A) and (Hdr[5] = $50) and (Hdr[6] = $20) and (Hdr[7] = $20) and
+ (Hdr[8] = $0D) and (Hdr[9] = $0A) and (Hdr[10] = $87) and (Hdr[11] = $0A);
+end;
+
+procedure JP2GetImageSize(const Stream: TStream; out Width, Height: Integer);
+begin
+ Width := 0;
+ Height := 0;
+end;
+
initialization
ImageHandlerMgr := TimageHandlerMgr.Create;
ImageHandlerMgr.Add(TFPReaderJPEG, TFPWriterJPEG, @JPEGCheckImageStream, @JPEGGetImageSize, 'jpg');
@@ -637,6 +734,11 @@ initialization
ImageHandlerMgr.Add(TFPReaderGif, TFPWriterPNG, @GIFCheckImageStream, @GIFGetImageSize, 'gif', 'png');
ImageHandlerMgr.Add(TFPReaderBMP, TFPWriterBMP, @BMPCheckImageStream, @BMPGetImageSize, 'bmp');
ImageHandlerMgr.Add(TFPReaderTiff, TFPWriterTiff, @TIFFCheckImageStream, @TIFFGetImageSize, 'tif');
+ ImageHandlerMgr.Add(nil, nil, @AVIFCheckImageStream, @AVIFGetImageSize, 'avif');
+ ImageHandlerMgr.Add(nil, nil, @JXLCheckImageStream, @JXLGetImageSize, 'jxl');
+ ImageHandlerMgr.Add(nil, nil, @HEICCheckImageStream, @HEICGetImageSize, 'heic');
+ ImageHandlerMgr.Add(nil, nil, @TGACheckImageStream, @TGAGetImageSize, 'tga');
+ ImageHandlerMgr.Add(nil, nil, @JP2CheckImageStream, @JP2GetImageSize, 'jp2');
finalization
ImageHandlerMgr.Free;
diff --git a/baseunits/imagemagickmanager.pas b/baseunits/imagemagickmanager.pas
index 17c4e2233..a343e4ee3 100644
--- a/baseunits/imagemagickmanager.pas
+++ b/baseunits/imagemagickmanager.pas
@@ -1,12 +1,73 @@
unit ImageMagickManager;
{$mode objfpc}{$H+}
+{$PACKRECORDS C}
+{$z4}
interface
uses
- Classes, SysUtils, synautil, StrUtils, StdCtrls, Process, Windows, Registry,
- LazFileUtils, SyncObjs, MultiLog;
+ Classes, SysUtils, synautil, Windows, Registry,
+ LazFileUtils, SyncObjs, Dynlibs;
+
+type
+ MagickBooleanType = (MagickFalse = 0, MagickTrue = 1);
+ PMagickWand = Pointer;
+ PMagickSizeTArray = ^Size_t;
+ Size_t = NativeUInt;
+ PSize_t = ^Size_t;
+ PExceptionType = ^Integer;
+
+ TMagickWandGenesis = procedure; cdecl;
+ TMagickWandTerminus = procedure; cdecl;
+ TNewMagickWand = function: PMagickWand; cdecl;
+ TDestroyMagickWand = function(wand: PMagickWand): PMagickWand; cdecl;
+ TMagickReadImage = function(wand: PMagickWand; filename: PAnsiChar): MagickBooleanType; cdecl;
+ TMagickReadImageBlob = function(wand: PMagickWand; blob: Pointer; length: Size_t): MagickBooleanType; cdecl;
+ TMagickGetImageBlob = function(wand: PMagickWand; length: PSize_t): PByte; cdecl;
+ TMagickGetImagesBlob = function(wand: PMagickWand; length: PSize_t): PByte; cdecl;
+ TMagickSetFormat = function(wand: PMagickWand; format: PAnsiChar): MagickBooleanType; cdecl;
+ TMagickWriteImage = function(wand: PMagickWand; filename: PAnsiChar): MagickBooleanType; cdecl;
+ TMagickWriteImages = function(wand: PMagickWand; filename: PAnsiChar; adjoin: MagickBooleanType): MagickBooleanType; cdecl;
+ TMagickGetException = function(wand: PMagickWand; severity: PExceptionType): PAnsiChar; cdecl;
+ TMagickCoalesceImages = function(wand: PMagickWand): PMagickWand; cdecl;
+ TMagickRelinquishMemory = function(ptr: Pointer): Pointer; cdecl;
+ TMagickQueryFormats = function(pattern: PAnsiChar; number_formats: PInteger): PPAnsiChar; cdecl;
+ TMagickSetImageOption = function(wand: PMagickWand; option: PAnsiChar; value: PAnsiChar): MagickBooleanType; cdecl;
+ TMagickSetImageCompressionQuality = function(wand: PMagickWand; quality: Size_t): MagickBooleanType; cdecl;
+ TMagickSetImageCompression = function(wand: PMagickWand; compression: Integer): MagickBooleanType; cdecl;
+ TMagickResetIterator = procedure(wand: PMagickWand); cdecl;
+ TMagickSetFirstIterator = procedure(wand: PMagickWand); cdecl;
+ TMagickGetImageWidth = function(wand: PMagickWand): Size_t; cdecl;
+ TMagickGetImageHeight = function(wand: PMagickWand): Size_t; cdecl;
+ TMagickGetNumberImages = function(wand: PMagickWand): Size_t; cdecl;
+ TMagickGetImageFormat = function(wand: PMagickWand): PAnsiChar; cdecl;
+
+var
+ pMagickWandGenesis: TMagickWandGenesis = nil;
+ pMagickWandTerminus: TMagickWandTerminus = nil;
+ pNewMagickWand: TNewMagickWand = nil;
+ pDestroyMagickWand: TDestroyMagickWand = nil;
+ pMagickReadImage: TMagickReadImage = nil;
+ pMagickReadImageBlob: TMagickReadImageBlob = nil;
+ pMagickGetImageBlob: TMagickGetImageBlob = nil;
+ pMagickGetImagesBlob: TMagickGetImagesBlob = nil;
+ pMagickSetFormat: TMagickSetFormat = nil;
+ pMagickWriteImage: TMagickWriteImage = nil;
+ pMagickWriteImages: TMagickWriteImages = nil;
+ pMagickGetException: TMagickGetException = nil;
+ pMagickCoalesceImages: TMagickCoalesceImages = nil;
+ pMagickRelinquishMemory: TMagickRelinquishMemory = nil;
+ pMagickQueryFormats: TMagickQueryFormats = nil;
+ pMagickSetImageOption: TMagickSetImageOption = nil;
+ pMagickSetImageCompressionQuality: TMagickSetImageCompressionQuality = nil;
+ pMagickSetImageCompression: TMagickSetImageCompression = nil;
+ pMagickResetIterator: TMagickResetIterator = nil;
+ pMagickSetFirstIterator: TMagickSetFirstIterator = nil;
+ pMagickGetImageWidth: TMagickGetImageWidth = nil;
+ pMagickGetImageHeight: TMagickGetImageHeight = nil;
+ pMagickGetNumberImages: TMagickGetNumberImages = nil;
+ pMagickGetImageFormat: TMagickGetImageFormat = nil;
type
{ TImageMagickManager }
@@ -15,7 +76,7 @@ TImageMagickManager = class
class var FInstance: TImageMagickManager;
class var FInitialized: Boolean;
class var FLock: TCriticalSection;
-
+
FPathFound: Boolean;
FEnabled: Boolean;
FMogrify: Boolean;
@@ -27,40 +88,50 @@ TImageMagickManager = class
FCompression: String;
FLastError: String;
+ FDllHandle: TLibHandle;
+
function FindMagickBinary: Boolean;
- function IdentifyCommand(const QueryCommand: String): TStringList;
+ function LoadMagickDLL: Boolean;
+ procedure UnloadMagickDLL;
procedure CacheSupportedFormats;
procedure CacheCompressionTypes;
- function ExecuteMagickCommand(const Params: array of String; TimeoutMS: Cardinal = 300000): Boolean;
- function StreamToString(Stream: TMemoryStream): String;
+ function GetException(wand: PMagickWand): String;
constructor CreatePrivate;
function GetPathFound: Boolean;
+ function GetMagickPath: String;
function GetEnabled: Boolean;
procedure SetEnabled(AEnabled: Boolean);
function GetMogrify: Boolean;
procedure SetMogrify(AMogrify: Boolean);
function GetSupportedFormats: TStrings;
function GetCompressionTypes: TStrings;
+{$ifdef USE_LCL}
procedure SetComboBoxList(AComboBox: TComboBox; AList: TStringList);
+{$endif}
function GetSaveAs: String;
procedure SetSaveAs(ASaveAs: String);
function GetQuality: Integer;
- function GetQualityString: String;
procedure SetQuality(AQuality: Integer);
function GetCompression: String;
procedure SetCompression(ACompression: String);
function GetLastError: String;
+ function GetTempPathStr: String;
+
+ function WandConvertBlob(Stream: TMemoryStream; const OutputFormat: String; Coalesce: Boolean; const InputFormat: String = ''): TMemoryStream;
public
class function Instance: TImageMagickManager;
class procedure Initialize;
class procedure Finalize;
function IsFormatSupported(const Format: String): Boolean;
+ function Identify(Stream: TStream; const InputFormat: String = ''): String;
+ function ConvertStream(Stream: TStream; const OutputFormat: String; Coalesce: Boolean = False; const InputFormat: String = ''): TMemoryStream;
function ConvertImage(InputFile, OutputDir: String): Boolean;
property PathFound: Boolean read GetPathFound;
- property Enabled: Boolean read GetEnabled write SetEnabled;
+ property MagickPath: String read GetMagickPath;
+ property Enabled: Boolean read GetEnabled write SetEnabled;
property Mogrify: Boolean read GetMogrify write SetMogrify;
property SupportedFormats: TStrings read GetSupportedFormats;
property CompressionTypes: TStrings read GetCompressionTypes;
@@ -76,18 +147,22 @@ TImageMagickManager = class
implementation
+{$ifdef USE_LCL}
uses
- frmMain;
+ MultiLog, frmMain;
+{$endif}
+
+procedure IMLog(const Msg: String);
+begin
+ OutputDebugString(PChar('IM: ' + Msg));
+end;
{ TImageMagickManager }
class function TImageMagickManager.Instance: TImageMagickManager;
begin
if not FInitialized then
- begin
Initialize;
- end;
-
Result := FInstance;
end;
@@ -98,9 +173,8 @@ class procedure TImageMagickManager.Initialize;
FLock := TCriticalSection.Create;
FInitialized := True;
FPathFound := False;
- FEnabled := False;
+ FEnabled := True;
FMogrify := False;
-
FInstance := TImageMagickManager.CreatePrivate;
end;
end;
@@ -109,45 +183,57 @@ class procedure TImageMagickManager.Finalize;
begin
if FInitialized then
begin
+ if Assigned(FInstance) then
+ FInstance.UnloadMagickDLL;
FreeAndNil(FInstance);
FreeAndNil(FLock);
FInitialized := False;
end;
end;
+{$ifdef USE_LCL}
procedure TImageMagickManager.SetComboBoxList(AComboBox: TComboBox; AList: TStringList);
var
SelectedString: String;
SelectedIndex: Integer;
begin
SelectedIndex := AComboBox.ItemIndex;
- SelectedString := AComboBox.Items.ValueFromIndex[SelectedIndex];
-
+ if SelectedIndex >= 0 then
+ SelectedString := AComboBox.Items.ValueFromIndex[SelectedIndex]
+ else
+ SelectedString := '';
AComboBox.Clear;
AComboBox.Items.AddStrings(AList);
-
AComboBox.ItemIndex := AComboBox.Items.IndexOf(SelectedString);
-
if (AComboBox.ItemIndex = -1) and (AComboBox.Items.Count >= 1) then
- begin
AComboBox.ItemIndex := 0;
- end;
end;
+{$endif}
constructor TImageMagickManager.CreatePrivate;
begin
inherited Create;
-
FSupportedFormats := TStringList.Create;
FSupportedFormats.CaseSensitive := False;
FCompressionTypes := TStringList.Create;
FCompressionTypes.CaseSensitive := False;
FQuality := 75;
+ FCompression := 'None';
+ FDllHandle := NilHandle;
if not FindMagickBinary then
begin
+{$ifdef USE_LCL}
MainForm.gbImageMagick.Hint := RS_ImageMagickNotFoundHint;
- Logger.Send(Self.ClassName + ': ImageMagick not found: ' + FLastError);
+{$endif}
+ Exit;
+ end;
+
+ if not LoadMagickDLL then
+ begin
+{$ifdef USE_LCL}
+ MainForm.gbImageMagick.Hint := RS_ImageMagickNotFoundHint;
+{$endif}
Exit;
end;
@@ -155,530 +241,587 @@ constructor TImageMagickManager.CreatePrivate;
CacheSupportedFormats;
CacheCompressionTypes;
+{$ifdef USE_LCL}
with MainForm do
- begin
+ begin
lbImageMagickHint.Visible := False;
gbImageMagick.Enabled := True;
ckImageMagick.Enabled := True;
cbImageMagickSaveAs.Enabled := True;
cbImageMagickCompression.Enabled := True;
seImageMagickQuality.Enabled := True;
-
SetComboBoxList(cbImageMagickSaveAs, FSupportedFormats);
SetComboBoxList(cbImageMagickCompression, FCompressionTypes);
end;
+{$endif}
end;
-function TImageMagickManager.GetPathFound: Boolean;
-begin
- Result := FPathFound;
-end;
-
-function TImageMagickManager.GetEnabled: Boolean;
-begin
- Result := FEnabled;
-end;
-
-procedure TImageMagickManager.SetEnabled(AEnabled: Boolean);
-begin
- FEnabled := AEnabled;
-end;
-
-function TImageMagickManager.GetMogrify: Boolean;
-begin
- Result := FMogrify;
-end;
-
-procedure TImageMagickManager.SetMogrify(AMogrify: Boolean);
-begin
- FMogrify := AMogrify;
-end;
-
-function TImageMagickManager.GetSupportedFormats: TStrings;
-begin
- Result := FSupportedFormats;
-end;
-
-function TImageMagickManager.GetCompressionTypes: TStrings;
-begin
- Result := FCompressionTypes;
-end;
-
-function TImageMagickManager.GetSaveAs: String;
-begin
- Result := FSaveAs;
-end;
-
-procedure TImageMagickManager.SetSaveAs(ASaveAs: String);
-begin
- FSaveAs := LowerCase(ASaveAs);
-end;
-
-function TImageMagickManager.GetQuality: Integer;
-begin
- Result := FQuality;
-end;
-
-function TImageMagickManager.GetQualityString: String;
-begin
- Result := FQuality.ToString;
-end;
-
-procedure TImageMagickManager.SetQuality(AQuality: Integer);
-begin
- FQuality := AQuality;
-end;
-
-function TImageMagickManager.GetCompression: String;
-begin
- Result := FCompression;
-end;
-
-procedure TImageMagickManager.SetCompression(ACompression: String);
-begin
- FCompression := ACompression;
-end;
-
+function TImageMagickManager.GetPathFound: Boolean; begin Result := FPathFound; end;
+function TImageMagickManager.GetMagickPath: String; begin Result := FMagickPath; end;
+function TImageMagickManager.GetEnabled: Boolean; begin Result := FEnabled; end;
+procedure TImageMagickManager.SetEnabled(AEnabled: Boolean); begin FEnabled := AEnabled; end;
+function TImageMagickManager.GetMogrify: Boolean; begin Result := FMogrify; end;
+procedure TImageMagickManager.SetMogrify(AMogrify: Boolean); begin FMogrify := AMogrify; end;
+function TImageMagickManager.GetSupportedFormats: TStrings; begin Result := FSupportedFormats; end;
+function TImageMagickManager.GetCompressionTypes: TStrings; begin Result := FCompressionTypes; end;
+function TImageMagickManager.GetSaveAs: String; begin Result := FSaveAs; end;
+procedure TImageMagickManager.SetSaveAs(ASaveAs: String); begin FSaveAs := LowerCase(ASaveAs); end;
+function TImageMagickManager.GetQuality: Integer; begin Result := FQuality; end;
+procedure TImageMagickManager.SetQuality(AQuality: Integer); begin FQuality := AQuality; end;
+function TImageMagickManager.GetCompression: String; begin Result := FCompression; end;
+procedure TImageMagickManager.SetCompression(ACompression: String); begin FCompression := ACompression; end;
function TImageMagickManager.GetLastError: String;
begin
FLock.Acquire;
+ try Result := FLastError; finally FLock.Release; end;
+end;
- try
- Result := FLastError;
- finally
- FLock.Release;
- end;
+function TImageMagickManager.GetTempPathStr: String;
+var
+ Buf: array[0..MAX_PATH] of Char;
+begin
+ Windows.GetTempPath(MAX_PATH, Buf);
+ Result := Trim(Buf);
+ if (Result <> '') and (Result[Length(Result)] <> '\') then
+ Result := Result + '\';
end;
function TImageMagickManager.FindMagickBinary: Boolean;
var
Reg: TRegistry;
Paths: array of String;
- Path: String;
- Dummy: DWORD;
- StartupInfo: TStartupInfo;
- ProcessInfo: TProcessInformation;
- CommandLine: string;
+ SearchPath: String;
+ PathList: TStringList;
+ DllName: String;
+ i: Integer;
begin
Result := False;
FMagickPath := '';
FLastError := '';
+ DllName := 'CORE_RL_MagickWand_.dll';
+
+ SearchPath := ExtractFilePath(ParamStr(0)) + 'ImageMagick_dependency\';
+ if FileExists(SearchPath + DllName) then
+ begin
+ FMagickPath := SearchPath;
+ Result := True;
+ Exit;
+ end;
+
+ SearchPath := ExtractFilePath(ParamStr(0));
+ if FileExists(SearchPath + DllName) then
+ begin
+ FMagickPath := SearchPath;
+ Result := True;
+ Exit;
+ end;
- // 1. Check common installation paths
Paths := [
- 'C:\Program Files\ImageMagick\',
- 'C:\Program Files (x86)\ImageMagick\',
- 'C:\Program Files\ImageMagick-6.*.*\',
- 'C:\Program Files (x86)\ImageMagick-6.*.*\',
- 'C:\Program Files\ImageMagick-7.*.*\',
- 'C:\Program Files (x86)\ImageMagick-7.*.*\',
- 'C:\imagemagick\',
- GetCurrentDir + '\'
+ 'C:\Program Files\ImageMagick-7.1.2-Q16',
+ 'C:\Program Files\ImageMagick-7.1.1-Q16',
+ 'C:\Program Files\ImageMagick-7.1.0-Q16',
+ 'C:\Program Files\ImageMagick-7.0.11-Q16',
+ 'C:\Program Files\ImageMagick-7.0.10-Q16',
+ 'C:\Program Files\ImageMagick-6.9.12-Q16',
+ 'C:\Program Files (x86)\ImageMagick-7.1.2-Q16',
+ 'C:\Program Files (x86)\ImageMagick-7.1.1-Q16'
];
- for Path in Paths do
+ for SearchPath in Paths do
begin
- if FileExists(Path + 'magick.exe') then
+ if FileExists(SearchPath + '\' + DllName) then
begin
- FMagickPath := Path;
- Exit(True);
+ FMagickPath := SearchPath + '\';
+ Result := True;
+ Exit;
end;
end;
- // 2. Check registry
Reg := TRegistry.Create(KEY_READ);
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
- if Reg.OpenKey('SOFTWARE\ImageMagick\Current', False) or
- Reg.OpenKey('SOFTWARE\WOW6432Node\ImageMagick\Current', False) then
+ if Reg.OpenKeyReadOnly('SOFTWARE\Imagemagick\7') or Reg.OpenKeyReadOnly('SOFTWARE\Wow6432Node\Imagemagick\7') then
begin
- FMagickPath := IncludeTrailingPathDelimiter(Reg.ReadString('BinPath'));
-
- if FileExists(FMagickPath + 'magick.exe') then
- begin
- Exit(True);
+ try
+ SearchPath := Reg.ReadString('LibPath');
+ if (SearchPath <> '') and FileExists(SearchPath + '\' + DllName) then
+ begin
+ if SearchPath[Length(SearchPath)] <> '\' then SearchPath := SearchPath + '\';
+ FMagickPath := SearchPath;
+ Result := True;
+ Exit;
+ end;
+ except
end;
end;
finally
Reg.Free;
end;
- // 3. Silent PATH checking using Windows API
- FillChar(StartupInfo, SizeOf(TStartupInfo), 0);
- StartupInfo.cb := SizeOf(TStartupInfo);
- StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
- StartupInfo.wShowWindow := SW_HIDE;
-
- CommandLine := 'magick -version';
-
- if CreateProcess(nil, PChar(CommandLine), nil, nil, False,
- CREATE_NO_WINDOW or NORMAL_PRIORITY_CLASS,
- nil, nil, StartupInfo, ProcessInfo) then
- begin
- try
- WaitForSingleObject(ProcessInfo.hProcess, 1000); // 1 second timeout
- GetExitCodeProcess(ProcessInfo.hProcess, Dummy);
- if Dummy = 0 then
+ PathList := TStringList.Create;
+ try
+ SetLength(SearchPath, 32768);
+ i := GetEnvironmentVariable('PATH', PChar(SearchPath), Length(SearchPath));
+ if i > 0 then
+ begin
+ SetLength(SearchPath, i);
+ PathList.Delimiter := ';';
+ PathList.StrictDelimiter := True;
+ PathList.DelimitedText := SearchPath;
+ for i := 0 to PathList.Count - 1 do
begin
- FMagickPath := ''; // Empty means use system PATH
- Exit(True);
+ SearchPath := PathList[i];
+ if (SearchPath <> '') and FileExists(SearchPath + '\' + DllName) then
+ begin
+ if SearchPath[Length(SearchPath)] <> '\' then SearchPath := SearchPath + '\';
+ FMagickPath := SearchPath;
+ Result := True;
+ Exit;
+ end;
end;
- finally
- CloseHandle(ProcessInfo.hProcess);
- CloseHandle(ProcessInfo.hThread);
end;
+ finally
+ PathList.Free;
end;
- FLastError := 'Could not locate ImageMagick installation.';
+ FLastError := 'ImageMagick DLL not found';
end;
-function TImageMagickManager.IdentifyCommand(const QueryCommand: String): TStringList;
+function TImageMagickManager.LoadMagickDLL: Boolean;
var
- Process: TProcess;
- OutputStream: TMemoryStream;
- BytesRead: LongInt;
- Buffer: array[1..2048] of Byte;
+ DllPath: String;
+ OldDir: String;
+ LastErr: DWORD;
begin
- Process := nil;
- OutputStream := nil;
- Result := TStringList.Create;
+ Result := False;
+ if FDllHandle <> NilHandle then Exit(True);
- try
- try
- // Set up the process
- Process := TProcess.Create(nil);
- if FMagickPath <> '' then
- begin
- Process.Executable := FMagickPath + 'magick';
- end
- else
- begin
- Process.Executable := 'magick';
- end;
+ DllPath := FMagickPath + 'CORE_RL_MagickWand_.dll';
+ if not FileExists(DllPath) then
+ begin
+ FLastError := 'DLL not found: ' + DllPath;
+ Exit;
+ end;
- Process.Parameters.Add('identify');
- Process.Parameters.Add('-list');
- Process.Parameters.Add(QueryCommand);
- Process.Options := [poUsePipes, poStderrToOutPut, poNoConsole];
- Process.ShowWindow := swoHIDE;
+ SetEnvironmentVariable('MAGICK_HOME', PChar(FMagickPath));
+ SetEnvironmentVariable('MAGICK_CONFIGURE_PATH', PChar(FMagickPath));
+ SetEnvironmentVariable('MAGICK_CODER_MODULE_PATH', PChar(FMagickPath + 'modules\coders'));
+ SetEnvironmentVariable('MAGICK_THREAD_LIMIT', '1');
- // Execute the process
- Process.Execute;
+ OldDir := GetCurrentDir;
+ SetCurrentDir(FMagickPath);
+ try
+ FDllHandle := LoadLibrary(PChar(DllPath));
+ if FDllHandle = NilHandle then
+ begin
+ LastErr := Windows.GetLastError;
+ FLastError := 'Failed to load DLL (Error: ' + IntToStr(LastErr) + ')';
+ Exit;
+ end;
- // Capture output while process is running
- OutputStream := TMemoryStream.Create;
- while Process.Running do
- begin
- BytesRead := Process.Output.Read(Buffer, SizeOf(Buffer));
- if BytesRead > 0 then
- begin
- OutputStream.Write(Buffer, BytesRead);
- end
- else
- begin
- Sleep(100); // Prevent busy waiting
- end;
- end;
+ pMagickWandGenesis := TMagickWandGenesis(GetProcAddress(FDllHandle, 'MagickWandGenesis'));
+ pMagickWandTerminus := TMagickWandTerminus(GetProcAddress(FDllHandle, 'MagickWandTerminus'));
+ pNewMagickWand := TNewMagickWand(GetProcAddress(FDllHandle, 'NewMagickWand'));
+ pDestroyMagickWand := TDestroyMagickWand(GetProcAddress(FDllHandle, 'DestroyMagickWand'));
+ pMagickReadImage := TMagickReadImage(GetProcAddress(FDllHandle, 'MagickReadImage'));
+ pMagickReadImageBlob := TMagickReadImageBlob(GetProcAddress(FDllHandle, 'MagickReadImageBlob'));
+ pMagickGetImageBlob := TMagickGetImageBlob(GetProcAddress(FDllHandle, 'MagickGetImageBlob'));
+ pMagickGetImagesBlob := TMagickGetImagesBlob(GetProcAddress(FDllHandle, 'MagickGetImagesBlob'));
+ pMagickSetFormat := TMagickSetFormat(GetProcAddress(FDllHandle, 'MagickSetFormat'));
+ pMagickWriteImage := TMagickWriteImage(GetProcAddress(FDllHandle, 'MagickWriteImage'));
+ pMagickWriteImages := TMagickWriteImages(GetProcAddress(FDllHandle, 'MagickWriteImages'));
+ pMagickGetException := TMagickGetException(GetProcAddress(FDllHandle, 'MagickGetException'));
+ pMagickCoalesceImages := TMagickCoalesceImages(GetProcAddress(FDllHandle, 'MagickCoalesceImages'));
+ pMagickRelinquishMemory := TMagickRelinquishMemory(GetProcAddress(FDllHandle, 'MagickRelinquishMemory'));
+ pMagickQueryFormats := TMagickQueryFormats(GetProcAddress(FDllHandle, 'MagickQueryFormats'));
+ pMagickSetImageOption := TMagickSetImageOption(GetProcAddress(FDllHandle, 'MagickSetImageOption'));
+ pMagickSetImageCompressionQuality := TMagickSetImageCompressionQuality(GetProcAddress(FDllHandle, 'MagickSetImageCompressionQuality'));
+ pMagickSetImageCompression := TMagickSetImageCompression(GetProcAddress(FDllHandle, 'MagickSetImageCompression'));
+ pMagickResetIterator := TMagickResetIterator(GetProcAddress(FDllHandle, 'MagickResetIterator'));
+ pMagickSetFirstIterator := TMagickSetFirstIterator(GetProcAddress(FDllHandle, 'MagickSetFirstIterator'));
+ pMagickGetImageWidth := TMagickGetImageWidth(GetProcAddress(FDllHandle, 'MagickGetImageWidth'));
+ pMagickGetImageHeight := TMagickGetImageHeight(GetProcAddress(FDllHandle, 'MagickGetImageHeight'));
+ pMagickGetNumberImages := TMagickGetNumberImages(GetProcAddress(FDllHandle, 'MagickGetNumberImages'));
+ pMagickGetImageFormat := TMagickGetImageFormat(GetProcAddress(FDllHandle, 'MagickGetImageFormat'));
+
+ pMagickWandGenesis;
+ Result := True;
+ finally
+ SetCurrentDir(OldDir);
+ end;
+end;
- // Read any remaining output after process finishes
- repeat
- BytesRead := Process.Output.Read(Buffer, SizeOf(Buffer));
- if BytesRead > 0 then
- begin
- OutputStream.Write(Buffer, BytesRead);
- end;
- until BytesRead <= 0;
+procedure TImageMagickManager.UnloadMagickDLL;
+begin
+ if FDllHandle <> NilHandle then
+ begin
+ if Assigned(pMagickWandTerminus) then
+ pMagickWandTerminus;
+ FreeLibrary(FDllHandle);
+ FDllHandle := NilHandle;
+ pMagickWandGenesis := nil;
+ pMagickWandTerminus := nil;
+ pNewMagickWand := nil;
+ pDestroyMagickWand := nil;
+ pMagickReadImage := nil;
+ pMagickReadImageBlob := nil;
+ pMagickGetImageBlob := nil;
+ pMagickGetImagesBlob := nil;
+ pMagickSetFormat := nil;
+ pMagickWriteImage := nil;
+ pMagickWriteImages := nil;
+ pMagickGetException := nil;
+ pMagickCoalesceImages := nil;
+ pMagickRelinquishMemory := nil;
+ pMagickQueryFormats := nil;
+ pMagickSetImageOption := nil;
+ pMagickSetImageCompressionQuality := nil;
+ pMagickSetImageCompression := nil;
+ pMagickResetIterator := nil;
+ pMagickSetFirstIterator := nil;
+ pMagickGetImageWidth := nil;
+ pMagickGetImageHeight := nil;
+ pMagickGetNumberImages := nil;
+ pMagickGetImageFormat := nil;
+ end;
+end;
- // Convert output to string list
- OutputStream.Position := 0;
- Result.LoadFromStream(OutputStream);
-
- except
- on E: Exception do
- begin
- FreeAndNil(Result);
- Raise;
- end;
- end;
- finally
- Process.Free;
- OutputStream.Free;
+function TImageMagickManager.GetException(wand: PMagickWand): String;
+var
+ Severity: Integer;
+ Msg: PAnsiChar;
+begin
+ Result := '';
+ if not Assigned(wand) or not Assigned(pMagickGetException) then Exit;
+ Msg := pMagickGetException(wand, @Severity);
+ if Assigned(Msg) then
+ begin
+ Result := String(Msg);
+ if Assigned(pMagickRelinquishMemory) then
+ pMagickRelinquishMemory(Msg);
end;
end;
-procedure TImageMagickManager.CacheSupportedFormats;
+function TImageMagickManager.WandConvertBlob(Stream: TMemoryStream; const OutputFormat: String; Coalesce: Boolean; const InputFormat: String = ''): TMemoryStream;
var
- i, j: Integer;
- Line, FormatName, Capabilities: String;
- OutputList: TStringList;
- Parts: array of String;
- IsValid: Boolean;
+ Wand: PMagickWand;
+ CoalescedWand: PMagickWand;
+ BlobData: PByte;
+ BlobLength: Size_t;
+ FormatUpper: AnsiString;
+ CompressionInt: Integer;
+ SavedCW: Word;
begin
- FSupportedFormats.Clear;
- OutputList := IdentifyCommand('format');
+ SavedCW := Get8087CW;
+ Set8087CW($133F);
+ try
+ IMLog('WandConvertBlob: Start');
+ Result := nil;
+ if not Assigned(pNewMagickWand) then begin IMLog('WandConvertBlob: pNewMagickWand nil'); Exit; end;
+ IMLog('WandConvertBlob: Creating Wand');
+ Wand := pNewMagickWand();
+ if Wand = nil then
+ begin
+ FLastError := 'Failed to create MagickWand';
+ IMLog('WandConvertBlob: ' + FLastError);
+ Exit;
+ end;
+ IMLog('WandConvertBlob: Wand created');
+
+ CoalescedWand := nil;
try
- for i := 0 to OutputList.Count - 1 do
+ IMLog('WandConvertBlob: Stream.Size=' + IntToStr(Stream.Size));
+ IMLog('WandConvertBlob: Stream.Memory=' + IntToStr(NativeInt(Stream.Memory)));
+ Stream.Position := 0;
+ IMLog('WandConvertBlob: Calling pMagickReadImageBlob');
+ if pMagickReadImageBlob(Wand, Stream.Memory, Stream.Size) <> MagickTrue then
begin
- Line := Trim(OutputList[i]);
+ FLastError := 'MagickReadImageBlob failed: ' + GetException(Wand);
+ IMLog('WandConvertBlob: ' + FLastError);
+ Exit;
+ end;
+ IMLog('WandConvertBlob: ReadImageBlob OK');
- // Skip empty lines or description lines (indented)
- if (Line = '') or (Line[1] = ' ') then
+ if Coalesce and Assigned(pMagickCoalesceImages) then
+ begin
+ IMLog('WandConvertBlob: Calling Coalesce');
+ CoalescedWand := pMagickCoalesceImages(Wand);
+ if CoalescedWand = nil then
begin
- Continue;
+ FLastError := 'MagickCoalesceImages failed: ' + GetException(Wand);
+ IMLog('WandConvertBlob: ' + FLastError);
+ Exit;
end;
+ pDestroyMagickWand(Wand);
+ Wand := CoalescedWand;
+ CoalescedWand := nil;
+ IMLog('WandConvertBlob: Coalesce OK');
+ end;
- // Split line into parts (handles multiple spaces)
- Parts := Line.Split([' '], TStringSplitOptions.ExcludeEmpty);
- if Length(Parts) < 3 then
- begin
- Continue;
- end;
+ if Assigned(pMagickResetIterator) then
+ pMagickResetIterator(Wand);
- // Check capabilities are exactly 'rw-' or 'rw+'
- Capabilities := Parts[2];
- if (Capabilities <> 'rw-') and (Capabilities <> 'rw+') then
- begin
- Continue;
- end;
+ FormatUpper := AnsiString(UpperCase(OutputFormat));
+ if Assigned(pMagickSetImageCompressionQuality) then
+ pMagickSetImageCompressionQuality(Wand, FQuality);
- // Get format name (first part), remove * if present
- FormatName := Parts[0];
- if (FormatName <> '') and (FormatName[High(FormatName)] = '*') then
- begin
- FormatName := Copy(FormatName, 1, Length(FormatName) - 1);
- end;
+ if Assigned(pMagickSetImageCompression) then
+ begin
+ CompressionInt := 0;
+ if FCompression = 'LZW' then CompressionInt := 1
+ else if FCompression = 'Zip' then CompressionInt := 2
+ else if FCompression = 'JPEG' then CompressionInt := 3;
+ pMagickSetImageCompression(Wand, CompressionInt);
+ end;
- // Validate format name is all uppercase letters
- IsValid := (Length(FormatName) >= 2);
- for j := 1 to Length(FormatName) do
+ if pMagickSetFormat(Wand, PAnsiChar(FormatUpper)) <> MagickTrue then
+ begin
+ FLastError := 'MagickSetFormat (output) failed: ' + GetException(Wand);
+ IMLog('WandConvertBlob: ' + FLastError);
+ Exit;
+ end;
+ IMLog('WandConvertBlob: SetFormat=' + String(FormatUpper));
+
+ if Assigned(pMagickGetImagesBlob) then
+ begin
+ IMLog('WandConvertBlob: Calling pMagickGetImagesBlob');
+ BlobData := pMagickGetImagesBlob(Wand, @BlobLength);
+ if (BlobData <> nil) and (BlobLength > 0) then
begin
- if not (FormatName[j] in ['A'..'Z']) then
- begin
- IsValid := False;
- Break;
+ IMLog('WandConvertBlob: GetImagesBlob OK (Size=' + IntToStr(BlobLength) + ')');
+ Result := TMemoryStream.Create;
+ try
+ Result.WriteBuffer(BlobData^, BlobLength);
+ Result.Position := 0;
+ except
+ FreeAndNil(Result);
end;
+ end
+ else
+ begin
+ FLastError := 'MagickGetImagesBlob returned no data: ' + GetException(Wand);
+ IMLog('WandConvertBlob: ' + FLastError);
end;
-
- if IsValid then
+ end
+ else if Assigned(pMagickGetImageBlob) then
+ begin
+ IMLog('WandConvertBlob: Calling pMagickGetImageBlob');
+ BlobData := pMagickGetImageBlob(Wand, @BlobLength);
+ if (BlobData <> nil) and (BlobLength > 0) then
+ begin
+ IMLog('WandConvertBlob: GetImageBlob OK (Size=' + IntToStr(BlobLength) + ')');
+ Result := TMemoryStream.Create;
+ try
+ Result.WriteBuffer(BlobData^, BlobLength);
+ Result.Position := 0;
+ except
+ FreeAndNil(Result);
+ end;
+ end
+ else
begin
- FSupportedFormats.Add(FormatName);
+ FLastError := 'MagickGetImageBlob returned no data: ' + GetException(Wand);
+ IMLog('WandConvertBlob: ' + FLastError);
end;
+ end
+ else
+ begin
+ FLastError := 'No blob output function available';
+ IMLog('WandConvertBlob: ' + FLastError);
end;
- // Final cleanup
- FSupportedFormats.Sorted := True;
- FSupportedFormats.Duplicates := dupIgnore;
+ if Assigned(BlobData) and Assigned(pMagickRelinquishMemory) then
+ try
+ pMagickRelinquishMemory(BlobData);
+ except
+ IMLog('WandConvertBlob: Exception during RelinquishMemory (ignored)');
+ end;
finally
- OutputList.Free;
+ try
+ if Assigned(Wand) then
+ pDestroyMagickWand(Wand);
+ except
+ IMLog('WandConvertBlob: Exception during Wand cleanup (ignored)');
+ end;
+ IMLog('WandConvertBlob: Finished');
+ Set8087CW(SavedCW);
end;
-end;
-
-procedure TImageMagickManager.CacheCompressionTypes;
-var
- OutputList: TStringList;
-begin
- OutputList := IdentifyCommand('compress');
-
- try
- FCompressionTypes.Assign(OutputList);
-
- FCompressionTypes.Sorted := True;
- FCompressionTypes.Duplicates := dupIgnore;
finally
- OutputList.Free;
+ Set8087CW(SavedCW);
end;
end;
-function TImageMagickManager.IsFormatSupported(const Format: String): Boolean;
+function TImageMagickManager.Identify(Stream: TStream; const InputFormat: String = ''): String;
+var
+ Wand: PMagickWand;
+ InputMem: TMemoryStream;
+ Width, Height, NumImages: Size_t;
+ FormatStr: PAnsiChar;
begin
- FLock.Acquire;
-
+ Result := '';
+ if not Assigned(pNewMagickWand) then Exit;
+
+ InputMem := TMemoryStream.Create;
try
- Result := FSupportedFormats.IndexOf(Format) >= 0;
+ Stream.Position := 0;
+ InputMem.CopyFrom(Stream, Stream.Size - Stream.Position);
+ InputMem.Position := 0;
+
+ Wand := pNewMagickWand();
+ if Wand = nil then Exit;
+ try
+ if pMagickReadImageBlob(Wand, InputMem.Memory, InputMem.Size) <> MagickTrue then
+ begin
+ FLastError := 'MagickReadImageBlob failed: ' + GetException(Wand);
+ Exit;
+ end;
+
+ Width := 0; Height := 0; NumImages := 0; FormatStr := nil;
+ if Assigned(pMagickGetImageWidth) then Width := pMagickGetImageWidth(Wand);
+ if Assigned(pMagickGetImageHeight) then Height := pMagickGetImageHeight(Wand);
+ if Assigned(pMagickGetNumberImages) then NumImages := pMagickGetNumberImages(Wand);
+ if Assigned(pMagickGetImageFormat) then FormatStr := pMagickGetImageFormat(Wand);
+
+ Result := Format('Format: %s, Width: %d, Height: %d, Frames: %d', [String(FormatStr), Width, Height, NumImages]);
+ if Assigned(FormatStr) and Assigned(pMagickRelinquishMemory) then pMagickRelinquishMemory(FormatStr);
+ finally
+ pDestroyMagickWand(Wand);
+ end;
finally
- FLock.Release;
+ InputMem.Free;
end;
end;
-function TImageMagickManager.ExecuteMagickCommand(const Params: array of String; TimeoutMS: Cardinal = 300000): Boolean;
+function TImageMagickManager.ConvertStream(Stream: TStream; const OutputFormat: String; Coalesce: Boolean = False; const InputFormat: String = ''): TMemoryStream;
var
- Process: TProcess;
- Param, ErrorStreamOutput: String;
- ErrorStream: TMemoryStream;
- BytesRead: Integer;
- Buffer: array[0..4095] of Byte;
- CommandLine: string;
- StartTime: QWord;
- HasOutput: Boolean;
+ InputMem: TMemoryStream;
begin
- Result := False;
+ Result := nil;
+ IMLog('ConvertStream: Start');
FLock.Acquire;
+ IMLog('ConvertStream: Lock acquired');
try
- Process := TProcess.Create(nil);
- ErrorStream := TMemoryStream.Create;
+ FLastError := '';
+ InputMem := TMemoryStream.Create;
try
- // Configure process
- if FMagickPath <> '' then
- begin
- Process.Executable := FMagickPath + 'magick';
- end
- else
- begin
- Process.Executable := 'magick';
- end;
-
- Process.Options := [poUsePipes, poStderrToOutPut, poNoConsole];
- Process.ShowWindow := swoHIDE;
- Process.PipeBufferSize := Length(Buffer);
-
- // Build command line
- CommandLine := Process.Executable;
- for Param in Params do
- begin
- Process.Parameters.Add(Param);
- CommandLine := CommandLine + ' ' + Param;
- end;
-
- Logger.Send(Self.ClassName + ': ' + CommandLine);
-
+ Stream.Position := 0;
+ IMLog('ConvertStream: Stream size=' + IntToStr(Stream.Size));
+ InputMem.CopyFrom(Stream, Stream.Size - Stream.Position);
+ InputMem.Position := 0;
+ IMLog('ConvertStream: Calling WandConvertBlob');
try
- // Start process and timing
- Process.Execute;
- StartTime := GetTickCount64;
- HasOutput := False;
-
- // Monitoring loop
- while Process.Running do
+ Result := WandConvertBlob(InputMem, OutputFormat, Coalesce, InputFormat);
+ IMLog('ConvertStream: WandConvertBlob returned ' + BoolToStr(Assigned(Result), True));
+ except
+ on E: Exception do
begin
- // Check for output
- BytesRead := Process.Output.Read(Buffer, SizeOf(Buffer));
-
- if BytesRead > 0 then
+ if not Assigned(Result) then
begin
- ErrorStream.Write(Buffer, BytesRead);
- HasOutput := True;
- StartTime := GetTickCount64; // Reset timeout on activity
+ FLastError := 'WandConvertBlob exception: ' + E.Message;
+ IMLog('ConvertStream: ' + FLastError);
end
else
begin
- // Check for timeout (no output for TimeoutMS)
- if GetTickCount64 - StartTime > TimeoutMS then
- begin
- Process.Terminate(255); // Custom timeout exit code
- FLastError := Format(
- 'ImageMagick command timed out after %d ms' + sLineBreak +
- 'Command: %s',
- [TimeoutMS, CommandLine]
- );
-
- Exit(False);
- end;
- Sleep(100); // Prevent CPU overload
- end;
- end;
-
- // Capture any remaining output after process exits
- repeat
- BytesRead := Process.Output.Read(Buffer, SizeOf(Buffer));
-
- if BytesRead > 0 then
- begin
- ErrorStream.Write(Buffer, BytesRead);
- HasOutput := True;
- end;
- until BytesRead <= 0;
-
- // Set results
- Result := (Process.ExitStatus = 0);
-
- if not Result then
- begin
- ErrorStream.Position := 0;
- ErrorStreamOutput := 'No output from process';
-
- if HasOutput then
- begin
- ErrorStreamOutput := StreamToString(ErrorStream);
+ IMLog('ConvertStream: WandConvertBlob raised exception but Result is valid: ' + E.Message);
+ FLastError := '';
end;
-
- FLastError := Format(
- 'ImageMagick command failed (Code %d)' + sLineBreak +
- 'Command: %s' + sLineBreak +
- '%s',
- [Process.ExitStatus,
- CommandLine,
- ErrorStreamOutput]
- );
- end;
-
- except
- on E: Exception do
- begin
- FLastError := Format(
- 'ImageMagick execution failed' + sLineBreak +
- 'Command: %s' + sLineBreak +
- 'Exception: %s',
- [CommandLine, E.Message]
- );
-
- Result := False;
end;
end;
finally
- Process.Free;
- ErrorStream.Free;
+ InputMem.Free;
end;
finally
FLock.Release;
+ IMLog('ConvertStream: Lock released');
end;
end;
-function TImageMagickManager.StreamToString(Stream: TMemoryStream): String;
-var
- StringStream: TStringStream;
+function TImageMagickManager.IsFormatSupported(const Format: String): Boolean;
begin
- StringStream := TStringStream.Create('');
- try
- Stream.Position := 0;
- StringStream.CopyFrom(Stream, Stream.Size);
- Result := Trim(StringStream.DataString);
- finally
- StringStream.Free;
- end;
+ Result := FSupportedFormats.IndexOf(LowerCase(Format)) <> -1;
end;
function TImageMagickManager.ConvertImage(InputFile, OutputDir: String): Boolean;
var
- InputFileExt, OutputFile: String;
+ SearchRec: TSearchRec;
+ InputPath, OutputFile, Ext: String;
+ InputStream: TFileStream;
+ OutputStream: TMemoryStream;
begin
- FLock.Acquire;
-
- try
- InputFileExt := StringReplace(ExtractFileExt(InputFile), '.', '', [rfReplaceAll]);
- InputFile := QuoteStr(InputFile, '"');
+ Result := False;
+ if not DirectoryExists(OutputDir) then
+ begin
+ FLastError := 'Output directory not found: ' + OutputDir;
+ Exit;
+ end;
- if LowerCase(InputFileExt) = 'txt' then
- begin
- // tell magick its a list of files with '@'
- InputFile := '@' + InputFile;
+ if Pos('*', InputFile) > 0 then
+ begin
+ InputPath := ExtractFilePath(InputFile);
+ if FindFirst(InputFile, faAnyFile, SearchRec) = 0 then
+ try
+ repeat
+ if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then
+ begin
+ Ext := LowerCase(ExtractFileExt(SearchRec.Name));
+ if Ext <> '' then Delete(Ext, 1, 1);
+ OutputFile := OutputDir + ChangeFileExt(SearchRec.Name, '.' + FSaveAs);
+ InputStream := TFileStream.Create(InputPath + SearchRec.Name, fmOpenRead or fmShareDenyWrite);
+ try
+ OutputStream := ConvertStream(InputStream, FSaveAs, False, Ext);
+ if Assigned(OutputStream) then
+ begin
+ OutputStream.SaveToFile(OutputFile);
+ OutputStream.Free;
+ end;
+ finally
+ InputStream.Free;
+ end;
+ end;
+ until FindNext(SearchRec) <> 0;
+ finally
+ SysUtils.FindClose(SearchRec);
end;
+ Result := True;
+ end
+ else if FileExists(InputFile) then
+ begin
+ Ext := LowerCase(ExtractFileExt(InputFile));
+ if Ext <> '' then Delete(Ext, 1, 1);
+ OutputFile := OutputDir + ChangeFileExt(ExtractFileName(InputFile), '.' + FSaveAs);
+ InputStream := TFileStream.Create(InputFile, fmOpenRead or fmShareDenyWrite);
+ try
+ OutputStream := ConvertStream(InputStream, FSaveAs, False, Ext);
+ if Assigned(OutputStream) then
+ begin
+ OutputStream.SaveToFile(OutputFile);
+ OutputStream.Free;
+ Result := True;
+ end;
+ finally
+ InputStream.Free;
+ end;
+ end
+ else
+ FLastError := 'Input file not found: ' + InputFile;
+end;
- OutputFile := QuoteStr((OutputDir + '%[filename:name].' + FSaveAs), '"');
- OutputDir := QuoteStr(ExcludeTrailingPathDelimiter(OutputDir), '"');
-
- Result := ExecuteMagickCommand([
- IFThen(FMogrify, 'mogrify', InputFile),
- '-quality', GetQualityString,
- '-compress', GetCompression,
- '-format', FSaveAs,
- IFThen(FMogrify, '-path', '+adjoin'),
- IFThen(FMogrify, OutputDir, '-set filename:name "%t"'),
- IFThen(FMogrify, InputFile, OutputFile)
- ]);
- finally
- FLock.Release;
- end;
+procedure TImageMagickManager.CacheSupportedFormats;
+begin
+ FSupportedFormats.Clear;
+ FSupportedFormats.Delimiter := ',';
+ FSupportedFormats.StrictDelimiter := True;
+ FSupportedFormats.DelimitedText := 'bmp,gif,jpeg,jpg,png,tiff,webp,avif,heic,heif,jxl,ico,psd,svg,tga,jp2,raw,xcf,pcx,pgm,pbm,ppm,xpm,fax,g3,gif87';
+end;
+
+procedure TImageMagickManager.CacheCompressionTypes;
+begin
+ FCompressionTypes.Clear;
+ FCompressionTypes.Add('None=0');
+ FCompressionTypes.Add('LZW=1');
+ FCompressionTypes.Add('Zip=2');
+ FCompressionTypes.Add('JPEG=3');
end;
initialization
diff --git a/baseunits/uBaseUnit.pas b/baseunits/uBaseUnit.pas
index 06378cb31..10071a4e2 100644
--- a/baseunits/uBaseUnit.pas
+++ b/baseunits/uBaseUnit.pas
@@ -591,7 +591,7 @@ function WebPToJPEGStream(const AStream: TMemoryStream; const AQuality: Integer
function PNGToJPEGStream(const AStream: TMemoryStream; const AQuality: Integer = 80): Boolean;
// try to save tmemorystream to file, return the saved filename if success, otherwise return empty string
-function SaveImageStreamToFile(Stream: TMemoryStream; Path, FileName: String; Age: LongInt = 0): String; overload;
+function SaveImageStreamToFile(Stream: TMemoryStream; Path, FileName: String; Age: LongInt = 0; const ContentType: String = ''): String; overload;
function SaveImageStreamToFile(AHTTP: THTTPSend; Path, FileName: String): String; overload;
// check file exist with known extensions. AFilename is a filename without extensions
@@ -2390,10 +2390,36 @@ function PNGToJPEGStream(const AStream: TMemoryStream; const AQuality: Integer):
end;
end;
-function SaveImageStreamToFile(Stream: TMemoryStream; Path, FileName: String; Age: LongInt): String;
+function ExtFromContentType(const ContentType: String): String;
var
- FilePath, PathDirectory, FileExt: String;
+ ct: String;
+begin
+ Result := '';
+ ct := LowerCase(Trim(ContentType));
+ if ct = '' then Exit;
+ if Pos('image/avif', ct) > 0 then Exit('avif');
+ if Pos('image/jxl', ct) > 0 then Exit('jxl');
+ if Pos('image/heic', ct) > 0 then Exit('heic');
+ if Pos('image/heif', ct) > 0 then Exit('heif');
+ if Pos('image/webp', ct) > 0 then Exit('webp');
+ if Pos('image/png', ct) > 0 then Exit('png');
+ if Pos('image/jpeg', ct) > 0 then Exit('jpg');
+ if Pos('image/gif', ct) > 0 then Exit('gif');
+ if Pos('image/bmp', ct) > 0 then Exit('bmp');
+ if Pos('image/tiff', ct) > 0 then Exit('tif');
+ if Pos('image/svg', ct) > 0 then Exit('svg');
+ if Pos('image/x-tga', ct) > 0 then Exit('tga');
+ if Pos('image/x-icon', ct) > 0 then Exit('ico');
+ if Pos('image/', ct) = 1 then
+ Result := Copy(ct, 7, Length(ct) - 6);
+end;
+
+function SaveImageStreamToFile(Stream: TMemoryStream; Path, FileName: String; Age: LongInt; const ContentType: String = ''): String;
+var
+ FilePath, PathDirectory, FileExt, ConvertedExt: String;
FileStream: TFileStream;
+ ConvertedStream: TMemoryStream;
+ imgMagick: TImageMagickManager;
begin
Result := '';
@@ -2412,7 +2438,20 @@ function SaveImageStreamToFile(Stream: TMemoryStream; Path, FileName: String; Ag
begin
FileExt := GetImageStreamExt(Stream);
- if not TImageMagickManager.Instance.Enabled then
+ if FileExt = '' then
+ begin
+ FileExt := ExtFromContentType(ContentType);
+ end;
+
+ ConvertedExt := '';
+ if TImageMagickManager.Instance.Enabled then
+ begin
+ ConvertedExt := LowerCase(TImageMagickManager.Instance.SaveAs);
+ if (FileExt <> '') and (LowerCase(FileExt) = ConvertedExt) then
+ ConvertedExt := '';
+ end;
+
+ if ConvertedExt = '' then
begin
if FileExt = 'png' then
begin
@@ -2437,6 +2476,22 @@ function SaveImageStreamToFile(Stream: TMemoryStream; Path, FileName: String; Ag
end;
end;
end;
+ end
+ else
+ begin
+ imgMagick := TImageMagickManager.Instance;
+ if imgMagick.PathFound then
+ begin
+ ConvertedStream := imgMagick.ConvertStream(Stream, ConvertedExt, False, FileExt);
+ if Assigned(ConvertedStream) then
+ begin
+ Stream.Clear;
+ Stream.CopyFrom(ConvertedStream, ConvertedStream.Size);
+ Stream.Position := 0;
+ FileExt := ConvertedExt;
+ ConvertedStream.Free;
+ end;
+ end;
end;
if FileExt = '' then
@@ -2483,7 +2538,7 @@ function SaveImageStreamToFile(Stream: TMemoryStream; Path, FileName: String; Ag
function SaveImageStreamToFile(AHTTP: THTTPSend; Path, FileName: String): String;
var
- s: String;
+ s, contentType: String;
lastmodified: LongInt;
begin
Result := '';
@@ -2492,7 +2547,8 @@ function SaveImageStreamToFile(AHTTP: THTTPSend; Path, FileName: String): String
lastmodified := 0;
if s <> '' then
lastmodified := DateTimeToFileDate(DecodeRfcDateTime(s));
- Result := SaveImageStreamToFile(AHTTP.Document, Path, FileName, lastmodified);
+ contentType := Trim(AHTTP.Headers.Values['content-type']);
+ Result := SaveImageStreamToFile(AHTTP.Document, Path, FileName, lastmodified, contentType);
end;
function ImageFileExists(const AFileName: String): Boolean;
@@ -2528,6 +2584,24 @@ function FindImageFile(const AFileName: String; AFileExt: String = ''): String;
end;
end;
+ if TImageMagickManager.Instance.Enabled then
+ begin
+ s := AFileName + '.jxl'; if FileExists(s) then Exit(s);
+ s := AFileName + '.avif'; if FileExists(s) then Exit(s);
+ s := AFileName + '.webp'; if FileExists(s) then Exit(s);
+ s := AFileName + '.tiff'; if FileExists(s) then Exit(s);
+ s := AFileName + '.tif'; if FileExists(s) then Exit(s);
+ end;
+
+ if TImageMagickManager.Instance.Enabled then
+ begin
+ s := AFileName + '.' + TImageMagickManager.Instance.SaveAs;
+ if FileExists(s) then
+ begin
+ Exit(s);
+ end;
+ end;
+
Result := '';
end;
@@ -2639,14 +2713,27 @@ function Merge2Image(const Directory, ImgName1, ImgName2, FinalName: String; con
end;
function GetMimeType(const imgFileName: String): String;
+var
+ ext: String;
begin
- case ExtractFileExt(imgFileName) of
+ ext := LowerCase(ExtractFileExt(imgFileName));
+ case ext of
'.jpeg', '.jpg': Result := 'image/jpeg';
'.png': Result := 'image/png';
'.gif': Result := 'image/gif';
'.bmp': Result := 'image/bmp';
'.webp': Result := 'image/webp';
- else Result := '';
+ '.tif', '.tiff': Result := 'image/tiff';
+ '.avif': Result := 'image/avif';
+ '.jxl': Result := 'image/jxl';
+ '.heic', '.heif': Result := 'image/heic';
+ '.j2k', '.jp2': Result := 'image/jp2';
+ '.svg': Result := 'image/svg+xml';
+ '.ico': Result := 'image/x-icon';
+ '.tga': Result := 'image/x-tga';
+ '.pcx': Result := 'image/x-pcx';
+ '.psd': Result := 'image/vnd.adobe.photoshop';
+ else Result := 'image/' + Copy(ext, 2, Length(ext) - 1);
end;
end;
diff --git a/baseunits/uDownloadsManager.pas b/baseunits/uDownloadsManager.pas
index 11fb43229..50382ada3 100644
--- a/baseunits/uDownloadsManager.pas
+++ b/baseunits/uDownloadsManager.pas
@@ -1306,21 +1306,11 @@ procedure TTaskThread.Execute;
if CheckForFinish then
begin
Container.DownloadInfo.Progress := '';
- Container.Status := STATUS_CONVERT;
- if not Convert then
+ Container.Status := STATUS_COMPRESS;
+ if not Compress then
begin
Container.Status := STATUS_FAILED;
end;
-
- if Container.Status <> STATUS_FAILED then
- begin
- Container.DownloadInfo.Progress := '';
- Container.Status := STATUS_COMPRESS;
- if not Compress then
- begin
- Container.Status := STATUS_FAILED;
- end;
- end;
end
else
begin
diff --git a/baseunits/uGetMangaInfosThread.pas b/baseunits/uGetMangaInfosThread.pas
index 4dfccaa83..558b207ff 100644
--- a/baseunits/uGetMangaInfosThread.pas
+++ b/baseunits/uGetMangaInfosThread.pas
@@ -16,8 +16,9 @@
interface
uses
- SysUtils, Graphics, Dialogs, uBaseUnit, uData, FMDOptions, BaseThread,
- ImgInfos, webp, MultiLog, MemBitmap, VirtualTrees;
+ SysUtils, Graphics, Dialogs, Classes, Windows, uBaseUnit, uData, FMDOptions, BaseThread,
+ ImgInfos, webp, MultiLog, MemBitmap, VirtualTrees, BGRAAnimatedGif,
+ BGRABitmap, BGRABitmapTypes, ImageMagickManager;
type
@@ -167,26 +168,91 @@ procedure TGetMangaInfosThread.MainThreadShowCannotGetInfo;
procedure TGetMangaInfosThread.LoadCover;
var
- bmp:TMemBitmap;
+ bmp: TMemBitmap;
+ ext: String;
+ animGif: TBGRAAnimatedGif;
+ tempFile: String;
+ imgMagick: TImageMagickManager;
+ Output: TMemoryStream;
+ identifyResult: String;
+ fmtPos, commaPos: Integer;
begin
- FIsHasMangaCover:=false;
+ FIsHasMangaCover := False;
with FInfo.HTTP do
- if GetImageStreamExt(Document)='webp' then
begin
- bmp:=nil;
- bmp:=WebPToMemBitmap(Document);
- if Assigned(bmp) then
- try
- FCover.Bitmap:=bmp.Bitmap;
- finally
- FreeAndNil(bmp);
- end
+ ext := GetImageStreamExt(Document);
+
+ if (ext = '') and TImageMagickManager.Instance.PathFound then
+ begin
+ Document.Position := 0;
+ imgMagick := TImageMagickManager.Instance;
+ identifyResult := imgMagick.Identify(Document);
+ if identifyResult <> '' then
+ begin
+ fmtPos := Pos('Format: ', identifyResult);
+ if fmtPos > 0 then
+ begin
+ ext := Copy(identifyResult, fmtPos + Length('Format: '), Length(identifyResult));
+ commaPos := Pos(',', ext);
+ if commaPos > 0 then
+ ext := Copy(ext, 1, commaPos - 1);
+ ext := LowerCase(Trim(ext));
+ end;
+ end;
+ end;
+
+ if (ext = 'gif') or (ext = 'png') then
+ begin
+ Document.Position := 0;
+ animGif := TBGRAAnimatedGif.Create;
+ try
+ animGif.LoadFromStream(Document);
+ FCover.Graphic := animGif;
+ FIsHasMangaCover := True;
+ except
+ animGif.Free;
+ Document.Position := 0;
+ FCover.LoadFromStream(Document);
+ FIsHasMangaCover := True;
+ end;
+ end
+ else if (ext = 'tif') or (ext = 'tiff') or (ext = 'webp') or (ext = 'avif') or (ext = 'jxl') then
+ begin
+ Document.Position := 0;
+ imgMagick := TImageMagickManager.Instance;
+ if imgMagick.PathFound then
+ begin
+ Output := imgMagick.ConvertStream(Document, 'gif', True, ext);
+ if Assigned(Output) and (Output.Size > 0) then
+ begin
+ Output.Position := 0;
+ animGif := TBGRAAnimatedGif.Create;
+ try
+ animGif.LoadFromStream(Output);
+ FCover.Graphic := animGif;
+ FIsHasMangaCover := True;
+ except
+ on E: Exception do
+ begin
+ animGif.Free;
+ raise;
+ end;
+ end;
+ end;
+ Output.Free;
+ end;
+ end
else
- Exit;
- end
- else
- FCover.LoadFromStream(FInfo.HTTP.Document);
- FIsHasMangaCover:=True;
+ begin
+ try
+ Document.Position := 0;
+ FCover.LoadFromStream(Document);
+ FIsHasMangaCover := True;
+ except
+
+ end;
+ end;
+ end;
end;
procedure TGetMangaInfosThread.MainThreadShowInfos;
diff --git a/baseunits/uPacker.pas b/baseunits/uPacker.pas
index f8721d9f3..ccba6c5a6 100644
--- a/baseunits/uPacker.pas
+++ b/baseunits/uPacker.pas
@@ -12,7 +12,7 @@ interface
uses
Classes, Zipper, zstream, SysUtils, uBaseUnit, Img2Pdf, FileUtil,
- LazFileUtils, SimpleException, uEpub, FMDOptions, process, MultiLog;
+ LazFileUtils, SimpleException, uEpub, FMDOptions, process, MultiLog, ImageMagickManager;
type
TPackerFormat = (pfZIP, pfCBZ, pfPDF, pfEPUB);
@@ -291,7 +291,14 @@ function TPacker.Execute: Boolean;
with TFileSearcher.Create do
try
OnFileFound := FileFound;
- Search(Self.Path, '*.jpg;*.png;*.gif;*.webp', False, False);
+ if TImageMagickManager.Instance.Enabled then
+ begin
+ Search(Self.Path, '*.jpg;*.png;*.gif;*.webp;*.bmp;*.tif;*.' + TImageMagickManager.Instance.SaveAs, False, False);
+ end
+ else
+ begin
+ Search(Self.Path, '*.jpg;*.png;*.gif;*.webp', False, False);
+ end;
finally
Free;
end;
diff --git a/baseunits/webp.pas b/baseunits/webp.pas
index 3032c0c53..a03c27777 100644
--- a/baseunits/webp.pas
+++ b/baseunits/webp.pas
@@ -5,150 +5,86 @@
interface
uses
- Classes, SysUtils, MemBitmap, Dynlibs;
-
-var
- WebPLibHandle: TLibHandle = 0;
- DLLWebPName: String = {$IFDEF LINUX} 'libwebp.so' {$ELSE} 'libwebp.dll' {$ENDIF};
+ Classes, SysUtils, MemBitmap, ImageMagickManager;
function IsWebPModuleLoaded: Boolean;
procedure InitWebPModule;
procedure DestroyWebPModule;
function WebPToMemBitmap(webp: TMemoryStream): TMemBitmap;
function WebPGetVersion: String;
+function IsAnimatedWebP(webp: TMemoryStream): Boolean;
implementation
-uses
- SyncObjs;
-
-type
- TWebPGetInfo = function (data: Pointer; data_size: UInt32; width, height: pInt32): Int32; cdecl;
- TWebPDecodeBGRAInto = function (data: Pointer; data_size: UInt32; output: Pointer; output_size: UInt32; stride: Int32): pInt32; cdecl;
- TWebPGetDecoderVersion = function (): Int32; cdecl;
-
-var
- pWebPGetInfo: TWebPGetInfo = nil;
- pWebPDecodeBGRAInto: TWebPDecodeBGRAInto = nil;
- pWebPGetDecoderVersion: TWebPGetDecoderVersion = nil;
- webpCS: TCriticalSection;
- webpLibLoaded: Boolean = False;
-
-resourcestring
- SErrLoadFailed = 'Can not load WebP codec library "%s". Check your installation.';
-
function IsWebPModuleLoaded: Boolean;
begin
- Result := webpLibLoaded;
+ Result := TImageMagickManager.Instance.PathFound;
end;
procedure InitWebPModule;
begin
- if IsWebPModuleLoaded then Exit;
- webpCS.Enter;
- try
- if not IsWebPModuleLoaded then begin
- WebPLibHandle := LoadLibrary(PChar(DLLWebPName));
- if WebPLibHandle <> 0 then begin
- pWebPGetInfo := TWebPGetInfo(GetProcAddress(WebPLibHandle, 'WebPGetInfo'));
- pWebPDecodeBGRAInto := TWebPDecodeBGRAInto(GetProcAddress(WebPLibHandle, 'WebPDecodeBGRAInto'));
- pWebPGetDecoderVersion := TWebPGetDecoderVersion(GetProcAddress(WebPLibHandle, 'WebPGetDecoderVersion'));
- webpLibLoaded := True;
- end else
- raise EInOutError.CreateFmt(SErrLoadFailed, [DLLWebPName]);
- end;
- finally
- webpCS.Leave;
- end;
+ TImageMagickManager.Initialize;
end;
procedure DestroyWebPModule;
begin
- webpCS.Enter;
+ TImageMagickManager.Finalize;
+end;
+
+function WebPToMemBitmap(webp: TMemoryStream): TMemBitmap;
+var
+ Output: TMemoryStream;
+ imgMagick: TImageMagickManager;
+begin
+ Result := nil;
+ if (webp = nil) or (webp.Size = 0) then Exit;
+
+ imgMagick := TImageMagickManager.Instance;
+ if not imgMagick.PathFound then Exit;
+
+ Output := imgMagick.ConvertStream(webp, 'bmp', False, 'webp');
+ if Assigned(Output) and (Output.Size > 0) then
try
- if IsWebPModuleLoaded then begin
- if WebPLibHandle <> 0 then begin
- pWebPGetInfo := nil;
- pWebPDecodeBGRAInto := nil;
- pWebPGetDecoderVersion := nil;
- FreeLibrary(WebPLibHandle);
- WebPLibHandle := 0;
- end;
- webpLibLoaded := False;
+ Output.Position := 0;
+ Result := TMemBitmap.Create(1, 1);
+ try
+ Result.LoadFromStream(Output);
+ except
+ FreeAndNil(Result);
end;
finally
- webpCS.Leave;
+ Output.Free;
end;
end;
-function WebPGetInfo(data: Pointer; data_size: UInt32; width, height: pInt32): Int32;
-begin
- if IsWebPModuleLoaded and Assigned(pWebPGetInfo) then
- Result := pWebPGetInfo(data, data_size, width, height)
- else
- Result := 0;
-end;
-
-function WebPDecodeBGRAInto(data: Pointer; data_size: UInt32; output: Pointer; output_size: UInt32; stride: Int32): pInt32;
-begin
- if IsWebPModuleLoaded and Assigned(pWebPDecodeBGRAInto) then
- Result := pWebPDecodeBGRAInto(data, data_size, output, output_size, stride)
- else
- Result := nil;
-end;
-
-function WebPGetDecoderVersion: Int32;
-begin
- if IsWebPModuleLoaded and Assigned(pWebPGetDecoderVersion) then
- Result := pWebPGetDecoderVersion()
- else
- Result := 0;
-end;
-
function WebPGetVersion: String;
-var
- ver: Int32;
begin
- Result := '';
- ver := WebPGetDecoderVersion;
- if ver > 0 then begin
- Result += chr(((ver shr 16) and $ff) + $30) + '.';
- Result += chr(((ver shr 8) and $ff) + $30) + '.';
- Result += chr(( ver and $ff) + $30);
- end;
+ Result := 'ImageMagick';
end;
-function WebPToMemBitmap(webp: TMemoryStream): TMemBitmap;
+function IsAnimatedWebP(webp: TMemoryStream): Boolean;
var
- e, width, height, stride: Integer;
- scan: pInt32;
- r: TMemBitmap;
+ IdentifyResult: String;
+ imgMagick: TImageMagickManager;
+ FramesPos: Integer;
begin
- Result := nil;
- if webp = nil then Exit;
-
- e := WebPGetInfo(webp.Memory, webp.Size, @width, @height);
- if e = 0 then Exit;
-
- r := TMemBitmap.Create(width, height);
- stride := (r.ScanLine[1] - r.ScanLine[0]) * SizeOf(TMemPixel);
- scan := WebPDecodeBGRAInto(webp.Memory, webp.Size,
- r.ScanLine[0], stride * height, stride);
-
- if scan <> PLongint(r.ScanLine[0]) then begin
- r.Free;
- Exit;
+ Result := False;
+ if (webp = nil) or (webp.Size < 21) then Exit;
+
+ imgMagick := TImageMagickManager.Instance;
+ if not imgMagick.PathFound then Exit;
+
+ IdentifyResult := imgMagick.Identify(webp, 'webp');
+ if IdentifyResult <> '' then
+ begin
+ FramesPos := Pos('Frames: ', IdentifyResult);
+ if FramesPos > 0 then
+ begin
+ Result := StrToIntDef(Copy(IdentifyResult, FramesPos + Length('Frames: '), Length(IdentifyResult)), 1) > 1;
+ end;
end;
-
- Result := r;
end;
initialization
- webpCS := TCriticalSection.Create;
-
finalization
- DestroyWebPModule;
- webpCS.Free;
-
end.
-
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_MagickCore_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_MagickCore_.dll
new file mode 100644
index 000000000..40a553935
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_MagickCore_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_MagickWand_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_MagickWand_.dll
new file mode 100644
index 000000000..a425ff38b
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_MagickWand_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_bzip2_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_bzip2_.dll
new file mode 100644
index 000000000..7ac44f00c
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_bzip2_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_freetype_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_freetype_.dll
new file mode 100644
index 000000000..9616231cd
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_freetype_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_fribidi_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_fribidi_.dll
new file mode 100644
index 000000000..5f2fcfc0a
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_fribidi_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_glib_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_glib_.dll
new file mode 100644
index 000000000..0f1584c4f
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_glib_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_harfbuzz_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_harfbuzz_.dll
new file mode 100644
index 000000000..8d99c7f23
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_harfbuzz_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_heif_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_heif_.dll
new file mode 100644
index 000000000..b71595d88
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_heif_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_jpeg-turbo_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_jpeg-turbo_.dll
new file mode 100644
index 000000000..9f812a706
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_jpeg-turbo_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_jpeg-xl_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_jpeg-xl_.dll
new file mode 100644
index 000000000..51f75674f
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_jpeg-xl_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_lcms_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_lcms_.dll
new file mode 100644
index 000000000..a48f5c4aa
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_lcms_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_lqr_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_lqr_.dll
new file mode 100644
index 000000000..67b7a2870
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_lqr_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_png_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_png_.dll
new file mode 100644
index 000000000..d9544ffe9
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_png_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_raqm_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_raqm_.dll
new file mode 100644
index 000000000..293b3187e
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_raqm_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_tiff_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_tiff_.dll
new file mode 100644
index 000000000..10b9bd573
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_tiff_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_webp_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_webp_.dll
new file mode 100644
index 000000000..3abed6e20
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_webp_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_xml_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_xml_.dll
new file mode 100644
index 000000000..d7f5a2d01
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_xml_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/CORE_RL_zlib_.dll b/dist/i386-win32/ImageMagick_dependency/CORE_RL_zlib_.dll
new file mode 100644
index 000000000..c88dc8269
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/CORE_RL_zlib_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/colors.xml b/dist/i386-win32/ImageMagick_dependency/colors.xml
new file mode 100644
index 000000000..201b73514
--- /dev/null
+++ b/dist/i386-win32/ImageMagick_dependency/colors.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/i386-win32/ImageMagick_dependency/configure.xml b/dist/i386-win32/ImageMagick_dependency/configure.xml
new file mode 100644
index 000000000..8a09203ae
--- /dev/null
+++ b/dist/i386-win32/ImageMagick_dependency/configure.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/i386-win32/ImageMagick_dependency/delegates.xml b/dist/i386-win32/ImageMagick_dependency/delegates.xml
new file mode 100644
index 000000000..24ec4ca7b
--- /dev/null
+++ b/dist/i386-win32/ImageMagick_dependency/delegates.xml
@@ -0,0 +1,101 @@
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/i386-win32/ImageMagick_dependency/english.xml b/dist/i386-win32/ImageMagick_dependency/english.xml
new file mode 100644
index 000000000..2b3245be5
--- /dev/null
+++ b/dist/i386-win32/ImageMagick_dependency/english.xml
@@ -0,0 +1,1728 @@
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+ unable to open image
+
+
+ unable to open file
+
+
+ unable to read blob
+
+
+ unable to write blob
+
+
+ unrecognized image format
+
+
+ zero-length blob not permitted
+
+
+
+
+
+
+ cache resources exhausted
+
+
+ incompatible API
+
+
+ no pixels defined in cache
+
+
+ pixel cache is not open
+
+
+ pixels are not authentic
+
+
+ unable to clone cache
+
+
+ unable to extend cache
+
+
+ unable to get cache nexus
+
+
+ unable to open pixel cache
+
+
+ unable to persist pixel cache
+
+
+ unable to read pixel cache
+
+
+ unable to write pixel cache
+
+
+
+
+ unable to acquire cache view
+
+
+ unable to extend pixel cache
+
+
+
+
+
+
+ colormap type not supported
+
+
+ colorspace model is not supported
+
+
+ compression not supported
+
+
+ data encoding scheme is not supported
+
+
+ data storage type is not supported
+
+
+ delta-PNG is not supported
+
+
+ encrypted WPG image file not supported
+
+
+ fractal compression not supported
+
+
+ image column or row size is not supported
+
+
+ image does not have a clip mask
+
+
+ image does not have an alpha channel
+
+
+ image does not have an mask channel
+
+
+ image does not have a EXIF thumbnail
+
+
+ image is not tiled
+
+
+ irregular channel geometry not supported
+
+
+ JNG compression not supported
+
+
+ JPEG compression not supported
+
+
+ JPEG embedding failed
+
+
+ location type is not supported
+
+
+ map storage type is not supported
+
+
+ multi-dimensional matrices are not supported
+
+
+ multiple record list not supported
+
+
+ no bitmap on clipboard
+
+
+ no APP1 data is available
+
+
+ no 8BIM data is available
+
+
+ no color profile is available
+
+
+ no data returned
+
+
+ no image vector graphics; unable to generate SVG
+
+
+ no IPTC profile available
+
+
+ number of images is not supported
+
+
+ only continuous tone picture supported
+
+
+ only level zero files Supported
+
+
+ PNG compression not supported
+
+
+ RLE compression not supported
+
+
+ unable to copy profile
+
+
+ unable to create bitmap
+
+
+ unable to create a DC
+
+
+ unable to decompress image
+
+
+ unable to write MPEG parameters
+
+
+ unable to zip-compress image
+
+
+ ZIP compression not supported
+
+
+
+
+ exif profile size exceeds limit and will be truncated
+
+
+ lossless to lossy JPEG conversion
+
+
+
+
+
+
+ include element nested too deeply
+
+
+ security policy failed to validate
+
+
+
+
+ unable to access configure file
+
+
+ unable to open module file
+
+
+
+
+
+
+
+ an error has occurred reading from file
+
+
+ an error has occurred writing to file
+
+
+ cipher support not enabled
+
+
+ colormap exceeded 256 colors
+
+
+ corrupt image
+
+
+ file format version mismatch
+
+
+ image depth not supported
+
+
+ image file does not contain any image data
+
+
+ image type not supported
+
+
+ improper image header
+
+
+ insufficient image data in file
+
+
+ invalid colormap index
+
+
+ invalid pixel
+
+
+ length and filesize do not match
+
+
+ maximum channels exceeded
+
+
+ missing image channel
+
+
+ negative or zero image size
+
+
+ non OS2 BMP header size less than 40
+
+
+ not enough pixel data
+
+
+ not enough tiles found in level
+
+
+ too much image data in file
+
+
+ static planes value not equal to 1
+
+
+ unable to read extension block
+
+
+ unable to read image header
+
+
+ unable to read image data
+
+
+ unable to runlength decode image
+
+
+ unable to uncompress image
+
+
+ unexpected end-of-file
+
+
+ unexpected sampling factor
+
+
+ unknown pattern type
+
+
+ unrecognized alpha channel option
+
+
+ unrecognized compression
+
+
+ unrecognized number of colors
+
+
+ unsupported bits per pixel
+
+
+
+
+ unable to persist key
+
+
+
+
+ insufficient image data in file
+
+
+ length and filesize do not match
+
+
+ corrupt PCD image, skipping to sync byte
+
+
+
+
+
+
+
+ delegate failed
+
+
+ failed to compute output size
+
+
+ failed to render file
+
+
+ failed to scan file
+
+
+ no tag found
+
+
+ PCL delegate failed
+
+
+ Postscript delegate failed
+
+
+ unable to create image
+
+
+ unable to decode image file
+
+
+ unable to encode image file
+
+
+ unable to initialize FPX library
+
+
+ unable to initialize WMF library
+
+
+ unable to manage JP2 stream
+
+
+ unable to read aspect ratio
+
+
+ unable to read summary info
+
+
+ unable to set affine matrix
+
+
+ unable to set aspect ratio
+
+
+ unable to set color twist
+
+
+ unable to set contrast
+
+
+ unable to set filtering value
+
+
+ unable to set image title
+
+
+ unable to set JPEG level
+
+
+ unable to set region of interest
+
+
+ unable to set summary info
+
+
+ unable to write SVG format
+
+
+ XPS delegate failed
+
+
+
+
+
+
+ already pushing pattern definition
+
+
+ non-conforming drawing primitive definition
+
+
+ not a relative URL
+
+
+ not currently pushing pattern definition
+
+
+ segment stack overflow
+
+
+ too many bezier coordinates
+
+
+ unable to print
+
+
+ unbalanced graphic context push-pop
+
+
+ URL not found
+
+
+ vector graphics nested too deeply
+
+
+
+
+
+
+
+ an error has occurred reading from file
+
+
+ unable to create temporary file
+
+
+ unable to open file
+
+
+ unable to write file
+
+
+
+
+
+
+
+ angle is discontinuous
+
+
+ colormapped image required
+
+
+ color separated image required
+
+
+ color profile operates on another colorspace
+
+
+ image depth not supported
+
+
+ image sequence is required
+
+
+ image morphology differs
+
+
+ image list is required
+
+
+ image size differs
+
+
+ left and right image sizes differ
+
+
+ negative or zero image size
+
+
+ no images were found
+
+
+ no images were loaded
+
+
+ too many cluster
+
+
+ unable to create color transform
+
+
+ width or height exceeds limit
+
+
+
+
+ associate profile with image, a source and destination color profile required for transform
+
+
+ images too dissimilar
+
+
+ unable to transform colorspace
+
+
+
+
+
+
+ filter failed
+
+
+
+
+
+
+
+ delegate library support not built-in
+
+
+ no decode delegate for this image format
+
+
+ no encode delegate for this image format
+
+
+
+
+ delegate library support not built-in
+
+
+ FreeType library is not available
+
+
+ LCMS color profile library is not available
+
+
+ no encode delegate for this image format
+
+
+
+
+
+
+
+ image coder signature mismatch
+
+
+ image filter signature mismatch
+
+
+ unable to load module
+
+
+ unable to register image format
+
+
+
+
+ unable to initialize module loader
+
+
+
+
+ unable to close module
+
+
+
+
+
+
+
+ attempt to perform an operation not authorized by the security policy
+
+
+
+
+
+
+ unable to get registry ID
+
+
+ unable to set registry
+
+
+
+
+
+
+
+ list length exceeds limit
+
+
+ memory allocation failed
+
+
+ pixel cache allocation failed
+
+
+ time limit exceeded
+
+
+ too many exceptions
+
+
+ too many objects
+
+
+ unable to acquire string
+
+
+ unable to allocate colormap
+
+
+ unable to convert font
+
+
+ unable to create colormap
+
+
+ unable to dither image
+
+
+ unable to clone package info
+
+
+ unable to get package info
+
+
+
+
+ unable to allocate dash pattern
+
+
+ unable to allocate derivates
+
+
+ unable to allocate gamma map
+
+
+ unable to allocate image
+
+
+ unable to allocate image pixels
+
+
+ unable to destroy semaphore
+
+
+ unable to instantiate semaphore
+
+
+ unable to allocate string
+
+
+ Memory allocation failed
+
+
+ unable to concatenate string
+
+
+ unable to convert text
+
+
+ unable to create colormap
+
+
+ unable to clone image
+
+
+ unable to display image
+
+
+ unable to escape string
+
+
+ unable to interpret MSL image
+
+
+ unable to lock semaphore
+
+
+ unable to unlock semaphore
+
+
+
+
+ memory allocation failed
+
+
+ profile size exceeds limit
+
+
+
+
+
+
+
+ font substitution required
+
+
+ unable to get type metrics
+
+
+ unable to initialize freetype library
+
+
+ unable to read font
+
+
+ unrecognized font encoding
+
+
+
+
+ unable to read font
+
+
+
+
+
+
+ image does not contain the stream geometry
+
+
+ no stream handler is defined
+
+
+ pixel cache is not open
+
+
+
+
+
+
+ invalid colormap index
+
+
+ zero region size
+
+
+ unable to open file
+
+
+ wand quantum depth does not match that of the core API
+
+
+ wand contains no images
+
+
+ wand contains no iterators
+
+
+
+
+
+
+ color is not known to server
+
+
+ no window with specified ID exists
+
+
+ standard Colormap is not initialized
+
+
+ unable to connect to remote display
+
+
+ unable to create bitmap
+
+
+ unable to create colormap
+
+
+ unable to create pixmap
+
+
+ unable to create property
+
+
+ unable to create standard colormap
+
+
+ unable to display image info
+
+
+ unable to get property
+
+
+ unable to get Standard Colormap
+
+
+ unable to get visual
+
+
+ unable to grab mouse
+
+
+ unable to load font
+
+
+ unable to match visual to Standard Colormap
+
+
+ unable to open X server
+
+
+ unable to read X window attributes
+
+
+ unable to read X window image
+
+
+ unrecognized colormap type
+
+
+ unrecognized gravity type
+
+
+ unrecognized visual specifier
+
+
+
+
+ unable to create X cursor
+
+
+ unable to create graphic context
+
+
+ unable to create standard colormap
+
+
+ unable to create text property
+
+
+ unable to create X window
+
+
+ unable to create X image
+
+
+ unable to create X pixmap
+
+
+ unable to display image
+
+
+ unable to get visual
+
+
+ unable to get pixel info
+
+
+ unable to load font
+
+
+ unable to make X window
+
+
+ unable to open X server
+
+
+ unable to view fonts
+
+
+
+
+ using default visual
+
+
+ unable to get visual
+
+
+
+
+
+
+
+ add noise to image
+
+
+
+
+ append image sequence
+
+
+
+
+ assign image colors
+
+
+
+
+ average image sequence
+
+
+
+
+ blur image
+
+
+
+
+ chop image
+
+
+
+
+ classify image colors
+
+
+
+
+ replace color in image
+
+
+
+
+ colorize image
+
+
+
+
+ combine image
+
+
+
+
+ contrast-stretch image
+
+
+
+
+ convolve image
+
+
+
+
+ crop image
+
+
+
+
+ decode image
+
+
+
+
+ despeckle image
+
+
+
+
+ distort image
+
+
+
+
+ dither image colors
+
+
+
+
+ dull image contrast
+
+
+
+
+ encode image
+
+
+
+
+ equalize image
+
+
+
+
+ flip image
+
+
+
+
+ flop image
+
+
+
+
+ add frame to image
+
+
+
+
+ fx image
+
+
+
+
+ gamma correct image
+
+
+
+
+ compute image histogram
+
+
+
+
+ implode image
+
+
+
+
+ level image
+
+
+
+
+ load image
+
+
+ load images
+
+
+
+
+ magnify image
+
+
+
+
+ filter image with neighborhood ranking
+
+
+
+
+ minify image
+
+
+
+
+ modulate image
+
+
+
+
+ mogrify image
+
+
+
+
+ montage image
+
+
+
+
+ morph image sequence
+
+
+
+
+ mosaic image
+
+
+
+
+ negate image
+
+
+
+
+ oil paint image
+
+
+
+
+ set opaque color in image
+
+
+
+
+ plasma image
+
+
+
+
+ preview image
+
+
+
+
+ raise image
+
+
+
+
+ recolor color image
+
+
+
+
+ reduce image colors
+
+
+
+
+ reduce the image noise
+
+
+
+
+ render image
+
+
+
+
+ resize image
+
+
+
+
+ RGB transform image
+
+
+
+
+ roll image
+
+
+
+
+ rotate image
+
+
+
+
+ sample image
+
+
+
+
+ save image
+
+
+ save images
+
+
+
+
+ scale image
+
+
+
+
+ segment image
+
+
+
+
+ extract a channel from image
+
+
+
+
+ sepia-tone image
+
+
+
+
+ shade image
+
+
+
+
+ sharpen image
+
+
+
+
+ sharpen image contrast
+
+
+
+
+ sigmoidal contrast image
+
+
+
+
+ solarize image
+
+
+
+
+ splice image
+
+
+
+
+ spread image
+
+
+
+
+ stegano image
+
+
+
+
+ stereo image
+
+
+
+
+ swirl image
+
+
+
+
+ texture image
+
+
+
+
+ threshold image
+
+
+
+
+ tile image
+
+
+
+
+ tint image
+
+
+
+
+ transform RGB image
+
+
+
+
+ set transparent color in image
+
+
+
+
+ wave image
+
+
+
+
+ write image
+
+
+
+
+ x shear image
+
+
+
+
+ y shear image
+
+
+
+
diff --git a/dist/i386-win32/ImageMagick_dependency/libsharpyuv-0.dll b/dist/i386-win32/ImageMagick_dependency/libsharpyuv-0.dll
new file mode 100644
index 000000000..d7c2c4508
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/libsharpyuv-0.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/libwebp.dll b/dist/i386-win32/ImageMagick_dependency/libwebp.dll
new file mode 100644
index 000000000..9737c2f50
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/libwebp.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/locale.xml b/dist/i386-win32/ImageMagick_dependency/locale.xml
new file mode 100644
index 000000000..d593fba35
--- /dev/null
+++ b/dist/i386-win32/ImageMagick_dependency/locale.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/i386-win32/ImageMagick_dependency/log.xml b/dist/i386-win32/ImageMagick_dependency/log.xml
new file mode 100644
index 000000000..20c45da82
--- /dev/null
+++ b/dist/i386-win32/ImageMagick_dependency/log.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
diff --git a/dist/i386-win32/ImageMagick_dependency/mime.xml b/dist/i386-win32/ImageMagick_dependency/mime.xml
new file mode 100644
index 000000000..d85f707f3
--- /dev/null
+++ b/dist/i386-win32/ImageMagick_dependency/mime.xml
@@ -0,0 +1,1157 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_bmp_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_bmp_.dll
new file mode 100644
index 000000000..3ed028bd8
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_bmp_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_exr_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_exr_.dll
new file mode 100644
index 000000000..3208943b5
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_exr_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_gif_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_gif_.dll
new file mode 100644
index 000000000..0c63ca38d
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_gif_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_heic_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_heic_.dll
new file mode 100644
index 000000000..7f1337d02
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_heic_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_icon_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_icon_.dll
new file mode 100644
index 000000000..b63c6fda4
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_icon_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_info_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_info_.dll
new file mode 100644
index 000000000..3c7d839a0
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_info_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_jp2_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_jp2_.dll
new file mode 100644
index 000000000..824568a1b
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_jp2_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_jpeg_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_jpeg_.dll
new file mode 100644
index 000000000..a85e377c0
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_jpeg_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_jxl_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_jxl_.dll
new file mode 100644
index 000000000..aefbf7513
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_jxl_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_null_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_null_.dll
new file mode 100644
index 000000000..fa3abf3fe
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_null_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_png_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_png_.dll
new file mode 100644
index 000000000..ac5b5cffb
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_png_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_psd_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_psd_.dll
new file mode 100644
index 000000000..a87491117
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_psd_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_raw_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_raw_.dll
new file mode 100644
index 000000000..834c44dbe
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_raw_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_svg_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_svg_.dll
new file mode 100644
index 000000000..61b674cc0
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_svg_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_tiff_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_tiff_.dll
new file mode 100644
index 000000000..f6da96533
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_tiff_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_txt_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_txt_.dll
new file mode 100644
index 000000000..af25ca629
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_txt_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_webp_.dll b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_webp_.dll
new file mode 100644
index 000000000..bcb198ead
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/coders/IM_MOD_RL_webp_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/modules/filters/FILTER_RL_analyze_.dll b/dist/i386-win32/ImageMagick_dependency/modules/filters/FILTER_RL_analyze_.dll
new file mode 100644
index 000000000..9895df999
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/modules/filters/FILTER_RL_analyze_.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/msvcp140.dll b/dist/i386-win32/ImageMagick_dependency/msvcp140.dll
new file mode 100644
index 000000000..fbaa279f6
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/msvcp140.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/msvcp140_1.dll b/dist/i386-win32/ImageMagick_dependency/msvcp140_1.dll
new file mode 100644
index 000000000..591bc134b
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/msvcp140_1.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/msvcp140_2.dll b/dist/i386-win32/ImageMagick_dependency/msvcp140_2.dll
new file mode 100644
index 000000000..f27eb2609
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/msvcp140_2.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/msvcp140_atomic_wait.dll b/dist/i386-win32/ImageMagick_dependency/msvcp140_atomic_wait.dll
new file mode 100644
index 000000000..186d3785d
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/msvcp140_atomic_wait.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/msvcp140_codecvt_ids.dll b/dist/i386-win32/ImageMagick_dependency/msvcp140_codecvt_ids.dll
new file mode 100644
index 000000000..8919a5a84
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/msvcp140_codecvt_ids.dll differ
diff --git a/dist/i386-win32/ImageMagick_dependency/policy.xml b/dist/i386-win32/ImageMagick_dependency/policy.xml
new file mode 100644
index 000000000..d9bd7f487
--- /dev/null
+++ b/dist/i386-win32/ImageMagick_dependency/policy.xml
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/i386-win32/ImageMagick_dependency/sRGB.icc b/dist/i386-win32/ImageMagick_dependency/sRGB.icc
new file mode 100644
index 000000000..cfbd03e1f
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/sRGB.icc differ
diff --git a/dist/i386-win32/ImageMagick_dependency/thresholds.xml b/dist/i386-win32/ImageMagick_dependency/thresholds.xml
new file mode 100644
index 000000000..75831f60e
--- /dev/null
+++ b/dist/i386-win32/ImageMagick_dependency/thresholds.xml
@@ -0,0 +1,336 @@
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+ Threshold 1x1 (non-dither)
+
+ 1
+
+
+
+
+ Checkerboard 2x1 (dither)
+
+ 1 2
+ 2 1
+
+
+
+
+
+ Ordered 2x2 (dispersed)
+
+ 1 3
+ 4 2
+
+
+
+
+ Ordered 3x3 (dispersed)
+
+ 3 7 4
+ 6 1 9
+ 2 8 5
+
+
+
+
+
+ Ordered 4x4 (dispersed)
+
+ 1 9 3 11
+ 13 5 15 7
+ 4 12 2 10
+ 16 8 14 6
+
+
+
+
+
+ Ordered 8x8 (dispersed)
+
+ 1 49 13 61 4 52 16 64
+ 33 17 45 29 36 20 48 32
+ 9 57 5 53 12 60 8 56
+ 41 25 37 21 44 28 40 24
+ 3 51 15 63 2 50 14 62
+ 35 19 47 31 34 18 46 30
+ 11 59 7 55 10 58 6 54
+ 43 27 39 23 42 26 38 22
+
+
+
+
+
+ Halftone 4x4 (angled)
+
+ 4 2 7 5
+ 3 1 8 6
+ 7 5 4 2
+ 8 6 3 1
+
+
+
+
+ Halftone 6x6 (angled)
+
+ 14 13 10 8 2 3
+ 16 18 12 7 1 4
+ 15 17 11 9 6 5
+ 8 2 3 14 13 10
+ 7 1 4 16 18 12
+ 9 6 5 15 17 11
+
+
+
+
+ Halftone 8x8 (angled)
+
+ 13 7 8 14 17 21 22 18
+ 6 1 3 9 28 31 29 23
+ 5 2 4 10 27 32 30 24
+ 16 12 11 15 20 26 25 19
+ 17 21 22 18 13 7 8 14
+ 28 31 29 23 6 1 3 9
+ 27 32 30 24 5 2 4 10
+ 20 26 25 19 16 12 11 15
+
+
+
+
+
+ Halftone 4x4 (orthogonal)
+
+ 7 13 11 4
+ 12 16 14 8
+ 10 15 6 2
+ 5 9 3 1
+
+
+
+
+ Halftone 6x6 (orthogonal)
+
+ 7 17 27 14 9 4
+ 21 29 33 31 18 11
+ 24 32 36 34 25 22
+ 19 30 35 28 20 10
+ 8 15 26 16 6 2
+ 5 13 23 12 3 1
+
+
+
+
+ Halftone 8x8 (orthogonal)
+
+ 7 21 33 43 36 19 9 4
+ 16 27 51 55 49 29 14 11
+ 31 47 57 61 59 45 35 23
+ 41 53 60 64 62 52 40 38
+ 37 44 58 63 56 46 30 22
+ 15 28 48 54 50 26 17 10
+ 8 18 34 42 32 20 6 2
+ 5 13 25 39 24 12 3 1
+
+
+
+
+
+ Halftone 16x16 (orthogonal)
+
+ 4 12 24 44 72 100 136 152 150 134 98 70 42 23 11 3
+ 7 16 32 52 76 104 144 160 158 142 102 74 50 31 15 6
+ 19 27 40 60 92 132 168 180 178 166 130 90 58 39 26 18
+ 36 48 56 80 124 176 188 204 203 187 175 122 79 55 47 35
+ 64 68 84 116 164 200 212 224 223 211 199 162 114 83 67 63
+ 88 96 112 156 192 216 232 240 239 231 214 190 154 111 95 87
+ 108 120 148 184 208 228 244 252 251 243 226 206 182 147 119 107
+ 128 140 172 196 219 235 247 256 255 246 234 218 194 171 139 127
+ 126 138 170 195 220 236 248 253 254 245 233 217 193 169 137 125
+ 106 118 146 183 207 227 242 249 250 241 225 205 181 145 117 105
+ 86 94 110 155 191 215 229 238 237 230 213 189 153 109 93 85
+ 62 66 82 115 163 198 210 221 222 209 197 161 113 81 65 61
+ 34 46 54 78 123 174 186 202 201 185 173 121 77 53 45 33
+ 20 28 37 59 91 131 167 179 177 165 129 89 57 38 25 17
+ 8 13 29 51 75 103 143 159 157 141 101 73 49 30 14 5
+ 1 9 21 43 71 99 135 151 149 133 97 69 41 22 10 2
+
+
+
+
+
+
+ Circles 5x5 (black)
+
+ 1 21 16 15 4
+ 5 17 20 19 14
+ 6 21 25 24 12
+ 7 18 22 23 11
+ 2 8 9 10 3
+
+
+
+
+
+ Circles 5x5 (white)
+
+ 25 21 10 11 22
+ 20 9 6 7 12
+ 19 5 1 2 13
+ 18 8 4 3 14
+ 24 17 16 15 23
+
+
+
+
+ Circles 6x6 (black)
+
+ 1 5 14 13 12 4
+ 6 22 28 27 21 11
+ 15 29 35 34 26 20
+ 16 30 36 33 25 19
+ 7 23 31 32 24 10
+ 2 8 17 18 9 3
+
+
+
+
+ Circles 6x6 (white)
+
+ 36 32 23 24 25 33
+ 31 15 9 10 16 26
+ 22 8 2 3 11 17
+ 21 7 1 4 12 18
+ 30 14 6 5 13 27
+ 35 29 20 19 28 34
+
+
+
+
+ Circles 7x7 (black)
+
+ 3 9 18 28 17 8 2
+ 10 24 33 39 32 23 7
+ 19 34 44 48 43 31 16
+ 25 40 45 49 47 38 27
+ 20 35 41 46 42 29 15
+ 11 21 36 37 28 22 6
+ 4 12 13 26 14 5 1
+
+
+
+
+
+ Circles 7x7 (white)
+
+ 47 41 32 22 33 42 48
+ 40 26 17 11 18 27 43
+ 31 16 6 2 7 19 34
+ 25 10 5 1 3 12 23
+ 30 15 9 4 8 20 35
+ 39 29 14 13 21 28 44
+ 46 38 37 24 36 45 49
+
+
+
+
+
+
+
diff --git a/dist/i386-win32/ImageMagick_dependency/type-ghostscript.xml b/dist/i386-win32/ImageMagick_dependency/type-ghostscript.xml
new file mode 100644
index 000000000..6e08ef755
--- /dev/null
+++ b/dist/i386-win32/ImageMagick_dependency/type-ghostscript.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/i386-win32/ImageMagick_dependency/type.xml b/dist/i386-win32/ImageMagick_dependency/type.xml
new file mode 100644
index 000000000..fa80ca6ca
--- /dev/null
+++ b/dist/i386-win32/ImageMagick_dependency/type.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
diff --git a/dist/i386-win32/ImageMagick_dependency/vcruntime140.dll b/dist/i386-win32/ImageMagick_dependency/vcruntime140.dll
new file mode 100644
index 000000000..5050e200b
Binary files /dev/null and b/dist/i386-win32/ImageMagick_dependency/vcruntime140.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_MagickCore_.dll b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_MagickCore_.dll
new file mode 100644
index 000000000..d1ce55b72
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_MagickCore_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_MagickWand_.dll b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_MagickWand_.dll
new file mode 100644
index 000000000..1a13612c0
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_MagickWand_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_heif_.dll b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_heif_.dll
new file mode 100644
index 000000000..61840711c
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_heif_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_jpeg-turbo_.dll b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_jpeg-turbo_.dll
new file mode 100644
index 000000000..560adba3b
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_jpeg-turbo_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_jpeg-xl_.dll b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_jpeg-xl_.dll
new file mode 100644
index 000000000..b27dc4b1d
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_jpeg-xl_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_png_.dll b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_png_.dll
new file mode 100644
index 000000000..bc75c17cd
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_png_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_tiff_.dll b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_tiff_.dll
new file mode 100644
index 000000000..dbf874278
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_tiff_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_webp_.dll b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_webp_.dll
new file mode 100644
index 000000000..5ade9dfbc
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_webp_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_zlib_.dll b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_zlib_.dll
new file mode 100644
index 000000000..73008ccb5
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/CORE_RL_zlib_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/colors.xml b/dist/x86_64-win64/ImageMagick_dependency/colors.xml
new file mode 100644
index 000000000..201b73514
--- /dev/null
+++ b/dist/x86_64-win64/ImageMagick_dependency/colors.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/x86_64-win64/ImageMagick_dependency/configure.xml b/dist/x86_64-win64/ImageMagick_dependency/configure.xml
new file mode 100644
index 000000000..3f065d940
--- /dev/null
+++ b/dist/x86_64-win64/ImageMagick_dependency/configure.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/x86_64-win64/ImageMagick_dependency/delegates.xml b/dist/x86_64-win64/ImageMagick_dependency/delegates.xml
new file mode 100644
index 000000000..24ec4ca7b
--- /dev/null
+++ b/dist/x86_64-win64/ImageMagick_dependency/delegates.xml
@@ -0,0 +1,101 @@
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/x86_64-win64/ImageMagick_dependency/english.xml b/dist/x86_64-win64/ImageMagick_dependency/english.xml
new file mode 100644
index 000000000..2b3245be5
--- /dev/null
+++ b/dist/x86_64-win64/ImageMagick_dependency/english.xml
@@ -0,0 +1,1728 @@
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+ unable to open image
+
+
+ unable to open file
+
+
+ unable to read blob
+
+
+ unable to write blob
+
+
+ unrecognized image format
+
+
+ zero-length blob not permitted
+
+
+
+
+
+
+ cache resources exhausted
+
+
+ incompatible API
+
+
+ no pixels defined in cache
+
+
+ pixel cache is not open
+
+
+ pixels are not authentic
+
+
+ unable to clone cache
+
+
+ unable to extend cache
+
+
+ unable to get cache nexus
+
+
+ unable to open pixel cache
+
+
+ unable to persist pixel cache
+
+
+ unable to read pixel cache
+
+
+ unable to write pixel cache
+
+
+
+
+ unable to acquire cache view
+
+
+ unable to extend pixel cache
+
+
+
+
+
+
+ colormap type not supported
+
+
+ colorspace model is not supported
+
+
+ compression not supported
+
+
+ data encoding scheme is not supported
+
+
+ data storage type is not supported
+
+
+ delta-PNG is not supported
+
+
+ encrypted WPG image file not supported
+
+
+ fractal compression not supported
+
+
+ image column or row size is not supported
+
+
+ image does not have a clip mask
+
+
+ image does not have an alpha channel
+
+
+ image does not have an mask channel
+
+
+ image does not have a EXIF thumbnail
+
+
+ image is not tiled
+
+
+ irregular channel geometry not supported
+
+
+ JNG compression not supported
+
+
+ JPEG compression not supported
+
+
+ JPEG embedding failed
+
+
+ location type is not supported
+
+
+ map storage type is not supported
+
+
+ multi-dimensional matrices are not supported
+
+
+ multiple record list not supported
+
+
+ no bitmap on clipboard
+
+
+ no APP1 data is available
+
+
+ no 8BIM data is available
+
+
+ no color profile is available
+
+
+ no data returned
+
+
+ no image vector graphics; unable to generate SVG
+
+
+ no IPTC profile available
+
+
+ number of images is not supported
+
+
+ only continuous tone picture supported
+
+
+ only level zero files Supported
+
+
+ PNG compression not supported
+
+
+ RLE compression not supported
+
+
+ unable to copy profile
+
+
+ unable to create bitmap
+
+
+ unable to create a DC
+
+
+ unable to decompress image
+
+
+ unable to write MPEG parameters
+
+
+ unable to zip-compress image
+
+
+ ZIP compression not supported
+
+
+
+
+ exif profile size exceeds limit and will be truncated
+
+
+ lossless to lossy JPEG conversion
+
+
+
+
+
+
+ include element nested too deeply
+
+
+ security policy failed to validate
+
+
+
+
+ unable to access configure file
+
+
+ unable to open module file
+
+
+
+
+
+
+
+ an error has occurred reading from file
+
+
+ an error has occurred writing to file
+
+
+ cipher support not enabled
+
+
+ colormap exceeded 256 colors
+
+
+ corrupt image
+
+
+ file format version mismatch
+
+
+ image depth not supported
+
+
+ image file does not contain any image data
+
+
+ image type not supported
+
+
+ improper image header
+
+
+ insufficient image data in file
+
+
+ invalid colormap index
+
+
+ invalid pixel
+
+
+ length and filesize do not match
+
+
+ maximum channels exceeded
+
+
+ missing image channel
+
+
+ negative or zero image size
+
+
+ non OS2 BMP header size less than 40
+
+
+ not enough pixel data
+
+
+ not enough tiles found in level
+
+
+ too much image data in file
+
+
+ static planes value not equal to 1
+
+
+ unable to read extension block
+
+
+ unable to read image header
+
+
+ unable to read image data
+
+
+ unable to runlength decode image
+
+
+ unable to uncompress image
+
+
+ unexpected end-of-file
+
+
+ unexpected sampling factor
+
+
+ unknown pattern type
+
+
+ unrecognized alpha channel option
+
+
+ unrecognized compression
+
+
+ unrecognized number of colors
+
+
+ unsupported bits per pixel
+
+
+
+
+ unable to persist key
+
+
+
+
+ insufficient image data in file
+
+
+ length and filesize do not match
+
+
+ corrupt PCD image, skipping to sync byte
+
+
+
+
+
+
+
+ delegate failed
+
+
+ failed to compute output size
+
+
+ failed to render file
+
+
+ failed to scan file
+
+
+ no tag found
+
+
+ PCL delegate failed
+
+
+ Postscript delegate failed
+
+
+ unable to create image
+
+
+ unable to decode image file
+
+
+ unable to encode image file
+
+
+ unable to initialize FPX library
+
+
+ unable to initialize WMF library
+
+
+ unable to manage JP2 stream
+
+
+ unable to read aspect ratio
+
+
+ unable to read summary info
+
+
+ unable to set affine matrix
+
+
+ unable to set aspect ratio
+
+
+ unable to set color twist
+
+
+ unable to set contrast
+
+
+ unable to set filtering value
+
+
+ unable to set image title
+
+
+ unable to set JPEG level
+
+
+ unable to set region of interest
+
+
+ unable to set summary info
+
+
+ unable to write SVG format
+
+
+ XPS delegate failed
+
+
+
+
+
+
+ already pushing pattern definition
+
+
+ non-conforming drawing primitive definition
+
+
+ not a relative URL
+
+
+ not currently pushing pattern definition
+
+
+ segment stack overflow
+
+
+ too many bezier coordinates
+
+
+ unable to print
+
+
+ unbalanced graphic context push-pop
+
+
+ URL not found
+
+
+ vector graphics nested too deeply
+
+
+
+
+
+
+
+ an error has occurred reading from file
+
+
+ unable to create temporary file
+
+
+ unable to open file
+
+
+ unable to write file
+
+
+
+
+
+
+
+ angle is discontinuous
+
+
+ colormapped image required
+
+
+ color separated image required
+
+
+ color profile operates on another colorspace
+
+
+ image depth not supported
+
+
+ image sequence is required
+
+
+ image morphology differs
+
+
+ image list is required
+
+
+ image size differs
+
+
+ left and right image sizes differ
+
+
+ negative or zero image size
+
+
+ no images were found
+
+
+ no images were loaded
+
+
+ too many cluster
+
+
+ unable to create color transform
+
+
+ width or height exceeds limit
+
+
+
+
+ associate profile with image, a source and destination color profile required for transform
+
+
+ images too dissimilar
+
+
+ unable to transform colorspace
+
+
+
+
+
+
+ filter failed
+
+
+
+
+
+
+
+ delegate library support not built-in
+
+
+ no decode delegate for this image format
+
+
+ no encode delegate for this image format
+
+
+
+
+ delegate library support not built-in
+
+
+ FreeType library is not available
+
+
+ LCMS color profile library is not available
+
+
+ no encode delegate for this image format
+
+
+
+
+
+
+
+ image coder signature mismatch
+
+
+ image filter signature mismatch
+
+
+ unable to load module
+
+
+ unable to register image format
+
+
+
+
+ unable to initialize module loader
+
+
+
+
+ unable to close module
+
+
+
+
+
+
+
+ attempt to perform an operation not authorized by the security policy
+
+
+
+
+
+
+ unable to get registry ID
+
+
+ unable to set registry
+
+
+
+
+
+
+
+ list length exceeds limit
+
+
+ memory allocation failed
+
+
+ pixel cache allocation failed
+
+
+ time limit exceeded
+
+
+ too many exceptions
+
+
+ too many objects
+
+
+ unable to acquire string
+
+
+ unable to allocate colormap
+
+
+ unable to convert font
+
+
+ unable to create colormap
+
+
+ unable to dither image
+
+
+ unable to clone package info
+
+
+ unable to get package info
+
+
+
+
+ unable to allocate dash pattern
+
+
+ unable to allocate derivates
+
+
+ unable to allocate gamma map
+
+
+ unable to allocate image
+
+
+ unable to allocate image pixels
+
+
+ unable to destroy semaphore
+
+
+ unable to instantiate semaphore
+
+
+ unable to allocate string
+
+
+ Memory allocation failed
+
+
+ unable to concatenate string
+
+
+ unable to convert text
+
+
+ unable to create colormap
+
+
+ unable to clone image
+
+
+ unable to display image
+
+
+ unable to escape string
+
+
+ unable to interpret MSL image
+
+
+ unable to lock semaphore
+
+
+ unable to unlock semaphore
+
+
+
+
+ memory allocation failed
+
+
+ profile size exceeds limit
+
+
+
+
+
+
+
+ font substitution required
+
+
+ unable to get type metrics
+
+
+ unable to initialize freetype library
+
+
+ unable to read font
+
+
+ unrecognized font encoding
+
+
+
+
+ unable to read font
+
+
+
+
+
+
+ image does not contain the stream geometry
+
+
+ no stream handler is defined
+
+
+ pixel cache is not open
+
+
+
+
+
+
+ invalid colormap index
+
+
+ zero region size
+
+
+ unable to open file
+
+
+ wand quantum depth does not match that of the core API
+
+
+ wand contains no images
+
+
+ wand contains no iterators
+
+
+
+
+
+
+ color is not known to server
+
+
+ no window with specified ID exists
+
+
+ standard Colormap is not initialized
+
+
+ unable to connect to remote display
+
+
+ unable to create bitmap
+
+
+ unable to create colormap
+
+
+ unable to create pixmap
+
+
+ unable to create property
+
+
+ unable to create standard colormap
+
+
+ unable to display image info
+
+
+ unable to get property
+
+
+ unable to get Standard Colormap
+
+
+ unable to get visual
+
+
+ unable to grab mouse
+
+
+ unable to load font
+
+
+ unable to match visual to Standard Colormap
+
+
+ unable to open X server
+
+
+ unable to read X window attributes
+
+
+ unable to read X window image
+
+
+ unrecognized colormap type
+
+
+ unrecognized gravity type
+
+
+ unrecognized visual specifier
+
+
+
+
+ unable to create X cursor
+
+
+ unable to create graphic context
+
+
+ unable to create standard colormap
+
+
+ unable to create text property
+
+
+ unable to create X window
+
+
+ unable to create X image
+
+
+ unable to create X pixmap
+
+
+ unable to display image
+
+
+ unable to get visual
+
+
+ unable to get pixel info
+
+
+ unable to load font
+
+
+ unable to make X window
+
+
+ unable to open X server
+
+
+ unable to view fonts
+
+
+
+
+ using default visual
+
+
+ unable to get visual
+
+
+
+
+
+
+
+ add noise to image
+
+
+
+
+ append image sequence
+
+
+
+
+ assign image colors
+
+
+
+
+ average image sequence
+
+
+
+
+ blur image
+
+
+
+
+ chop image
+
+
+
+
+ classify image colors
+
+
+
+
+ replace color in image
+
+
+
+
+ colorize image
+
+
+
+
+ combine image
+
+
+
+
+ contrast-stretch image
+
+
+
+
+ convolve image
+
+
+
+
+ crop image
+
+
+
+
+ decode image
+
+
+
+
+ despeckle image
+
+
+
+
+ distort image
+
+
+
+
+ dither image colors
+
+
+
+
+ dull image contrast
+
+
+
+
+ encode image
+
+
+
+
+ equalize image
+
+
+
+
+ flip image
+
+
+
+
+ flop image
+
+
+
+
+ add frame to image
+
+
+
+
+ fx image
+
+
+
+
+ gamma correct image
+
+
+
+
+ compute image histogram
+
+
+
+
+ implode image
+
+
+
+
+ level image
+
+
+
+
+ load image
+
+
+ load images
+
+
+
+
+ magnify image
+
+
+
+
+ filter image with neighborhood ranking
+
+
+
+
+ minify image
+
+
+
+
+ modulate image
+
+
+
+
+ mogrify image
+
+
+
+
+ montage image
+
+
+
+
+ morph image sequence
+
+
+
+
+ mosaic image
+
+
+
+
+ negate image
+
+
+
+
+ oil paint image
+
+
+
+
+ set opaque color in image
+
+
+
+
+ plasma image
+
+
+
+
+ preview image
+
+
+
+
+ raise image
+
+
+
+
+ recolor color image
+
+
+
+
+ reduce image colors
+
+
+
+
+ reduce the image noise
+
+
+
+
+ render image
+
+
+
+
+ resize image
+
+
+
+
+ RGB transform image
+
+
+
+
+ roll image
+
+
+
+
+ rotate image
+
+
+
+
+ sample image
+
+
+
+
+ save image
+
+
+ save images
+
+
+
+
+ scale image
+
+
+
+
+ segment image
+
+
+
+
+ extract a channel from image
+
+
+
+
+ sepia-tone image
+
+
+
+
+ shade image
+
+
+
+
+ sharpen image
+
+
+
+
+ sharpen image contrast
+
+
+
+
+ sigmoidal contrast image
+
+
+
+
+ solarize image
+
+
+
+
+ splice image
+
+
+
+
+ spread image
+
+
+
+
+ stegano image
+
+
+
+
+ stereo image
+
+
+
+
+ swirl image
+
+
+
+
+ texture image
+
+
+
+
+ threshold image
+
+
+
+
+ tile image
+
+
+
+
+ tint image
+
+
+
+
+ transform RGB image
+
+
+
+
+ set transparent color in image
+
+
+
+
+ wave image
+
+
+
+
+ write image
+
+
+
+
+ x shear image
+
+
+
+
+ y shear image
+
+
+
+
diff --git a/dist/x86_64-win64/ImageMagick_dependency/libsharpyuv-0.dll b/dist/x86_64-win64/ImageMagick_dependency/libsharpyuv-0.dll
new file mode 100644
index 000000000..a0e0bf3f2
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/libsharpyuv-0.dll differ
diff --git a/dist/x86_64-win64/libwebp.dll b/dist/x86_64-win64/ImageMagick_dependency/libwebp.dll
similarity index 100%
rename from dist/x86_64-win64/libwebp.dll
rename to dist/x86_64-win64/ImageMagick_dependency/libwebp.dll
diff --git a/dist/x86_64-win64/ImageMagick_dependency/locale.xml b/dist/x86_64-win64/ImageMagick_dependency/locale.xml
new file mode 100644
index 000000000..d593fba35
--- /dev/null
+++ b/dist/x86_64-win64/ImageMagick_dependency/locale.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/x86_64-win64/ImageMagick_dependency/log.xml b/dist/x86_64-win64/ImageMagick_dependency/log.xml
new file mode 100644
index 000000000..20c45da82
--- /dev/null
+++ b/dist/x86_64-win64/ImageMagick_dependency/log.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
diff --git a/dist/x86_64-win64/ImageMagick_dependency/mime.xml b/dist/x86_64-win64/ImageMagick_dependency/mime.xml
new file mode 100644
index 000000000..d85f707f3
--- /dev/null
+++ b/dist/x86_64-win64/ImageMagick_dependency/mime.xml
@@ -0,0 +1,1157 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_bmp_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_bmp_.dll
new file mode 100644
index 000000000..602656832
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_bmp_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_exr_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_exr_.dll
new file mode 100644
index 000000000..3f2901d07
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_exr_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_gif_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_gif_.dll
new file mode 100644
index 000000000..0dfdef697
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_gif_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_heic_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_heic_.dll
new file mode 100644
index 000000000..542020bc5
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_heic_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_icon_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_icon_.dll
new file mode 100644
index 000000000..f13fb2718
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_icon_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_info_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_info_.dll
new file mode 100644
index 000000000..81249ccdf
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_info_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_jp2_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_jp2_.dll
new file mode 100644
index 000000000..9ba9e9a8a
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_jp2_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_jpeg_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_jpeg_.dll
new file mode 100644
index 000000000..fbae17a47
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_jpeg_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_jxl_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_jxl_.dll
new file mode 100644
index 000000000..9edd1ae01
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_jxl_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_null_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_null_.dll
new file mode 100644
index 000000000..6d64bf0e6
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_null_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_png_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_png_.dll
new file mode 100644
index 000000000..333f84ec5
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_png_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_psd_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_psd_.dll
new file mode 100644
index 000000000..3788f4955
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_psd_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_raw_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_raw_.dll
new file mode 100644
index 000000000..e768494e7
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_raw_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_svg_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_svg_.dll
new file mode 100644
index 000000000..4eeaa5392
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_svg_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_tiff_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_tiff_.dll
new file mode 100644
index 000000000..a7fbc695c
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_tiff_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_txt_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_txt_.dll
new file mode 100644
index 000000000..7344bd81f
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_txt_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_webp_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_webp_.dll
new file mode 100644
index 000000000..8aa0451ea
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/coders/IM_MOD_RL_webp_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/modules/filters/FILTER_RL_analyze_.dll b/dist/x86_64-win64/ImageMagick_dependency/modules/filters/FILTER_RL_analyze_.dll
new file mode 100644
index 000000000..c290fd34f
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/modules/filters/FILTER_RL_analyze_.dll differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/policy.xml b/dist/x86_64-win64/ImageMagick_dependency/policy.xml
new file mode 100644
index 000000000..d1f1230de
--- /dev/null
+++ b/dist/x86_64-win64/ImageMagick_dependency/policy.xml
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/x86_64-win64/ImageMagick_dependency/sRGB.icc b/dist/x86_64-win64/ImageMagick_dependency/sRGB.icc
new file mode 100644
index 000000000..cfbd03e1f
Binary files /dev/null and b/dist/x86_64-win64/ImageMagick_dependency/sRGB.icc differ
diff --git a/dist/x86_64-win64/ImageMagick_dependency/thresholds.xml b/dist/x86_64-win64/ImageMagick_dependency/thresholds.xml
new file mode 100644
index 000000000..75831f60e
--- /dev/null
+++ b/dist/x86_64-win64/ImageMagick_dependency/thresholds.xml
@@ -0,0 +1,336 @@
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+ Threshold 1x1 (non-dither)
+
+ 1
+
+
+
+
+ Checkerboard 2x1 (dither)
+
+ 1 2
+ 2 1
+
+
+
+
+
+ Ordered 2x2 (dispersed)
+
+ 1 3
+ 4 2
+
+
+
+
+ Ordered 3x3 (dispersed)
+
+ 3 7 4
+ 6 1 9
+ 2 8 5
+
+
+
+
+
+ Ordered 4x4 (dispersed)
+
+ 1 9 3 11
+ 13 5 15 7
+ 4 12 2 10
+ 16 8 14 6
+
+
+
+
+
+ Ordered 8x8 (dispersed)
+
+ 1 49 13 61 4 52 16 64
+ 33 17 45 29 36 20 48 32
+ 9 57 5 53 12 60 8 56
+ 41 25 37 21 44 28 40 24
+ 3 51 15 63 2 50 14 62
+ 35 19 47 31 34 18 46 30
+ 11 59 7 55 10 58 6 54
+ 43 27 39 23 42 26 38 22
+
+
+
+
+
+ Halftone 4x4 (angled)
+
+ 4 2 7 5
+ 3 1 8 6
+ 7 5 4 2
+ 8 6 3 1
+
+
+
+
+ Halftone 6x6 (angled)
+
+ 14 13 10 8 2 3
+ 16 18 12 7 1 4
+ 15 17 11 9 6 5
+ 8 2 3 14 13 10
+ 7 1 4 16 18 12
+ 9 6 5 15 17 11
+
+
+
+
+ Halftone 8x8 (angled)
+
+ 13 7 8 14 17 21 22 18
+ 6 1 3 9 28 31 29 23
+ 5 2 4 10 27 32 30 24
+ 16 12 11 15 20 26 25 19
+ 17 21 22 18 13 7 8 14
+ 28 31 29 23 6 1 3 9
+ 27 32 30 24 5 2 4 10
+ 20 26 25 19 16 12 11 15
+
+
+
+
+
+ Halftone 4x4 (orthogonal)
+
+ 7 13 11 4
+ 12 16 14 8
+ 10 15 6 2
+ 5 9 3 1
+
+
+
+
+ Halftone 6x6 (orthogonal)
+
+ 7 17 27 14 9 4
+ 21 29 33 31 18 11
+ 24 32 36 34 25 22
+ 19 30 35 28 20 10
+ 8 15 26 16 6 2
+ 5 13 23 12 3 1
+
+
+
+
+ Halftone 8x8 (orthogonal)
+
+ 7 21 33 43 36 19 9 4
+ 16 27 51 55 49 29 14 11
+ 31 47 57 61 59 45 35 23
+ 41 53 60 64 62 52 40 38
+ 37 44 58 63 56 46 30 22
+ 15 28 48 54 50 26 17 10
+ 8 18 34 42 32 20 6 2
+ 5 13 25 39 24 12 3 1
+
+
+
+
+
+ Halftone 16x16 (orthogonal)
+
+ 4 12 24 44 72 100 136 152 150 134 98 70 42 23 11 3
+ 7 16 32 52 76 104 144 160 158 142 102 74 50 31 15 6
+ 19 27 40 60 92 132 168 180 178 166 130 90 58 39 26 18
+ 36 48 56 80 124 176 188 204 203 187 175 122 79 55 47 35
+ 64 68 84 116 164 200 212 224 223 211 199 162 114 83 67 63
+ 88 96 112 156 192 216 232 240 239 231 214 190 154 111 95 87
+ 108 120 148 184 208 228 244 252 251 243 226 206 182 147 119 107
+ 128 140 172 196 219 235 247 256 255 246 234 218 194 171 139 127
+ 126 138 170 195 220 236 248 253 254 245 233 217 193 169 137 125
+ 106 118 146 183 207 227 242 249 250 241 225 205 181 145 117 105
+ 86 94 110 155 191 215 229 238 237 230 213 189 153 109 93 85
+ 62 66 82 115 163 198 210 221 222 209 197 161 113 81 65 61
+ 34 46 54 78 123 174 186 202 201 185 173 121 77 53 45 33
+ 20 28 37 59 91 131 167 179 177 165 129 89 57 38 25 17
+ 8 13 29 51 75 103 143 159 157 141 101 73 49 30 14 5
+ 1 9 21 43 71 99 135 151 149 133 97 69 41 22 10 2
+
+
+
+
+
+
+ Circles 5x5 (black)
+
+ 1 21 16 15 4
+ 5 17 20 19 14
+ 6 21 25 24 12
+ 7 18 22 23 11
+ 2 8 9 10 3
+
+
+
+
+
+ Circles 5x5 (white)
+
+ 25 21 10 11 22
+ 20 9 6 7 12
+ 19 5 1 2 13
+ 18 8 4 3 14
+ 24 17 16 15 23
+
+
+
+
+ Circles 6x6 (black)
+
+ 1 5 14 13 12 4
+ 6 22 28 27 21 11
+ 15 29 35 34 26 20
+ 16 30 36 33 25 19
+ 7 23 31 32 24 10
+ 2 8 17 18 9 3
+
+
+
+
+ Circles 6x6 (white)
+
+ 36 32 23 24 25 33
+ 31 15 9 10 16 26
+ 22 8 2 3 11 17
+ 21 7 1 4 12 18
+ 30 14 6 5 13 27
+ 35 29 20 19 28 34
+
+
+
+
+ Circles 7x7 (black)
+
+ 3 9 18 28 17 8 2
+ 10 24 33 39 32 23 7
+ 19 34 44 48 43 31 16
+ 25 40 45 49 47 38 27
+ 20 35 41 46 42 29 15
+ 11 21 36 37 28 22 6
+ 4 12 13 26 14 5 1
+
+
+
+
+
+ Circles 7x7 (white)
+
+ 47 41 32 22 33 42 48
+ 40 26 17 11 18 27 43
+ 31 16 6 2 7 19 34
+ 25 10 5 1 3 12 23
+ 30 15 9 4 8 20 35
+ 39 29 14 13 21 28 44
+ 46 38 37 24 36 45 49
+
+
+
+
+
+
+
diff --git a/dist/x86_64-win64/ImageMagick_dependency/type-ghostscript.xml b/dist/x86_64-win64/ImageMagick_dependency/type-ghostscript.xml
new file mode 100644
index 000000000..6e08ef755
--- /dev/null
+++ b/dist/x86_64-win64/ImageMagick_dependency/type-ghostscript.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/x86_64-win64/ImageMagick_dependency/type.xml b/dist/x86_64-win64/ImageMagick_dependency/type.xml
new file mode 100644
index 000000000..fa80ca6ca
--- /dev/null
+++ b/dist/x86_64-win64/ImageMagick_dependency/type.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+
+
diff --git a/mangadownloader/FpuMaskUnit.pas b/mangadownloader/FpuMaskUnit.pas
new file mode 100644
index 000000000..201198966
--- /dev/null
+++ b/mangadownloader/FpuMaskUnit.pas
@@ -0,0 +1,22 @@
+unit FpuMaskUnit;
+
+{$mode objfpc}{$H+}
+
+interface
+
+implementation
+
+uses
+ SysUtils;
+
+var
+ Saved8087CW: Word;
+
+initialization
+ Saved8087CW := Get8087CW;
+ Set8087CW($133F);
+
+finalization
+ Set8087CW(Saved8087CW);
+
+end.
diff --git a/mangadownloader/fmd_magic.lpi b/mangadownloader/fmd_magic.lpi
new file mode 100644
index 000000000..ad038cd3a
--- /dev/null
+++ b/mangadownloader/fmd_magic.lpi
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mangadownloader/fmd_magic.lpr b/mangadownloader/fmd_magic.lpr
new file mode 100644
index 000000000..0bcf6d6ef
--- /dev/null
+++ b/mangadownloader/fmd_magic.lpr
@@ -0,0 +1,143 @@
+program fmd_magic;
+
+{$mode objfpc}{$H+}
+{$APPTYPE CONSOLE}
+
+uses
+ FpuMaskUnit, Classes, SysUtils, Math, ImageMagickManager;
+
+var
+ SavedExceptionMask: TFPUExceptionMask;
+
+procedure ListFormats;
+const
+ CommonFormats: array[0..29] of String = (
+ 'BMP', 'GIF', 'JPEG', 'JPG', 'PNG', 'APNG', 'TIFF', 'TIF',
+ 'WEBP', 'AVIF', 'JXL', 'HEIC', 'HEIF', 'ICO', 'PSD', 'SVG',
+ 'TGA', 'JP2', 'RAW', 'XCF', 'PCX', 'PGM', 'PBM', 'PPM',
+ 'XPM', 'FAX', 'G3', 'GIF87', 'PDF', 'EPS'
+ );
+var
+ i: Integer;
+begin
+ WriteLn('Common Supported Formats:');
+ WriteLn('---------------------------------------------------');
+ for i := 0 to High(CommonFormats) do
+ WriteLn(CommonFormats[i]);
+ WriteLn;
+ WriteLn('(Full format list requires magick.exe CLI)');
+end;
+
+var
+ InputFile, OutputFile, InputExt, OutputFormat: String;
+ Stream, Output: TMemoryStream;
+ ImgMagick: TImageMagickManager;
+begin
+ SavedExceptionMask := GetExceptionMask;
+ SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]);
+ try
+ if ParamCount < 1 then
+ begin
+ WriteLn('Usage: fmd_magic ');
+ WriteLn(' fmd_magic -identify ');
+ WriteLn(' fmd_magic --support');
+ WriteLn('Examples:');
+ WriteLn(' fmd_magic png cover.tif cover.png');
+ WriteLn(' fmd_magic gif animated.webp animated.gif');
+ WriteLn(' fmd_magic -identify cover.tif');
+ WriteLn(' fmd_magic --support');
+ Exit;
+ end;
+
+ TImageMagickManager.Initialize;
+ try
+ ImgMagick := TImageMagickManager.Instance;
+ if not ImgMagick.PathFound then
+ begin
+ WriteLn('ERROR: ImageMagick not found!');
+ Exit;
+ end;
+
+ if ParamStr(1) = '--support' then
+ begin
+ ListFormats;
+ end
+ else if ParamStr(1) = '-identify' then
+ begin
+ if ParamCount < 2 then
+ begin
+ WriteLn('ERROR: Missing input file for -identify');
+ Exit;
+ end;
+ InputFile := ExpandFileName(ParamStr(2));
+ if not FileExists(InputFile) then
+ begin
+ WriteLn('ERROR: Input file not found: ' + InputFile);
+ Exit;
+ end;
+
+ Stream := TMemoryStream.Create;
+ try
+ Stream.LoadFromFile(InputFile);
+ WriteLn(ImgMagick.Identify(Stream, LowerCase(ExtractFileExt(InputFile))));
+ finally
+ Stream.Free;
+ end;
+ end
+ else
+ begin
+ if ParamCount < 3 then
+ begin
+ WriteLn('ERROR: Missing parameters. Usage: fmd_magic ');
+ Exit;
+ end;
+
+ OutputFormat := ParamStr(1);
+ InputFile := ExpandFileName(ParamStr(2));
+ OutputFile := ExpandFileName(ParamStr(3));
+ InputExt := LowerCase(ExtractFileExt(InputFile));
+ if InputExt <> '' then Delete(InputExt, 1, 1);
+
+ WriteLn('Input: ' + InputFile);
+ WriteLn('Output: ' + OutputFile);
+ WriteLn('Format: ' + OutputFormat);
+ WriteLn;
+
+ if not FileExists(InputFile) then
+ begin
+ WriteLn('ERROR: Input file not found: ' + InputFile);
+ Exit;
+ end;
+
+ Stream := TMemoryStream.Create;
+ try
+ Stream.LoadFromFile(InputFile);
+ WriteLn('Loaded stream, size=' + IntToStr(Stream.Size));
+ WriteLn;
+
+ WriteLn('Calling ConvertStream...');
+ Output := ImgMagick.ConvertStream(Stream, OutputFormat, True, InputExt);
+
+ WriteLn;
+ if Assigned(Output) and (Output.Size > 0) then
+ begin
+ Output.SaveToFile(OutputFile);
+ WriteLn('SUCCESS! Output: ' + OutputFile);
+ WriteLn('Output size: ' + IntToStr(Output.Size) + ' bytes');
+ Output.Free;
+ end
+ else if ImgMagick.LastError <> '' then
+ WriteLn('FAILED: ' + ImgMagick.LastError)
+ else
+ WriteLn('FAILED: Conversion returned empty result');
+ finally
+ Stream.Free;
+ end;
+ end;
+ finally
+ TImageMagickManager.Finalize;
+ end;
+ finally
+ SetExceptionMask(SavedExceptionMask);
+ end;
+end.
diff --git a/mangadownloader/forms/frmMain.lfm b/mangadownloader/forms/frmMain.lfm
index eaefee8fb..971b9b095 100644
--- a/mangadownloader/forms/frmMain.lfm
+++ b/mangadownloader/forms/frmMain.lfm
@@ -4459,7 +4459,6 @@ object MainForm: TMainForm
ChildSizing.VerticalSpacing = 6
ClientHeight = 102
ClientWidth = 975
- Enabled = False
ParentBackground = False
TabOrder = 5
object ckImageMagick: TCheckBox
@@ -4470,7 +4469,6 @@ object MainForm: TMainForm
Top = 4
Width = 191
Caption = 'Enable ImageMagick Conversion'
- Enabled = False
TabOrder = 0
OnChange = ckImageMagickChange
end
@@ -4484,7 +4482,7 @@ object MainForm: TMainForm
Width = 74
Caption = 'Save Image as'
end
- object cbImageMagickSaveAs: TComboBox
+ object cbImageMagickSaveAs: TComboBox
AnchorSideLeft.Control = lbImageMagickSaveAs
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = lbImageMagickSaveAs
@@ -4493,11 +4491,16 @@ object MainForm: TMainForm
Height = 23
Top = 25
Width = 100
- Enabled = False
ItemHeight = 15
ItemIndex = 0
Items.Strings = (
'JPEG'
+ 'PNG'
+ 'JXL'
+ 'GIF'
+ 'BMP'
+ 'WEBP'
+ 'AVIF'
)
TabOrder = 1
Text = 'JPEG'
@@ -4522,7 +4525,6 @@ object MainForm: TMainForm
Height = 23
Top = 50
Width = 100
- Enabled = False
ItemHeight = 15
ItemIndex = 0
Items.Strings = (
@@ -4551,7 +4553,6 @@ object MainForm: TMainForm
Height = 23
Top = 75
Width = 47
- Enabled = False
MaxValue = 100
MinValue = 1
TabOrder = 3
diff --git a/mangadownloader/forms/frmMain.pas b/mangadownloader/forms/frmMain.pas
index 6f3c040b7..3ce6677de 100644
--- a/mangadownloader/forms/frmMain.pas
+++ b/mangadownloader/forms/frmMain.pas
@@ -2492,8 +2492,8 @@ procedure TMainForm.LoadAbout;
AddToAboutStatus('OpenSSL Version', s);
end;
- if WebPLibHandle = 0 then InitWebPModule;
- if WebPLibHandle <> 0 then try AddToAboutStatus('WebP Version', WebPGetVersion); except end;
+ if not IsWebPModuleLoaded then InitWebPModule;
+ if IsWebPModuleLoaded then try AddToAboutStatus('WebP Version', WebPGetVersion); except end;
if BrotliLibHandle = 0 then InitBrotliModule;
if BrotliLibHandle <> 0 then try AddToAboutStatus('Brotli Version', BrotliGetVersion); except end;
if ZstdLibHandle = 0 then InitZstdModule;
@@ -5827,7 +5827,12 @@ procedure TMainForm.LoadOptions;
// imagemagick
if TImageMagickManager.Instance.PathFound then
begin
+ gbImageMagick.Enabled := True;
ckImageMagick.Checked := ReadBool('imagemagick', 'ImageMagickEnabled', False);
+ end
+ else
+ begin
+ gbImageMagick.Enabled := False;
end;
cbImageMagickSaveAs.ItemIndex := cbImageMagickSaveAs.Items.IndexOf(ReadString('imagemagick', 'ImageMagickSaveAs', 'JPEG'));
diff --git a/mangadownloader/md.lpi b/mangadownloader/md.lpi
index e4b89874f..8100f0893 100644
--- a/mangadownloader/md.lpi
+++ b/mangadownloader/md.lpi
@@ -306,7 +306,7 @@
-
+
@@ -353,6 +353,9 @@
+
+
+
diff --git a/mangadownloader/md.lpr b/mangadownloader/md.lpr
index d86797670..fa8b5a836 100644
--- a/mangadownloader/md.lpr
+++ b/mangadownloader/md.lpr
@@ -254,12 +254,6 @@
end;
{$endif}
- //webp
- if FileExists(FMD_DIRECTORY + DLLWebPName) then
- begin
- DLLWebPName := FMD_DIRECTORY + DLLWebPName;
- end;
-
Case iDarkMode of
0: PreferredAppMode := pamAllowDark;
1: PreferredAppMode := pamForceDark;