def test_autorotate(self): """Autorotate files.""" imageactions.autorotate(self.files) with Image.open(self.filename) as im: orientation = im.size[0] < im.size[1] self.assertFalse(orientation) imageactions.autorotate(self.files, "PIL") with Image.open(self.filename) as im: orientation = im.size[0] < im.size[1] self.assertFalse(orientation)
def test_autorotate(self): """Autorotate files.""" # Method jhead if not shutil.which("jhead"): self.fail("jhead is not installed.") n_rotated, method = imageactions.autorotate(self.files) self.assertEqual(method, "jhead") self.assertEqual(n_rotated, 1) # Method PIL n_rotated, method = imageactions.autorotate([self.filename_2], "PIL") self.assertEqual(method, "PIL") self.assertEqual(n_rotated, 1)
def rotate_auto(self): """Autorotate all pictures in the current pathlist.""" amount, method = imageactions.autorotate(self.app.paths) if amount: self.app["image"].load_image() message = "Autorotated %d image(s) using %s." % (amount, method) else: message = "No image rotated. Tried using %s." % (method) self.app["statusbar"].err_message(message)
def rotate_auto(self): """Autorotate all pictures in the current pathlist.""" amount, method = imageactions.autorotate(self.vimiv.paths) if amount: self.vimiv.image.move_index(True, False, 0) message = "Autorotated %d image(s) using %s." % (amount, method) else: message = "No image rotated. Tried using %s." % (method) self.vimiv.statusbar.err_message(message)
def rotate_auto(self): """Autorotate all pictures in the current pathlist.""" amount, method = imageactions.autorotate(self.app.paths) if amount: self.app["image"].load_image() message = "Autorotated %d image(s) using %s." % (amount, method) else: message = "No image rotated. Tried using %s." % (method) self.app["statusbar"].message(message, "info")