8000 fix: update blur function to match other samples (#13293) · yan283/python-docs-samples@47d7704 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47d7704

Browse files
authored
fix: update blur function to match other samples (GoogleCloudPlatform#13293)
* fix: update blur function to match other samples * update tests to check for updated method
1 parent 8725706 commit 47d7704

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

functions/imagemagick/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __blur_image(current_blob):
7070

7171
# Blur the image using ImageMagick.
7272
with Image(filename=temp_local_filename) as image:
73-
image.resize(*image.size, blur=16, filter="hamming")
73+
image.blur(radius=0, sigma=16)
7474
image.save(filename=temp_local_filename)
7575

7676
print(f"Image {file_name} was blurred.")

functions/imagemagick/main_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ def test_blur_image(storage_client, image_mock, os_mock, capsys):
9292
assert f"Image {filename} was blurred." in out
9393
assert f"Blurred image uploaded to: gs://{blur_bucket}/{filename}" in out
9494
assert os_mock.remove.called
95-
assert image_mock.resize.called
95+
assert image_mock.blur.called

functions/v2/imagemagick/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __blur_image(current_blob):
7373

7474
# Blur the image using ImageMagick.
7575
with Image(filename=temp_local_filename) as image:
76-
image.resize(*image.size, blur=16, filter="hamming")
76+
image.blur(radius=0, sigma=16)
7777
image.save(filename=temp_local_filename)
7878

7979
print(f"Image {file_name} was blurred.")

functions/v2/imagemagick/main_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ def test_blur_image(storage_client, image_mock, os_mock, capsys):
9696
assert f"Image {filename} was blurred." in out
9797
assert f"Blurred image uploaded to: gs://{blur_bucket}/{filename}" in out
9898
assert os_mock.remove.called
99-
assert image_mock.resize.called
99+
assert image_mock.blur.called

0 commit comments

Comments
 (0)
0