Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

pass quality argument down the hole #233

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyppeteer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
__author__ = """Hiroyuki Takagi"""
__email__ = 'miyako.dev@gmail.com'
__version__ = '0.0.25'
__chromium_revision__ = '588429'
__chromium_revision__ = '848005' # https://github.com/puppeteer/puppeteer/releases
__base_puppeteer_version__ = 'v1.6.0'
__pyppeteer_home__ = os.environ.get(
'PYPPETEER_HOME', AppDirs('pyppeteer').user_data_dir) # type: str
Expand Down
6 changes: 5 additions & 1 deletion pyppeteer/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,8 @@ async def _screenshotTask(self, format: str, options: dict # noqa: C901
await self._client.send('Target.activateTarget', {
'targetId': self._target._targetId,
})
clip = options.get('clip')

clip, quality = options.get('clip'), options.get('quality')
if clip:
clip['scale'] = 1

Expand Down Expand Up @@ -1299,6 +1300,9 @@ async def _screenshotTask(self, format: str, options: dict # noqa: C901
opt = {'format': format}
if clip:
opt['clip'] = clip
if format == 'jpeg' and quality is not None:
opt['quality'] = quality

result = await self._client.send('Page.captureScreenshot', opt)

if options.get('omitBackground'):
Expand Down