@@ -0,0 +1,1223 @@
+#-------------------------------------------------------------------------------%0A# Name:        module1%0A# Purpose:%0A#%0A# Author:      MITESH%0A#%0A# Created:     25-12-2015%0A# Copyright:   (c) MITESH 2015%0A# Licence:     %3Cyour licence%3E%0A#-------------------------------------------------------------------------------%0A%0Aimport os%0Aimport PIL%0Aimport PIL.Image%0Aimport PIL.ImageDraw%0A%0Adef process():%0A    image_source_path = 'D:%5C%5Cmitesh%5C%5CPics%5C%5C'%0A    image_target_path =  'D:%5C%5Cmitesh%5C%5CPics%5C%5Ct%5C%5C'%0A%0A    i = 1%0A    # Get all image files%0A    image_files = %5Bf for f in os.listdir(image_source_path) if os.path.splitext(f)%5B1%5D == '.jpg' %5D%0A    for fn in image_files:%0A        fp = image_source_path + fn%0A        img = PIL.Image.open(fp)%0A        draw = PIL.ImageDraw.Draw(img)%0A%0A        if img.width %3E img.height:%0A            # Landscape%0A%0A            x = img.width / 2%0A            y = img.height - 20%0A        else:%0A            # Portrait%0A%0A            x = img.height / 2%0A            y = img.width - 20%0A%0A%0A        draw.text((x, y), 'File ' + str(i))%0A        img.save(image_target_path + fn)%0A        i = i + 1%0A%0A        print('File Name: %7B0%7D - %7B1%7D X %7B2%7D'.format(fn, img.width, img.height))%0A%0A%0Adef main():%0A    process()%0A%0Aif __name__ == '__main__':%0A    main()%0A

Create WriteImageName.py