Skip to content

Commit

Permalink
Artresizer: Remove convert_format functions for PIL and IM backends
Browse files Browse the repository at this point in the history
These functions have been replaced by `convert`
  • Loading branch information
mlbaquerizo committed Sep 26, 2024
1 parent e71bad7 commit 90d026a
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions beets/util/artresizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,22 +193,6 @@ def get_format(self, filepath):
# FIXME: Should probably issue a warning?
return None

def convert_format(self, source, target, deinterlaced):
cmd = self.convert_cmd + [
syspath(source),
*(["-interlace", "none"] if deinterlaced else []),
syspath(target),
]

try:
subprocess.check_call(
cmd, stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL
)
return target
except subprocess.CalledProcessError:
# FIXME: Should probably issue a warning?
return source

@property
def can_compare(self):
return self.version() > (6, 8, 7)
Expand Down Expand Up @@ -434,23 +418,6 @@ def get_format(self, filepath):
log.exception("failed to detect image format for {}", filepath)
return None

def convert_format(self, source, target, deinterlaced):
from PIL import Image, UnidentifiedImageError

try:
with Image.open(syspath(source)) as im:
im.save(os.fsdecode(target), progressive=not deinterlaced)
return target
except (
ValueError,
TypeError,
UnidentifiedImageError,
FileNotFoundError,
OSError,
):
log.exception("failed to convert image {} -> {}", source, target)
return source

@property
def can_compare(self):
return False
Expand Down

0 comments on commit 90d026a

Please sign in to comment.