Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with png file detection #210

Closed
tknopp opened this issue Oct 28, 2018 · 5 comments
Closed

Problem with png file detection #210

tknopp opened this issue Oct 28, 2018 · 5 comments

Comments

@tknopp
Copy link

tknopp commented Oct 28, 2018

Hi I get this

  FileIO.File{FileIO.DataFormat{:UNKNOWN}}("/Users/knopp/.julia/dev/MRIReco/test/recogre.png") couldn't be recognized by FileIO.
  
  Stacktrace:
   [1] #save#30(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::FileIO.File{FileIO.DataFormat{:UNKNOWN}}, ::Array{Gray{Float64},2}) at /Users/knopp/.julia/packages/FileIO/lt9I0/src/loadsave.jl:199
   [2] save(::FileIO.File{FileIO.DataFormat{:UNKNOWN}}, ::Array{Gray{Float64},2}) at /Users/knopp/.julia/packages/FileIO/lt9I0/src/loadsave.jl:199
   [3] #save#15(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String, ::Array{Gray{Float64},2}) at /Users/knopp/.julia/packages/FileIO/lt9I0/src/loadsave.jl:118
   [4] save(::String, ::Array{Gray{Float64},2}) at /Users/knopp/.julia/packages/FileIO/lt9I0/src/loadsave.jl:118
   [5] macro expansion at /Users/knopp/.julia/dev/MRIReco/test/testISMRMRD.jl:35 [inlined]
   [6] macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [7] top-level scope at /Users/knopp/.julia/dev/MRIReco/test/testISMRMRD.jl:5
   [8] include at ./boot.jl:317 [inlined]
   [9] include_relative(::Module, ::String) at ./loading.jl:1038
   [10] include(::Module, ::String) at ./sysimg.jl:29
   [11] include(::String) at ./client.jl:388
   [12] top-level scope at none:0
   [13] include at ./boot.jl:317 [inlined]
   [14] include_relative(::Module, ::String) at ./loading.jl:1038
   [15] include(::Module, ::String) at ./sysimg.jl:29
   [16] include(::String) at ./client.jl:388
   [17] top-level scope at none:0
   [18] eval(::Module, ::Any) at ./boot.jl:319
   [19] macro expansion at ./logging.jl:317 [inlined]
   [20] exec_options(::Base.JLOptions) at ./client.jl:219
   [21] _start() at ./client.jl:421

I am not sure what is going on, but it happens when I uncomment this line:
https://github.com/MagneticResonanceImaging/MRIReco.jl/blob/master/test/testISMRMRD.jl#L35

@tknopp
Copy link
Author

tknopp commented Oct 28, 2018

@SimonDanisch

@SimonDanisch
Copy link
Member

Probably a corrupted file already exists?

@tknopp
Copy link
Author

tknopp commented Oct 29, 2018

Yes, here is the repro:

julia> ; touch test.png
julia> using Images
julia> a = shepp_logan(256)
julia> I = colorview(Gray,a./maximum(a));
julia> save("test.png", I)

Isn't that a bug? The file test.png was generated because FileIO did error in the first place due to missing package dependencies. Why should it matter that there is a corrupt file, it should be overwritten.

@MarkusQ
Copy link

MarkusQ commented Apr 23, 2019

This looks like a duplicate of #132

@tknopp
Copy link
Author

tknopp commented Apr 23, 2019

yep, even better would be a fix for #132. ;-)

@tknopp tknopp closed this as completed Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants