Skip to content

Commit

Permalink
Fixes a few style issues that came up in document text review. [(#871)](
Browse files Browse the repository at this point in the history
GoogleCloudPlatform/python-docs-samples#871)

* Fixes a few style issues that came up in document text review.

* Fixing my breaks
  • Loading branch information
gguuss authored and dpebot committed Mar 22, 2017
1 parent e78b973 commit 2721789
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions samples/snippets/crop_hints/crop_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,11 @@ def draw_hint(image_file):

im = Image.open(image_file)
draw = ImageDraw.Draw(im)
draw.line([vects[0].x_coordinate, vects[0].y_coordinate,
vects[1].x_coordinate, vects[1].y_coordinate],
fill='red', width=3)
draw.line([vects[1].x_coordinate, vects[1].y_coordinate,
vects[2].x_coordinate, vects[2].y_coordinate],
fill='red', width=3)
draw.line([vects[2].x_coordinate, vects[2].y_coordinate,
vects[3].x_coordinate, vects[3].y_coordinate],
fill='red', width=3)
draw.line([vects[3].x_coordinate, vects[3].y_coordinate,
vects[0].x_coordinate, vects[0].y_coordinate],
fill='red', width=3)
draw.polygon([
vects[0].x_coordinate, vects[0].y_coordinate,
vects[1].x_coordinate, vects[1].y_coordinate,
vects[2].x_coordinate, vects[2].y_coordinate,
vects[3].x_coordinate, vects[3].y_coordinate], None, 'red')
im.save('output-hint.jpg', 'JPEG')
# [END draw_hint]

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

im = Image.open(image_file)
im2 = im.crop((vects[0].x_coordinate, vects[0].y_coordinate,
vects[2].x_coordinate - 1, vects[2].y_coordinate - 1))
im2 = im.crop([vects[0].x_coordinate, vects[0].y_coordinate,
vects[2].x_coordinate - 1, vects[2].y_coordinate - 1])
im2.save('output-crop.jpg', 'JPEG')
# [END crop_to_hint]

Expand Down

0 comments on commit 2721789

Please sign in to comment.