From 94906acf4b65263424da31d57194a32711730c8f Mon Sep 17 00:00:00 2001 From: Softopia Date: Sun, 11 Apr 2021 16:15:50 +0530 Subject: [PATCH] Added Density Option Support density option only works when it's on second place in command (tested for pdf to image) --- src/Command.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Command.php b/src/Command.php index 8eeb0c2..b5360ea 100644 --- a/src/Command.php +++ b/src/Command.php @@ -463,7 +463,17 @@ public function quality(int $quality): self return $this; } - + /** + * @see http://imagemagick.org/script/command-line-options.php#density + */ + public function density(int $density): self + { + $densityAry = []; + $densityAry[] = '-density'; + $densityAry[] = (string) $density; + array_splice($this->command,2,0,$densityAry); //density option only works when it's on second place in command (tested for pdf to image) + return $this; + } /** * @param string|Geometry $page *