Skip to content

Commit f489a5a

Browse files
committed
Changed: Timeout for imagemagick for larger file amount operations
Added: Comments for imagemagick command
1 parent 77a02cc commit f489a5a

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

baseunits/imagemagickmanager.pas

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ TImageMagickManager = class
3131
function IdentifyCommand(const QueryCommand: String): TStringList;
3232
procedure CacheSupportedFormats;
3333
procedure CacheCompressionTypes;
34-
function ExecuteMagickCommand(const Params: array of String; TimeoutMS: Cardinal = 300000): Boolean;
34+
function ExecuteMagickCommand(const Params: array of String; TimeoutMS: Cardinal = 600000): Boolean;
3535
function StreamToString(Stream: TMemoryStream): String;
3636
constructor CreatePrivate;
3737

@@ -501,7 +501,7 @@ function TImageMagickManager.IsFormatSupported(const Format: String): Boolean;
501501
end;
502502
end;
503503

504-
function TImageMagickManager.ExecuteMagickCommand(const Params: array of String; TimeoutMS: Cardinal = 300000): Boolean;
504+
function TImageMagickManager.ExecuteMagickCommand(const Params: array of String; TimeoutMS: Cardinal = 600000): Boolean;
505505
var
506506
Process: TProcess;
507507
Param, ErrorStreamOutput: String;
@@ -667,6 +667,20 @@ function TImageMagickManager.ConvertImage(InputFile, OutputDir: String): Boolean
667667
OutputFile := QuoteStr((OutputDir + '%[filename:name].' + FSaveAs), '"');
668668
OutputDir := QuoteStr(ExcludeTrailingPathDelimiter(OutputDir), '"');
669669

670+
// if FMogrify then:
671+
// 'mogrify' command first
672+
// 'path' command for OutputDir
673+
// input directory to mogrify
674+
675+
// else:
676+
// input file list first
677+
// 'adjoin' command to treat each file in list as a seperate command
678+
// 'set filename:name' command to set output file name same as input
679+
// output file with directory and file name
680+
681+
// 'quality' command to set output image quality
682+
// 'compress' command for compression type
683+
// 'format' command to set output file format
670684
Result := ExecuteMagickCommand([
671685
IFThen(FMogrify, 'mogrify', InputFile),
672686
'-quality', GetQualityString,

0 commit comments

Comments
 (0)