From 5b6bac9b3f8186dc09550c99ec2ff57f73c43bab Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 18 Feb 2015 17:03:34 +0000 Subject: [PATCH] Removed prefixes from operation function names --- willow/backends/opencv.py | 2 +- willow/backends/pillow.py | 16 ++++++++-------- willow/backends/wand.py | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/willow/backends/opencv.py b/willow/backends/opencv.py index ca7a675..b9f38ba 100644 --- a/willow/backends/opencv.py +++ b/willow/backends/opencv.py @@ -44,7 +44,7 @@ def check(cls): @OpenCVBackend.register_operation('detect_features') -def opencv_detect_features(backend): +def detect_features(backend): cv = backend.get_opencv() image = backend.opencv_grey_image() diff --git a/willow/backends/pillow.py b/willow/backends/pillow.py index 62191c9..c088b53 100644 --- a/willow/backends/pillow.py +++ b/willow/backends/pillow.py @@ -42,12 +42,12 @@ def check(cls): @PillowBackend.register_operation('get_size') -def pillow_get_size(backend): +def get_size(backend): return backend.image.size @PillowBackend.register_operation('resize') -def pillow_resize(backend, width, height): +def resize(backend, width, height): if backend.image.mode in ['1', 'P']: backend.image = backend.image.convert('RGB') @@ -56,12 +56,12 @@ def pillow_resize(backend, width, height): @PillowBackend.register_operation('crop') -def pillow_crop(backend, left, top, right, bottom): +def crop(backend, left, top, right, bottom): backend.image = backend.image.crop((left, top, right, bottom)) @PillowBackend.register_operation('save_as_jpeg') -def pillow_save_as_jpeg(backend, f, quality=85): +def save_as_jpeg(backend, f, quality=85): if backend.image.mode in ['1', 'P']: backend.image = backend.image.convert('RGB') @@ -69,22 +69,22 @@ def pillow_save_as_jpeg(backend, f, quality=85): @PillowBackend.register_operation('save_as_png') -def pillow_save_as_png(backend, f): +def save_as_png(backend, f): backend.image.save(f, 'PNG') @PillowBackend.register_operation('has_alpha') -def pillow_has_alpha(backend): +def has_alpha(backend): img = backend.image return img.mode in ('RGBA', 'LA') or (img.mode == 'P' and 'transparency' in img.info) @PillowBackend.register_operation('has_animation') -def pillow_has_animation(backend): +def has_animation(backend): # Animation not supported by PIL return False @PillowBackend.register_operation('get_pillow_image') -def pillow_get_pillow_image(backend): +def get_pillow_image(backend): return backend.image.copy() \ No newline at end of file diff --git a/willow/backends/wand.py b/willow/backends/wand.py index ed932e1..3eea4a9 100644 --- a/willow/backends/wand.py +++ b/willow/backends/wand.py @@ -42,30 +42,30 @@ def check(cls): @WandBackend.register_operation('get_size') -def wand_get_size(backend): +def get_size(backend): return backend.image.size @WandBackend.register_operation('resize') -def wand_resize(backend, width, height): +def resize(backend, width, height): backend.image.resize(width, height) @WandBackend.register_operation('crop') -def wand_crop(backend, left, top, right, bottom): +def crop(backend, left, top, right, bottom): backend.image.crop(left=left, top=top, right=right, bottom=bottom) @WandBackend.register_operation('has_alpha') -def wand_has_alpha(backend): +def has_alpha(backend): return backend.image.alpha_channel @WandBackend.register_operation('has_animation') -def wand_has_animation(backend): +def has_animation(backend): return backend.image.animation @WandBackend.register_operation('get_wand_image') -def wand_get_wand_image(backend): +def get_wand_image(backend): return backend.image.clone()