Fix ImageMagick incompatibility on CI

This commit is contained in:
David Eisinger
2024-02-02 00:18:25 -05:00
parent b04f3db116
commit 59b3527730
3 changed files with 10 additions and 14 deletions

View File

@@ -35,11 +35,6 @@ jobs:
KEY: ${{ github.workspace }}/secret.key KEY: ${{ github.workspace }}/secret.key
run: cd bin/dither && bundle exec ruby dither.rb >> dither.log 2>&1 & run: cd bin/dither && bundle exec ruby dither.rb >> dither.log 2>&1 &
- name: Install ImageMagick
run: |
sudo apt update
sudo apt install imagemagick
- name: Test build - name: Test build
env: env:
DITHER_SERVER: http://localhost:4567 DITHER_SERVER: http://localhost:4567

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
public public
resources/_gen resources/_gen
secret.key secret.key
bin/dither/tmp

View File

@@ -25,15 +25,15 @@ get "/*" do |path|
-iter 1000000 -iter 1000000
) )
MiniMagick::Tool::Magick.new do |magick| convert = MiniMagick::Tool::Convert.new
magick << @decrypted.path convert << @decrypted.path
magick.resize "#{geometry}^" convert.resize "#{geometry}^"
magick.gravity "center" convert.gravity "center"
magick.extent geometry convert.extent geometry
magick.ordered_dither "o8x8" convert.ordered_dither "o8x8"
magick.monochrome convert.monochrome
magick << @dithered.path convert << @dithered.path
end convert.call
content_type "image/png" content_type "image/png"
File.open(@dithered.path) File.open(@dithered.path)