Skip to content

Commit

Permalink
Merge pull request #23 from NaturalHistoryMuseum/josh/remove_jpeg_option
Browse files Browse the repository at this point in the history
Remove jpeg option
  • Loading branch information
jrdh authored May 16, 2022
2 parents 9f54c8f + ebe72f4 commit dfaa73a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
11 changes: 4 additions & 7 deletions iiif/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,11 @@ def parse_quality(quality: str) -> Quality:


class Format(Enum):
jpg = ('jpg', 'jpeg')
png = ('png',)

def matches(self, value: str) -> bool:
return value in self.value
jpg = 'jpg'
png = 'png'

def __str__(self) -> str:
return self.value[0]
return self.value


def parse_format(fmt: str) -> Format:
Expand All @@ -242,7 +239,7 @@ def parse_format(fmt: str) -> Format:
:return: a Format
"""
for option in Format:
if option.matches(fmt):
if fmt == option.value:
return option

raise InvalidIIIFParameter('Format', fmt)
Expand Down
3 changes: 0 additions & 3 deletions tests/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ class TestParseFormat:
def test_level0(self):
assert parse_format('jpg') == Format.jpg

def test_level0(self):
assert parse_format('jpeg') == Format.jpg

def test_level2_png(self):
assert parse_format('png') == Format.png

Expand Down

0 comments on commit dfaa73a

Please sign in to comment.