Skip to content

load() doesn't check whether file exists before offering alternative IO packages #263

@IanButterworth

Description

@IanButterworth

Here fake/fake.png doesn't exist. Instead of detecting that the file doesn't exist, FileIO returns file IO package options for the file format .png that aren't installed.

I believe load should always be used with files that exist.. so perhaps the first step in load should be checking for isfile()?

julia> using FileIO

julia> FileIO.load("fake/fake.png")
Errors encountered while loading "fake/fake.png".
All errors:
===========================================
Failed to open fake/fake.png
===========================================
ArgumentError: Package QuartzImageIO not found in current path:
- Run `import Pkg; Pkg.add("QuartzImageIO")` to install the QuartzImageIO package.

===========================================
ArgumentError: Package ImageMagick not found in current path:
- Run `import Pkg; Pkg.add("ImageMagick")` to install the ImageMagick package.

===========================================

Fatal error:
ERROR: Failed to open fake/fake.png
....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions