@@ -269,25 +269,31 @@ function pingimage(wand::MagickWand, filename::AbstractString)
269269 nothing
270270end
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
276282end
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
282288end
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
288294end
289295
290- readimage (wand:: MagickWand , stream:: IOBuffer ) = readimage (wand, stream. data)
296+ _readimage (wand:: MagickWand , stream:: IOBuffer ) = readimage (wand, stream. data)
291297
292298function writeimage (wand:: MagickWand , filename:: AbstractString )
293299 status = ccall ((:MagickWriteImages , libwand), Cint, (Ptr{Cvoid}, Ptr{UInt8}, Cint), wand, filename, true )
0 commit comments