@@ -269,25 +269,31 @@ function pingimage(wand::MagickWand, filename::AbstractString)
269
269
nothing
270
270
end
271
271
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 )
273
279
status = ccall ((:MagickReadImage , libwand), Cint, (Ptr{Cvoid}, Ptr{UInt8}), wand, filename)
274
280
status == 0 && error (wand)
275
281
nothing
276
282
end
277
283
278
- function readimage (wand:: MagickWand , stream:: IO )
284
+ function _readimage (wand:: MagickWand , stream:: IO )
279
285
status = ccall ((:MagickReadImageFile , libwand), Cint, (Ptr{Cvoid}, Ptr{Cvoid}), wand, Libc. FILE (stream). ptr)
280
286
status == 0 && error (wand)
281
287
nothing
282
288
end
283
289
284
- function readimage (wand:: MagickWand , stream:: Vector{UInt8} )
290
+ function _readimage (wand:: MagickWand , stream:: Vector{UInt8} )
285
291
status = ccall ((:MagickReadImageBlob , libwand), Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Cint), wand, stream, length (stream)* sizeof (eltype (stream)))
286
292
status == 0 && error (wand)
287
293
nothing
288
294
end
289
295
290
- readimage (wand:: MagickWand , stream:: IOBuffer ) = readimage (wand, stream. data)
296
+ _readimage (wand:: MagickWand , stream:: IOBuffer ) = readimage (wand, stream. data)
291
297
292
298
function writeimage (wand:: MagickWand , filename:: AbstractString )
293
299
status = ccall ((:MagickWriteImages , libwand), Cint, (Ptr{Cvoid}, Ptr{UInt8}, Cint), wand, filename, true )
0 commit comments