Subversion Repositories SmartDukaan

Rev

Rev 12968 | Rev 13096 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12968 Rev 12975
Line 12... Line 12...
12
    if os.path.isdir(os.path.join("./", dir)):
12
    if os.path.isdir(os.path.join("./", dir)):
13
        infile = dir + "/" + sys.argv[1]
13
        infile = dir + "/" + sys.argv[1]
14
        if not os.path.isfile(infile):
14
        if not os.path.isfile(infile):
15
            shutil.copy2(default_image, infile)
15
            shutil.copy2(default_image, infile)
16
        outfile = dir + "/" + sys.argv[2]
16
        outfile = dir + "/" + sys.argv[2]
17
        if not os.path.isfile(outfile) and os.path.getmtime(outfile) < os.path.getmtime(infile):
17
        if not (os.path.isfile(outfile) and os.path.getmtime(outfile) < os.path.getmtime(infile)):
18
            width = int(sys.argv[3])
18
            width = int(sys.argv[3])
19
            height = int(sys.argv[4])
19
            height = int(sys.argv[4])
20
            size = width, height
20
            size = width, height
21
            im = Image.open(infile)
21
            im = Image.open(infile)
22
            im.thumbnail(size, Image.ANTIALIAS)
22
            im.thumbnail(size, Image.ANTIALIAS)