Skip to content

Commit 27ac1bb

Browse files
authored
Use magick command to convert images with ImageMagick (#1480)
1 parent 87f00b0 commit 27ac1bb

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

.circleci/config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ jobs:
1818
name: Install Package Dependencies
1919
command: |
2020
sudo apt-get update
21-
sudo apt-get install -y imagemagick texlive-latex-base
21+
sudo apt-get install -y texlive-latex-base
22+
sudo wget https://imagemagick.org/archive/binaries/magick
23+
sudo cp magick /usr/local/bin
24+
sudo chmod 777 /usr/local/bin/magick
2225
sudo dpkg --remove --force-remove-reinstreq nodejs
2326
stack update
2427

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
- Added test cases for the index function in `Controllers/Course`
3535
- Refactored the class components in `/grid` folder to function components
3636
- Update stylelint integration with development environment and fix existing stylelint violations
37+
- Use `magick` command instead of `convert` when serving graph images
3738

3839
## [0.6.0] - 2024-06-24
3940

Setup.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ main = defaultMainWithHooks
99
where
1010
-- | Checks that Imagemagick and LaTeX are available
1111
preBuildChecks _ _ = do
12-
mapM_ checkDependency ["convert", "pdflatex"]
12+
mapM_ checkDependency ["magick", "pdflatex"]
1313
return emptyHookedBuildInfo
1414

1515
checkDependency :: String -> IO ()

app/Export/ImageConversion.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ convertToImage :: String -> String -> IO
2626
Maybe Handle,
2727
ProcessHandle)
2828
convertToImage inName outName =
29-
createProcess $ shell $ "convert " ++ inName ++ " " ++ outName
29+
createProcess $ shell $ "magick " ++ inName ++ " " ++ outName

app/Svg/Parser.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ parseTextHelper key styles' trans textTags =
193193
newTrans = matrixMultiply trans currTrans
194194
alignAttr = styleVal "text-anchor" newStyle
195195
align = if T.null alignAttr
196-
then "begin"
196+
then "start"
197197
else alignAttr
198198
fill = styleVal "fill" newStyle
199199

0 commit comments

Comments
 (0)