diff --git a/1ano/2semestre/labi/tema07/images/ua-0.20.jpg b/1ano/2semestre/labi/tema07/images/ua-0.20.jpg new file mode 100644 index 0000000..6a3b3da Binary files /dev/null and b/1ano/2semestre/labi/tema07/images/ua-0.20.jpg differ diff --git a/1ano/2semestre/labi/tema07/images/ua-8.00.jpg b/1ano/2semestre/labi/tema07/images/ua-8.00.jpg new file mode 100644 index 0000000..8f8fa64 Binary files /dev/null and b/1ano/2semestre/labi/tema07/images/ua-8.00.jpg differ diff --git a/1ano/2semestre/labi/tema07/images/ua.jpg-0.20.jpg b/1ano/2semestre/labi/tema07/images/ua.jpg-0.20.jpg new file mode 100644 index 0000000..6a3b3da Binary files /dev/null and b/1ano/2semestre/labi/tema07/images/ua.jpg-0.20.jpg differ diff --git a/1ano/2semestre/labi/tema07/images/ua.jpg-8.00.jpg b/1ano/2semestre/labi/tema07/images/ua.jpg-8.00.jpg new file mode 100644 index 0000000..8f8fa64 Binary files /dev/null and b/1ano/2semestre/labi/tema07/images/ua.jpg-8.00.jpg differ diff --git a/1ano/2semestre/labi/tema07/src/ex1.py b/1ano/2semestre/labi/tema07/src/ex1.py new file mode 100644 index 0000000..5eff656 --- /dev/null +++ b/1ano/2semestre/labi/tema07/src/ex1.py @@ -0,0 +1,22 @@ +from PIL import Image, ExifTags +import sys + + +def main(fname): + img = Image.open(fname) + + width, height = img.size + + print("Width: %dpx" % width) + print("Height: %dpx" % height) + print("Format: %s" % img.format) + + tags = img._getexif() + + for tag, value in tags.items(): + decoded = ExifTags.TAGS.get(tag, tag) + print("%s: %s" % (decoded, value)) + + +if __name__ == '__main__': + main(sys.argv[1]) diff --git a/1ano/2semestre/labi/tema07/src/ex2.py b/1ano/2semestre/labi/tema07/src/ex2.py new file mode 100644 index 0000000..e0e4d09 --- /dev/null +++ b/1ano/2semestre/labi/tema07/src/ex2.py @@ -0,0 +1,18 @@ +from PIL import Image, ExifTags +import sys + + +def main(file): + img = Image.open(file) + fname = '.'.join(file.split(".")[:-1]), file.split(".")[-1] + + width, height = img.size + + for s in [0.2, 8]: + dimension = (int(width * s), int(height * s)) + new_img = img.resize(dimension, Image.NEAREST) + new_img.save(fname[0]+"-%.2f.%s" % (s, fname[1])) + + +if __name__ == '__main__': + main(sys.argv[1])