Cheers. I have a string of over 4k characters that apparently is a JPEG image (the source I’ve downloaded says so). I’ve searched the web on how to convert the string to an image, without success.
using Images, FileIO
FileIO.save(“img01.jpg”, strimg)
And the following error message came out, apparently not accepting the input string in strimg:
All errors:
===========================================
MethodError: no method matching fileio_save(::File{DataFormat{:JPEG}, String}, ::String)
Closest candidates are:
fileio_save(::File{DataFormat{:JPEG}}, ::AbstractArray; kwargs...) at ~/.julia/packages/JpegTurbo/FDKrF/src/fileio.jl:10
===========================================
MethodError: no method matching save(::File{DataFormat{:JPEG}, String}, ::String)
Closest candidates are:
save(::File{DataFormat{:EXR}}, ::Any...; kwargs...) at ~/.julia/packages/ImageIO/xMHN9/src/ImageIO.jl:141
save(::File{DataFormat{:QOI}}, ::Any...; kwargs...) at ~/.julia/packages/ImageIO/xMHN9/src/ImageIO.jl:152
save(::File{DataFormat{:JPEG}}, ::AbstractArray; kwargs...) at ~/.julia/packages/ImageIO/xMHN9/src/ImageIO.jl:182
===========================================
MethodError: no method matching mapIM(::Char)
Closest candidates are:
mapIM(::RGB{T}) where T<:Normed at ~/.julia/packages/ImageMagick/b8swT/src/ImageMagick.jl:311
mapIM(::RGB{T}) where T at ~/.julia/packages/ImageMagick/b8swT/src/ImageMagick.jl:310
mapIM(::GrayA{T}) where T<:Normed at ~/.julia/packages/ImageMagick/b8swT/src/ImageMagick.jl:307
...
===========================================
┌ Warning: Mapping to the storage type failed; perhaps your data had out-of-range values?
│ Try `map(clamp01nan, img)` to clamp values to a valid range.
└ @ ImageMagick /home/ubuntu/.julia/packages/ImageMagick/b8swT/src/ImageMagick.jl:180
Errors encountered while save File{DataFormat{:JPEG}, String}("img01.jpg").