Example #1
0
    def test_auto_crop3(self):
        file = files_paths[4]
        fs.unlink(root_path + file[1])

        image = PilImage.open(root_path + file[0])
        sizes = image.size
        image.close()

        img = Image(root_path + file[0])
        img.crop_auto(root_path + file[1])
        img.close()

        cropped_image = PilImage.open(root_path + file[1])
        cropped_sizes = cropped_image.size
        cropped_image.close()

        self.assertTrue(sizes[0] == (2 + cropped_sizes[0]))  # 2px black line
Example #2
0
 def image_auto_crop(src_path, dest_path=None):
     image = Image(src_path=src_path)
     image.crop_auto(dest_path=dest_path)
     image.close()