Skip to content

Commit 1d11825

Browse files
committed
try fixing CI failures
1 parent cedea04 commit 1d11825

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

Project.toml

+2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ version = "1.2.2"
44

55
[deps]
66
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
7+
Ghostscript_jll = "61579ee1-b43e-5ca0-a5da-69d92c66a64b"
78
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
89
ImageMagick_jll = "c73af94c-d91f-53ed-93a7-00f77d67a9d7"
910
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1011

1112
[compat]
1213
FileIO = "1"
14+
Ghostscript_jll = "= 9.55.0"
1315
ImageCore = "0.8.1, 0.9"
1416
ImageMagick_jll = "= 6.9.10"
1517
julia = "1.3"

src/ImageMagick.jl

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ using InteractiveUtils: subtypes
55
using ImageCore
66
using ImageMagick_jll
77
using Base: convert
8+
using Ghostscript_jll
89

910
Color1{T} = Color{T,1}
1011
Color2{T,C<:Color1} = TransparentColor{C,T,2}

src/libmagickwand.jl

+10-4
Original file line numberDiff line numberDiff line change
@@ -269,25 +269,31 @@ function pingimage(wand::MagickWand, filename::AbstractString)
269269
nothing
270270
end
271271

272-
function readimage(wand::MagickWand, filename::AbstractString)
272+
function readimage(wand::MagickWand, from)
273+
withenv("PATH" => "$(Ghostscript_jll.PATH[]):$(ENV["PATH"])") do
274+
_readimage(wand, from)
275+
end
276+
end
277+
278+
function _readimage(wand::MagickWand, filename::AbstractString)
273279
status = ccall((:MagickReadImage, libwand), Cint, (Ptr{Cvoid}, Ptr{UInt8}), wand, filename)
274280
status == 0 && error(wand)
275281
nothing
276282
end
277283

278-
function readimage(wand::MagickWand, stream::IO)
284+
function _readimage(wand::MagickWand, stream::IO)
279285
status = ccall((:MagickReadImageFile, libwand), Cint, (Ptr{Cvoid}, Ptr{Cvoid}), wand, Libc.FILE(stream).ptr)
280286
status == 0 && error(wand)
281287
nothing
282288
end
283289

284-
function readimage(wand::MagickWand, stream::Vector{UInt8})
290+
function _readimage(wand::MagickWand, stream::Vector{UInt8})
285291
status = ccall((:MagickReadImageBlob, libwand), Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Cint), wand, stream, length(stream)*sizeof(eltype(stream)))
286292
status == 0 && error(wand)
287293
nothing
288294
end
289295

290-
readimage(wand::MagickWand, stream::IOBuffer) = readimage(wand, stream.data)
296+
_readimage(wand::MagickWand, stream::IOBuffer) = readimage(wand, stream.data)
291297

292298
function writeimage(wand::MagickWand, filename::AbstractString)
293299
status = ccall((:MagickWriteImages, libwand), Cint, (Ptr{Cvoid}, Ptr{UInt8}, Cint), wand, filename, true)

0 commit comments

Comments
 (0)