Skip to content

Commit

Permalink
Update default image settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Nov 24, 2024
1 parent 7483796 commit fba3b0a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Reserved URL characters can be included using escape patterns:

Emojis are also supported, both as characters (👍) and aliases (`:thumbsup:`).

For example, <https://api.memegen.link/images/ugandanknuck/~hspecial_characters~q/underscore__-dash--_:thubsup:.png> produces:
For example, <https://api.memegen.link/images/ugandanknuck/~hspecial_characters~q/underscore__-dash--_:thumbsup:.png> produces:

![Escaped Characters](https://api.memegen.link/images/ugandanknuck/~hspecial_characters~q/underscore__-dash--_%F0%9F%91%8D.png?token=0wzowe01f5oxdtaqz21i)

Expand Down
4 changes: 2 additions & 2 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
ALLOWED_EXTENSIONS = {"gif", "jpg", "jpeg", "png", "webp"}
ANIMATED_EXTENSIONS = {"gif", "webp"}

DEFAULT_STATIC_EXTENSION = os.environ.get("DEFAULT_STATIC_EXTENSION", "png")
DEFAULT_ANIMATED_EXTENSION = os.environ.get("DEFAULT_ANIMATED_EXTENSION", "gif")
DEFAULT_STATIC_EXTENSION = "png"
DEFAULT_ANIMATED_EXTENSION = "webp"

DEFAULT_SUFFIX = "." + DEFAULT_STATIC_EXTENSION
PLACEHOLDER_SUFFIX = ".img"
Expand Down
4 changes: 2 additions & 2 deletions app/tests/test_views_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def it_removes_redundant_styles(expect, client):
"url": "http://localhost:5000/images/iw/foo/bar.png?style=default,test&font=impact"
}

def it_returns_gif_when_animated(expect, client):
def it_returns_webp_when_animated(expect, client):
data = {
"template_id": "iw",
"text_lines[]": ["foo", "bar"],
Expand All @@ -81,7 +81,7 @@ def it_returns_gif_when_animated(expect, client):
request, response = client.post("/images", data=data)
expect(response.status) == 201
expect(response.json) == {
"url": "http://localhost:5000/images/iw/foo/bar.gif"
"url": "http://localhost:5000/images/iw/foo/bar.webp"
}

def it_prefers_extension_over_animated_style(expect, client):
Expand Down

0 comments on commit fba3b0a

Please sign in to comment.