Use open file as wb mode for saving binaries
MODIFY
docs/en/writing-running-appium/image-comparison.md
docs/en/writing-running-appium/image-comparison.md
@@ -55,7 +55,7 @@ assert_equal %w(points1 rect1 points2 rect2 totalCount count), match_result.keys
match_result_visual = @driver.match_images_features first_image: image1, second_image: image2, visualize: true
assert_equal %w(points1 rect1 points2 rect2 totalCount count visualization), match_result_visual.keys
-File.write 'match_result_visual.png', Base64.decode64(match_result_visual['visualization'])
+File.open('match_result_visual.png', 'wb') { |f| f<< Base64.decode64(match_result_visual['visualization']) }
assert File.size? 'match_result_visual.png'
```
@@ -93,7 +93,7 @@ assert_equal({ 'rect' => { 'x' => 0, 'y' => 0, 'width' => 750, 'height' => 1334
find_result_visual = @driver.find_image_occurrence full_image: image1, partial_image: image2, visualize: true
assert_equal %w(rect visualization), find_result_visual.keys
-File.write 'find_result_visual.png', Base64.decode64(find_result_visual['visualization'])
+File.open('find_result_visual.png', 'wb') { |f| f<< Base64.decode64(find_result_visual['visualization']) }
assert File.size? 'find_result_visual.png'
```
@@ -133,7 +133,7 @@ assert_equal({ 'score' => 0.891606867313385 }, get_images_result)
get_images_result_visual = @driver.get_images_similarity first_image: image1, second_image: image2, visualize: true
assert_equal %w(score visualization), get_images_result_visual.keys
-File.write 'get_images_result_visual.png', Base64.decode64(get_images_result_visual['visualization'])
+File.open('get_images_result_visual.png', 'wb') { |f| f<< Base64.decode64(get_images_result_visual['visualization']) }
assert File.size? 'get_images_result_visual.png'
```

Use open file as wb mode for saving binaries (#12632)