Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
102c7a2b94 | |||
74a010e82a | |||
23ce3be362 | |||
f12247b0b1 | |||
2605f7db37 | |||
3898a198bd | |||
d901f00c1f |
@ -3,6 +3,9 @@ name: Release
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -41,4 +44,29 @@ jobs:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
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
|
@ -30,15 +30,16 @@ 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(270, expand=True)
|
||||
img = img.rotate(0, expand=True)
|
||||
elif orientation == 8:
|
||||
img = img.rotate(90, expand=True)
|
||||
img = img.rotate(180, expand=True)
|
||||
except (AttributeError, KeyError, IndexError):
|
||||
# cases: image don't have getexif
|
||||
exif = None
|
||||
exif = b""
|
||||
|
||||
# Save the thumbnail to a BytesIO object
|
||||
thumbnail_io = BytesIO()
|
||||
|
Loading…
x
Reference in New Issue
Block a user