Conversation
density option only works when it's on second place in command (tested for pdf to image)
| $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) |
There was a problem hiding this comment.
Density is not supposed to be placed "second place in command", but "before any vector source is specified".
If you use ImageMagick to manipulate multiple files or intermediary files, you should be able to specify the density for all files.
You say you "tested for pdf to image", but if you test "image to pdf", you'll realize that the density option must be put before the pdf filename, like this for instance: convert my-file.jpg -density 300 my-file.pdf.
Another case is units. By default, density is in dpi (dots per inch), but you can use the -units option to switch to dots per centimeters, but it has to be specified before the -density option. Your code proposal doesn't allow that.
Also, the density option must respect its specified format: {width} | {width}x{height}.
You can add a small function to the Reference class that will validate these rules.
There was a problem hiding this comment.
I tried to read Reference classes but didn't get so much idea how i will gonna add these options but i'll try.
density option only works when it's on second place in command (tested for pdf to image)