-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
Some special characters, ie. '(' and ')' causes a error when generating the new image.
It's a problem with the command. You have to add " ' " to make sure these characters are handled correctly. To fix it, just replace.
if(isset($opts['scale']) && $opts['scale'] == true):
$cmd = $path_to_convert." ".$imagePath." -resize ".$resize." -quality ".$quality." ".$newPath;
else:
$cmd = $path_to_convert." ".$imagePath." -resize ".$resize." -size ".$w."x".$h." xc:".(isset($opts['canvas-color'])?$opts['canvas-color']:"transparent")." +swap -gravity center -composite -quality ".$quality." ".$newPath;
endif;
else:
$cmd = $path_to_convert." ".$imagePath." -thumbnail ".(!empty($h) ? 'x':'').$w."".(isset($opts['maxOnly']) && $opts['maxOnly'] == true ? "\>" : "")." -quality ".$quality." ".$newPath;
endif;
With this:
if(isset($opts['scale']) && $opts['scale'] == true):
$cmd = $path_to_convert." '".$imagePath."' -resize ".$resize." -quality ".$quality." ".$newPath;
else:
$cmd = $path_to_convert." '".$imagePath."' -resize ".$resize." -size ".$w."x".$h." xc:".(isset($opts['canvas-color'])?$opts['canvas-color']:"transparent")." +swap -gravity center -composite -quality ".$quality." ".$newPath;
endif;
else:
$cmd = $path_to_convert." '".$imagePath."' -thumbnail ".(!empty($h) ? 'x':'').$w."".(isset($opts['maxOnly']) && $opts['maxOnly'] == true ? "\>" : "")." -quality ".$quality." ".$newPath;
endif;
Metadata
Metadata
Assignees
Labels
No labels