Compare commits

..

No commits in common. "main" and "v1.0.0" have entirely different histories.
main ... v1.0.0

5 changed files with 15 additions and 49 deletions

View File

@ -3,9 +3,6 @@ name: Release
on:
release:
types: [published]
push:
branches:
- main
jobs:
build:
@ -45,28 +42,3 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
publish_head:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Gitea Container Registry
uses: docker/login-action@v2
with:
registry: git.dws.rip
username: ${{ github.actor }}
password: ${{ secrets.GLOBAL_KEY }}
- name: Build and push "head" image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: git.dws.rip/${{ github.repository }}:head

View File

@ -8,7 +8,6 @@ dependencies = [
"bs4>=0.0.2",
"flask>=3.1.0",
"gunicorn>=23.0.0",
"jinja2>=3.1.6",
"mistune>=3.1.1",
"pillow>=10.4.0",
"python-frontmatter>=1.1.0",

View File

@ -16,10 +16,8 @@ gunicorn==23.0.0
# via foldsite (pyproject.toml)
itsdangerous==2.2.0
# via flask
jinja2==3.1.6
# via
# foldsite (pyproject.toml)
# flask
jinja2==3.1.5
# via flask
markdown-it-py==3.0.0
# via rich
markupsafe==3.0.2

View File

@ -30,16 +30,15 @@ def generate_thumbnail(image_path, resize_percent, min_width, max_width):
try:
exif = img.info['exif']
orientation = img._getexif().get(0x0112, 1) # 0x0112 is the EXIF orientation tag
print(f"EXIF orientation: {orientation}, {image_path}")
if orientation == 3:
img = img.rotate(180, expand=True)
elif orientation == 6:
img = img.rotate(0, expand=True)
img = img.rotate(270, expand=True)
elif orientation == 8:
img = img.rotate(180, expand=True)
img = img.rotate(90, expand=True)
except (AttributeError, KeyError, IndexError):
# cases: image don't have getexif
exif = b""
exif = None
# Save the thumbnail to a BytesIO object
thumbnail_io = BytesIO()

20
uv.lock generated
View File

@ -81,7 +81,6 @@ dependencies = [
{ name = "bs4" },
{ name = "flask" },
{ name = "gunicorn" },
{ name = "jinja2" },
{ name = "mistune" },
{ name = "pillow" },
{ name = "python-frontmatter" },
@ -95,7 +94,6 @@ requires-dist = [
{ name = "bs4", specifier = ">=0.0.2" },
{ name = "flask", specifier = ">=3.1.0" },
{ name = "gunicorn", specifier = ">=23.0.0" },
{ name = "jinja2", specifier = ">=3.1.6" },
{ name = "mistune", specifier = ">=3.1.1" },
{ name = "pillow", specifier = ">=10.4.0" },
{ name = "python-frontmatter", specifier = ">=1.1.0" },
@ -127,14 +125,14 @@ wheels = [
[[package]]
name = "jinja2"
version = "3.1.6"
version = "3.1.5"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "markupsafe" },
]
sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115 }
sdist = { url = "https://files.pythonhosted.org/packages/af/92/b3130cbbf5591acf9ade8708c365f3238046ac7cb8ccba6e81abccb0ccff/jinja2-3.1.5.tar.gz", hash = "sha256:8fefff8dc3034e27bb80d67c671eb8a9bc424c0ef4c0826edbff304cceff43bb", size = 244674 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899 },
{ url = "https://files.pythonhosted.org/packages/bd/0f/2ba5fbcd631e3e88689309dbe978c5769e883e4b84ebfe7da30b43275c5a/jinja2-3.1.5-py3-none-any.whl", hash = "sha256:aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb", size = 134596 },
]
[[package]]
@ -188,11 +186,11 @@ wheels = [
[[package]]
name = "mistune"
version = "3.1.2"
version = "3.1.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/80/f7/f6d06304c61c2a73213c0a4815280f70d985429cda26272f490e42119c1a/mistune-3.1.2.tar.gz", hash = "sha256:733bf018ba007e8b5f2d3a9eb624034f6ee26c4ea769a98ec533ee111d504dff", size = 94613 }
sdist = { url = "https://files.pythonhosted.org/packages/c6/1d/6b2b634e43bacc3239006e61800676aa6c41ac1836b2c57497ed27a7310b/mistune-3.1.1.tar.gz", hash = "sha256:e0740d635f515119f7d1feb6f9b192ee60f0cc649f80a8f944f905706a21654c", size = 94645 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/12/92/30b4e54c4d7c48c06db61595cffbbf4f19588ea177896f9b78f0fbe021fd/mistune-3.1.2-py3-none-any.whl", hash = "sha256:4b47731332315cdca99e0ded46fc0004001c1299ff773dfb48fbe1fd226de319", size = 53696 },
{ url = "https://files.pythonhosted.org/packages/c6/02/c66bdfdadbb021adb642ca4e8a5ed32ada0b4a3e4b39c5d076d19543452f/mistune-3.1.1-py3-none-any.whl", hash = "sha256:02106ac2aa4f66e769debbfa028509a275069dcffce0dfa578edd7b991ee700a", size = 53696 },
]
[[package]]
@ -307,7 +305,7 @@ wheels = [
[[package]]
name = "typer"
version = "0.15.2"
version = "0.15.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "click" },
@ -315,9 +313,9 @@ dependencies = [
{ name = "shellingham" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/8b/6f/3991f0f1c7fcb2df31aef28e0594d8d54b05393a0e4e34c65e475c2a5d41/typer-0.15.2.tar.gz", hash = "sha256:ab2fab47533a813c49fe1f16b1a370fd5819099c00b119e0633df65f22144ba5", size = 100711 }
sdist = { url = "https://files.pythonhosted.org/packages/cb/ce/dca7b219718afd37a0068f4f2530a727c2b74a8b6e8e0c0080a4c0de4fcd/typer-0.15.1.tar.gz", hash = "sha256:a0588c0a7fa68a1978a069818657778f86abe6ff5ea6abf472f940a08bfe4f0a", size = 99789 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/7f/fc/5b29fea8cee020515ca82cc68e3b8e1e34bb19a3535ad854cac9257b414c/typer-0.15.2-py3-none-any.whl", hash = "sha256:46a499c6107d645a9c13f7ee46c5d5096cae6f5fc57dd11eccbbb9ae3e44ddfc", size = 45061 },
{ url = "https://files.pythonhosted.org/packages/d0/cc/0a838ba5ca64dc832aa43f727bd586309846b0ffb2ce52422543e6075e8a/typer-0.15.1-py3-none-any.whl", hash = "sha256:7994fb7b8155b64d3402518560648446072864beefd44aa2dc36972a5972e847", size = 44908 },
]
[[package]]