New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add setScreenshotType() method + Update Readme #180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks...
src/Browsershot.php
Outdated
@@ -23,6 +23,8 @@ class Browsershot | |||
protected $proxyServer = ''; | |||
protected $showBackground = false; | |||
protected $showScreenshotBackground = true; | |||
protected $screenshotType = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set this to png
by default.
src/Browsershot.php
Outdated
@@ -413,6 +425,14 @@ public function createScreenshotCommand($targetPath = null): array | |||
$options['path'] = $targetPath; | |||
} | |||
|
|||
if ($this->screenshotType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this if
statement.
src/Browsershot.php
Outdated
@@ -23,6 +23,8 @@ class Browsershot | |||
protected $proxyServer = ''; | |||
protected $showBackground = false; | |||
protected $showScreenshotBackground = true; | |||
protected $screenshotType = ''; | |||
protected $screenshotQuality = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set this to null
by default.
@@ -218,6 +220,16 @@ public function hideBackground() | |||
return $this; | |||
} | |||
|
|||
public function setScreenshotType(string $type, int $quality = null) | |||
{ | |||
$this->screenshotType = $type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an empty line after this one.
Thanks! |
Another simpler implementation of Issue #177