Compare commits

..

8 Commits
v1.0.0 ... main

Author SHA1 Message Date
744693a5f1 Update to resolve GHSA-cpwx-vrp4-4pq7
All checks were successful
Release / build (push) Successful in 37s
Release / publish_head (push) Successful in 34s
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 10s
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 15s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 20s
Release / publish_head (release) Has been skipped
Release / build (release) Successful in 36s
2025-03-16 13:11:23 -04:00
102c7a2b94 more fixes
All checks were successful
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 15s
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 15s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 25s
Release / build (push) Successful in 36s
Release / publish_head (push) Successful in 34s
2025-03-15 20:08:29 -04:00
74a010e82a more fixes
All checks were successful
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 15s
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 15s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 25s
Release / build (push) Successful in 36s
Release / publish_head (push) Successful in 34s
2025-03-15 20:03:58 -04:00
23ce3be362 more fixes
All checks were successful
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 14s
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 16s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 24s
Release / build (push) Successful in 35s
Release / publish_head (push) Successful in 35s
2025-03-15 20:01:07 -04:00
f12247b0b1 more fixes
All checks were successful
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 15s
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 14s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 20s
Release / build (push) Successful in 33s
Release / publish_head (push) Successful in 35s
2025-03-15 19:58:45 -04:00
2605f7db37 more fixes
All checks were successful
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 14s
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 15s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 20s
Release / build (push) Successful in 35s
Release / publish_head (push) Successful in 35s
2025-03-15 19:56:40 -04:00
3898a198bd add testing builds
All checks were successful
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 15s
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 15s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 24s
Release / build (push) Successful in 37s
Release / publish_head (push) Successful in 37s
2025-03-15 19:49:12 -04:00
d901f00c1f test fix image rotation
All checks were successful
Datadog Secrets Scanning / Datadog Static Analyzer (push) Successful in 15s
Datadog Software Composition Analysis / Datadog SBOM Generation and Upload (push) Successful in 15s
Datadog Static Analysis / Datadog Static Analyzer (push) Successful in 23s
2025-03-15 19:47:44 -04:00
5 changed files with 49 additions and 15 deletions

View File

@ -3,6 +3,9 @@ name: Release
on: on:
release: release:
types: [published] types: [published]
push:
branches:
- main
jobs: jobs:
build: build:
@ -42,3 +45,28 @@ jobs:
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} 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,6 +8,7 @@ dependencies = [
"bs4>=0.0.2", "bs4>=0.0.2",
"flask>=3.1.0", "flask>=3.1.0",
"gunicorn>=23.0.0", "gunicorn>=23.0.0",
"jinja2>=3.1.6",
"mistune>=3.1.1", "mistune>=3.1.1",
"pillow>=10.4.0", "pillow>=10.4.0",
"python-frontmatter>=1.1.0", "python-frontmatter>=1.1.0",

View File

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

View File

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

20
uv.lock generated
View File

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