Skip to content

Commit

Permalink
add default quality to imwrite and add comments
Browse files Browse the repository at this point in the history
(cherry picked from commit 537b394)
  • Loading branch information
EraChen233 authored and yimelia committed Jan 17, 2020
1 parent 2f08784 commit 7efc380
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion airtest/aircv/aircv.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def imread(filename, flatten=False):
return img


def imwrite(filename, img, quality):
def imwrite(filename, img, quality=10):
"""写出图片到本地路径,压缩"""
if PY2:
filename = filename.encode(sys.getfilesystemencoding())
Expand Down
1 change: 1 addition & 0 deletions airtest/core/android/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ def snapshot(self, filename=None, ensure_orientation=True, quality=10):
Args:
filename: name of the file where to store the screenshot, default is None which is stdout
ensure_orientation: True or False whether to keep the orientation same as display
quality: The image quality, integer in range [1, 99]
Returns:
screenshot output
Expand Down
1 change: 1 addition & 0 deletions airtest/core/ios/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def snapshot(self, filename=None, strType=False, quality=10):
"""
take snapshot
filename: save screenshot to filename
quality: The image quality, integer in range [1, 99]
"""
data = None

Expand Down
1 change: 1 addition & 0 deletions airtest/core/win/win.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def snapshot(self, filename=None, quality=10):
Args:
filename: name of the file to give to the screenshot, {time}.jpg by default
quality: The image quality, integer in range [1, 99]
Returns:
display the screenshot
Expand Down

0 comments on commit 7efc380

Please sign in to comment.