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

ImageMagick should be in the [deps] section in Project.toml #824

Closed
EvertSchippers opened this issue Nov 20, 2019 · 11 comments · Fixed by #948
Closed

ImageMagick should be in the [deps] section in Project.toml #824

EvertSchippers opened this issue Nov 20, 2019 · 11 comments · Fixed by #948

Comments

@EvertSchippers
Copy link

I use Images.jl only to save a jpg image, using this statement:

using Images
...
save("filename.jpg", someUInt8Matrix)

But my project/enviroment needs ImageMagick to be added before this works. I'm not using it myself directly (I don't have a "using ImageMagick" in my code).

Somewhere Images.jl does use it. I should not have to add "ImageMagick" to my project, it should automatically be added to my Manifest when I Pkg.add Images.

You can replicate by temporarily removing your enviroment, add just Images, and try and use it...

@johnnychen94
Copy link
Member

johnnychen94 commented Nov 21, 2019

FileIO specifies a set of general file I/O APIs such as load and save. It doesn't have codes on specific file formats, which means you need to install an image IO package (e.g., ImageMagick) to read image files, and CSV to read .csv files, etc.

Adding ImageMagick as a hard dependency of FileIO might free you from installing it manually once, in the cost of adding it for all downstream projects (even for those unrelated to images), which is much more expensive. So I think this request won't be considered.

I use Images.jl only to save a jpg image

In this case, you don't need using Images, instead using FileIO with ImageMagick installed is sufficient.

@timholy
Copy link
Member

timholy commented Nov 21, 2019

Exactly. Moreover, depending on platform the user may prefer different packages (e.g., QuartzImageIO on macs).

@timholy timholy closed this as completed Nov 21, 2019
@EvertSchippers
Copy link
Author

You are totally right, I feel a bit stupid... Thanks for responding - and solving this!

@mbaz
Copy link

mbaz commented Apr 14, 2020

This seems related; let me know if you'd prefer that I open a new issue...

I tried following the "Getting started" instructions:

using TestImages
img = testimage("mandrill")

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

It seems to me like ImageMagick should in fact be installed as a dep of Images.jl...

@johnnychen94
Copy link
Member

johnnychen94 commented Apr 14, 2020

FileIO used to prompt to install image io backends if not available, now it doesn't do this anymore and just throw an error for that.

We've updated the docs recently JuliaImages/juliaimages.github.io#115. Unfortunately, the documentation CI is continuously hitting failures during deployment, you can view the latest version of "getting started" by this: https://juliaimages.org/previews/PR115/install/

@johnnychen94
Copy link
Member

I believe the reason we didn't do this for Images.jl is that binary dependency was a maintenance nightmare.

Now with the artifact system provided by Julia >= 1.3, bundling a default backend into Images looks like a good choice for me. However, we might not want to do this right now because people here are too busy to maintain two Images versions(one for Julia < v1.3 and one for Julia >= v1.3). We can do this when we upgrade to the next Julia LTS version.

@timholy
Copy link
Member

timholy commented Apr 14, 2020

Yes, that was written when FileIO installed packages for you.

ImageMagick may be a good choice on Linux, though with ImageIO that's getting less clear. It's even less obviously so on Mac, where QuartzImageIO was at least once the default option.

@mbaz
Copy link

mbaz commented Apr 14, 2020

Thanks! BTW, I only installed ImageMagick.jl because that's what the error message prompted me to do.

@IanButterworth
Copy link
Member

Just bringing this discussion here.

What would we consider the minimum feature set that ImageIO would need to be the one?

@johnnychen94
Copy link
Member

johnnychen94 commented Aug 20, 2020

Adding these backends won't increase the loading time of Images, and since adding these backends are no longer a nightmare since Julia 1.3, I think it would be acceptable to add all of them.

QuartzImageIO is reserved for macOS and that makes default load and save behavior different across platforms. Keywords arguments are different, too. For this reason, I suggest we don't add QuartzImageIO to Project.toml.

That said, I think it's would be sufficient to add ImageMagick and ImageIO into Images' Project.toml, and when ImageIO has higher priority in the FileIO's registry for every image file types, we're in essence sunsetting ImageMagick. A quick look at the registry, I find GIF, JPEG, BMP and PCX are supported by ImageMagick.

Adding this requires us to bump Julia compat in Project.toml to >= 1.3, otherwise, Julia 1.0 users might suffer from risks of installing these backends. ImageIO requires Julia 1.3, too.

I heard rumors that Julia 1.6 will be the next LTS version, if that's the case, then the perfect time is when Julia 1.6 is released. ( I don't feel good to discontinue the support to the current LTS version)

@johnnychen94
Copy link
Member

johnnychen94 commented Aug 30, 2020

In the Juliacon 2020 talk "State of Julia 2020", YouTube, it's officially announced that 1.6 will be the next LTS version.

We could add ImageMagick and ImageIO to the Project.toml of Images when 1.6 is out.

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

Successfully merging a pull request may close this issue.

5 participants