Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
102c7a2b94 | |||
74a010e82a | |||
23ce3be362 | |||
f12247b0b1 | |||
2605f7db37 | |||
3898a198bd | |||
d901f00c1f |
@ -3,6 +3,9 @@ name: Release
|
|||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -41,4 +44,29 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
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
|
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user