Compare commits
No commits in common. "main" and "v1.0.0" have entirely different histories.
@ -3,9 +3,6 @@ name: Release
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -44,29 +41,4 @@ jobs:
|
||||
context: .
|
||||
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
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user