Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f9c32f1

Browse filesBrowse files
gguussdpebot
authored andcommitted
Fixes a few style issues that came up in document text review. (GoogleCloudPlatform#871)
* Fixes a few style issues that came up in document text review. * Fixing my breaks
1 parent ba737c3 commit f9c32f1
Copy full SHA for f9c32f1

File tree

Expand file treeCollapse file tree

1 file changed

+7
-14
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-14
lines changed

‎vision/cloud-client/crop_hints/crop_hints.py

Copy file name to clipboardExpand all lines: vision/cloud-client/crop_hints/crop_hints.py
+7-14Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,11 @@ def draw_hint(image_file):
5252

5353
im = Image.open(image_file)
5454
draw = ImageDraw.Draw(im)
55-
draw.line([vects[0].x_coordinate, vects[0].y_coordinate,
56-
vects[1].x_coordinate, vects[1].y_coordinate],
57-
fill='red', width=3)
58-
draw.line([vects[1].x_coordinate, vects[1].y_coordinate,
59-
vects[2].x_coordinate, vects[2].y_coordinate],
60-
fill='red', width=3)
61-
draw.line([vects[2].x_coordinate, vects[2].y_coordinate,
62-
vects[3].x_coordinate, vects[3].y_coordinate],
63-
fill='red', width=3)
64-
draw.line([vects[3].x_coordinate, vects[3].y_coordinate,
65-
vects[0].x_coordinate, vects[0].y_coordinate],
66-
fill='red', width=3)
55+
draw.polygon([
56+
vects[0].x_coordinate, vects[0].y_coordinate,
57+
vects[1].x_coordinate, vects[1].y_coordinate,
58+
vects[2].x_coordinate, vects[2].y_coordinate,
59+
vects[3].x_coordinate, vects[3].y_coordinate], None, 'red')
6760
im.save('output-hint.jpg', 'JPEG')
6861
# [END draw_hint]
6962

@@ -74,8 +67,8 @@ def crop_to_hint(image_file):
7467
vects = get_crop_hint(image_file)
7568

7669
im = Image.open(image_file)
77-
im2 = im.crop((vects[0].x_coordinate, vects[0].y_coordinate,
78-
vects[2].x_coordinate - 1, vects[2].y_coordinate - 1))
70+
im2 = im.crop([vects[0].x_coordinate, vects[0].y_coordinate,
71+
vects[2].x_coordinate - 1, vects[2].y_coordinate - 1])
7972
im2.save('output-crop.jpg', 'JPEG')
8073
# [END crop_to_hint]
8174

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.