Skip to content

Commit f013ccf

Browse files
committed
image_cropper made changes to style
1 parent 66ac52d commit f013ccf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

image_cropper/image_cropper.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# Importing Image class from PIL module
22
from PIL import Image
33

4+
45
def crop():
5-
# Taking the image path as an input
6+
# Taking the image path as an input
67
file_path = str(input('Enter the image path (absolute path): '))
78

89
# Opening image with an RGB mode, works only with jpeg/jpg formats
910
img = Image.open(file_path, mode="r")
1011

1112
# Calculating size of the original image in pixels for reference
1213
width, height = img.size
13-
print('the old width is: ' + str(width) + ' and the old height is: '+ str(height))
14+
print('the old width is: ' + str(width) + ' and the old height is: ' + str(height))
1415

1516
# Taking left, top, right, bottom points for the cropped image as input
1617
# Image pixels coorginate grid: X increases from left to right, Y increases from top to bottom
@@ -29,5 +30,6 @@ def crop():
2930
# Show the image in the image viewer
3031
cropped_img.show()
3132

33+
3234
if __name__ == '__main__':
33-
crop()
35+
crop()

0 commit comments

Comments
 (0)