Skip to content

Commit 1559473

Browse files
authored
Add files via upload
1 parent 049ab21 commit 1559473

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

project1.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,34 @@ def operation_resize(filename,resize0,resize1):
4343
myimage = Image.open(filename)
4444
resizedImage = myimage.resize((resize0, resize1))
4545
resizedImage.save('resized.png')
46-
shutil.copy('resized.png','processed')
46+
shutil.copy({join('resized.',filename)},'processed')
4747

4848
def operation_crop(filename,crop0,crop1):
4949

5050
myimage = Image.open(argv.filename)
5151
croppedIm = myimage.crop((imagesize[0], imagesize[1], crop0, crop1))
5252
croppedIm.save('cropped.png')
53-
shutil.copy('cropped.png','processed')
53+
shutil.copy({join('cropped.',filename)},'processed')
5454

5555
def operation_sign(filename,sign):
5656

5757
CopyIm = filename.copy()
5858
// crCopyIm = CopyIm.crop((500, 500, 900, 900))
5959
CopyIm.paste(sign, (300, 300))
6060
CopyIm.save('signed.png')
61-
shutil.copy('signed.png','processed')
61+
shutil.copy({join('signed.',filename)},'processed')
6262

6363
def operation_rotate(filename,rotate):
6464

6565
myimage = Image.open(filename)
66-
rotatedImage=myimage.rotate)
66+
rotatedImage=myimage(rotate)
6767
rotatedImage.save('rotated.png')
68-
shutil.copy('rotated.png','processed')
68+
shutil.copy({join('rotated.',filename)},'processed')
6969

70-
7170

7271

7372
# Checks input to see if input is a file or a directory, if it is a directory, processes it.
73+
queue = []
7474

7575
if os.path.isdir(argv.filename):
7676
filepart = os.path.splitext(argv.filename)
@@ -80,9 +80,11 @@ def operation_rotate(filename,rotate):
8080
os.system('tar -xvf {argv.filename}')
8181

8282
# helpme = argv.filename
83-
for file in glob.glob("{argv.filename}/*.png"):
84-
shutil.copy(file, '.')
83+
for file in glob.glob("{argv.filename}/*.png"):
84+
shutil.copy(file, '.')
8585

86+
else:
87+
queue.append(argv.filename)
8688

8789
# Function Call
8890

0 commit comments

Comments
 (0)