degal/render.py
changeset 77 2a53c5ade434
parent 57 8d06e0283b88
equal deleted inserted replaced
76:e22d9f699081 77:2a53c5ade434
    24 
    24 
    25             Returns the file for convenience
    25             Returns the file for convenience
    26         """
    26         """
    27 
    27 
    28         # load the PIL.Image
    28         # load the PIL.Image
    29         img = image.load_image()
    29         img = image.image
    30 
    30 
    31         # we need to create a copy, as .thumbnail mutates the Image
    31         # we need to create a copy, as .thumbnail mutates the Image
    32         img_out = img.copy()
    32         img_out = img.copy()
    33 
    33 
    34         # then resample to given size
    34         # then resample to given size
    46 
    46 
    47         # stat the output file
    47         # stat the output file
    48         out_stat = out.stat(soft=True)
    48         out_stat = out.stat(soft=True)
    49 
    49 
    50         # compare
    50         # compare
    51         if not out_stat or out_stat.st_mtime < image.load_stat().st_mtime :
    51         if not out_stat or out_stat.st_mtime < image.stat.st_mtime :
    52             # render anew
    52             # render anew
    53             return self.render_out(image, size, file)
    53             return self.render_out(image, size, out)
    54 
    54 
    55         else :
    55         else :
    56             # already rendered
    56             # already rendered
    57             return file
    57             return out