Skip to content

Commit 945c351

Browse files
committed
use default packBlob instead
1 parent 270aff9 commit 945c351

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

src/images/imagedata.jl

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,38 @@ DevNotes
1818
1919
See also: [`makeImage`](@ref)
2020
"""
21-
function toFormat(format::DataType,
22-
img::AbstractMatrix{<:Colorant} )
21+
function toFormat(
22+
format::Type{format"PNG"},
23+
img::AbstractMatrix{<:Colorant}
24+
)
2325
#
2426
io = IOBuffer()
2527
pngSm = Stream(format, io)
2628
save(pngSm, img) # think FileIO is required for this
2729
take!(io)
2830
end
2931

30-
toFormat(img::AbstractMatrix{<:Colorant}) = toFormat(format"PNG", img)
31-
32+
@deprecate toFormat(img::AbstractMatrix{<:Colorant}) toFormat(format"PNG", img)
33+
34+
35+
## Using default FileIO together with ImageIO
36+
# function DistributedFactorGraphs.packBlob(
37+
# fmt::Type{format"PNG"},
38+
# img::Union{<:AbstractMatrix{<:Colorant},<:AbstractMatrix{UInt8}}
39+
# )
40+
# blob = toFormat(fmt, img)
41+
# mimetype = "image/png"
42+
# return blob, mimetype
43+
# end
44+
# function DistributedFactorGraphs.unpackBlob(
45+
# ::Type{format"PNG"},
46+
# blob::Vector{UInt8}
47+
# )
48+
# io = IOBuffer(blob)
49+
# ioStr = Stream{format"PNG"}(io)
50+
# return load(ioStr)
51+
# # ImageMagick.readblob(imgBytes)
52+
# end
3253

3354
"""
3455
$SIGNATURES

0 commit comments

Comments
 (0)