Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: don't try to resize small images #689

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions .github/workflows/optimizeImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ jobs:
- name: Install imagemagick
run: sudo apt install imagemagick

- name: Optimize image
run: "convert image.png -depth 7 -resize 256x -posterize 24 output.png"

# - name: Further compress image
# run: "??? still need to figure out how to do this without imageoptim"
- name: Check image size and optimize if necessary
run: |
should_optimize=$(identify -format "%[fx:w>256 && h>256]" image.png)

if [ "$should_optimize" = "1" ]; then
echo "Optimizing image"
convert image.png -depth 7 -resize 256x -posterize 24 output.png
else
echo "Image is already small enough, moving to output.png"
mv image.png output.png
fi

- name: Upload img
uses: actions/upload-artifact@v3
Expand All @@ -46,9 +52,9 @@ jobs:
with:
comment: |
Failed to optimize image

Check you provided a proper image file and try again in a new issue

If the issue persists, create a bug report
cc @cowprotocol/frontend

cc @cowprotocol/frontend
Loading