-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
.Net Core Support #16
Comments
There is .NET Core version of Magick.NET and it can be found here: https://www.nuget.org/packages?q=magick.net.core. It currently only works on Windows but I am planning to add support for other platforms in the future. I will keep this issue open to remind myself. |
@dlemstra It would be nice! |
This issue is marked as help wanted so it is probably also a good idea to explain what kind of help I need (Thanks @bleroy). Magick.NET uses the ImageMagick library through a DllImport. One of the projects creates a native dll that statically links the ImageMagick library files. These .lib files are created with a build script that takes the various projects (https://github.com/dlemstra/Magick.NET/blob/master/ImageMagick/Source/Checkout.sh) and uses a tool of the ImageMagick project to create a solution and build it. I would need a script that builds all the projects and creates library files for Linux/Mac that I can statically link. I am not really a Linux/Mac expert so I could use some help to get the libraries compiled and linked into the Magick.NET.Native project. Once that's done it should be really easy to change the rest of the project to correctly call the native library. |
@dlemstra I was using "Magick.NET.Core-Q8": "7.0.3.902" (from project.json) in VS 14 (2015). I migrate our project to VS 15.2 (2017). I have a .NET Core Console project running under Windows only. However it says: "The owner has unlisted this package. This could mean that the package is deprecated or shouldn't be used anymore.". I tried with another version but it says then: Could you help me? I want to integrate a .NET Core compatible version of Magick.NET in my new Visual Studio 2017 project (to be run on Windows only)? |
You will need to use the latest version of the package |
Thanks. It works. |
I might be able to help out here - we develop on the Mac, deploy to Ubuntu - historically Mono, but we're increasingly embracing .NET Core. I've also got some experience building native libraries for multiple platforms (Win, Mac, Linux, iOS, Android). I'll have a look this week & see how far I get. |
@markbeaton I created a proof of concept with .NET Core this weekend. I had help from @stephanbruny who got it working with Mono. Will integrate the POC this week and this means that the new release will include support for Linux on Ubuntu. It will require building ImageMagick from source but I will put up some instruction on what you need to do. |
Apologies all - I'm not going to get a chance to help out here for some time, but it looks like you're making progress anyway. |
I just published a new release |
Thanks for the tip @hey-red. I updated the .targets file. |
@dlemstra hey. I've bodged in a build script here to build the binaries on Amazon Linux: https://github.com/albumprinter/Albelli.Magick.Builder It's WIP, so you shouldn't expect it to look pretty just yet. I see a problem with the way you distribute the linux bins: not every linux is the same. And since you've compiled yours against libjpeg8, it's a bit of a hassle to make it work on the centos/fedora based distros. Another issue wich makes it hard to automate your build is the fact that you are using a I will try to make my build work and produce a nuget package (currently it's just a bunch of .so files). You are free to borrow things from that repo if you want to. But since you are using appveyor as CI I don't think it will work right away. I am tryin to use travis for it. |
I am linking against |
Unable to find image 'centos:latest' locally
latest: Pulling from library/centos
d9aaf4d82f24: Pull complete
Digest: sha256:eba772bac22c86d7d6e72421b4700c3f894ab6e35475a34014ff8de74c10872e
Status: Downloaded newer image for centos:latest
[root@878f6f639d2a /]# yum install -y libjpeg-turbo
Loaded plugins: fastestmirror, ovl
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/4): base/7/x86_64/group_gz | 156 kB 00:00:00
(2/4): extras/7/x86_64/primary_db | 102 kB 00:00:00
(3/4): updates/7/x86_64/primary_db | 2.8 MB 00:00:01
(4/4): base/7/x86_64/primary_db | 5.7 MB 00:00:04
Determining fastest mirrors
* base: mirrors.noction.com
* extras: mirrors.noction.com
* updates: mirror.oxilion.nl
Resolving Dependencies
--> Running transaction check
---> Package libjpeg-turbo.x86_64 0:1.2.90-5.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================
Package Arch Version Repository Size
========================================================================================================================
Installing:
libjpeg-turbo x86_64 1.2.90-5.el7 base 134 k
Transaction Summary
========================================================================================================================
Install 1 Package
Total download size: 134 k
Installed size: 342 k
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/libjpeg-turbo-1.2.90-5.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, ke
y ID f4a80eb5: NOKEY
Public key for libjpeg-turbo-1.2.90-5.el7.x86_64.rpm is not installed
libjpeg-turbo-1.2.90-5.el7.x86_64.rpm | 134 kB 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-4.1708.el7.centos.x86_64 (@CentOS)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libjpeg-turbo-1.2.90-5.el7.x86_64 1/1
Verifying : libjpeg-turbo-1.2.90-5.el7.x86_64 1/1
Installed:
libjpeg-turbo.x86_64 0:1.2.90-5.el7
Complete!
[root@878f6f639d2a /]# ls /lib64 | grep jpeg
libjpeg.so.62
libjpeg.so.62.1.0
[root@878f6f639d2a /]# ls /usr/lib64 | grep jpeg
libjpeg.so.62
libjpeg.so.62.1.0
[root@878f6f639d2a /]# Your lib is compiled against
And it requires a Visual Studio instance to be opened, right? Or I am missing things and I can run a script on a CI server which will produce a binary? |
Would your issue be fixed if you would rebuild The remote compilation does work without having Visual Studio open but you will need to register the remove build agents inside Visual Studio. Not sure how you could do this from the command line. |
That is what I called "hassle" and that is something I'd rather avoid. It's way easier to rebuild the wrapper in a way I did. Is there a particular reason why you don't want to distribute the bins separately? Got it. But it means we can't use that script to build this thing in Travis/AnotherCiOfChoice, right? Since you don't really open the VS there. And in most cases you don't even have it there. With In any case I will proceed with my repo and if you would like to have it in yours, you are welcome to take bits and pieces you like. I started this conversation because I read that you were asking for help with the Linux part. I know it's not a static build we all would like to have ;) But it's a solution which works for me and can work for others. |
I would like to avoid a separate package because it is really nice that I can now include the .so file in the package easily. The binary is stored inside the folder: Maybe we could create some Docker files that other people could use as their base image that has ImageMagick and libjeg-turbo already installed. I already have a Docker file for the image that I use to remotely compile the source on an Ubuntu machine: https://github.com/dlemstra/Magick.NET/blob/master/Source/Magick.NET.CrossPlatform/ubuntu.16.04/Dockerfile. I could split that file into two images one that builds ImageMagick and has it installed and one that adds the ssh stuff so I can use it for remote compilation. What would you think of that solution? |
@dlemstra the solution with compiling libjpeg, when it's already available in the system, is not something I am aiming for. I have some more news for people who might be interested in the package I am working on. Currently I have a version which is statically compiled with A version to test with is available from myget (you can see the link in the repo's readme) as a complete nuget package. It's possible to use the scripts locally to build the package yourself, in case you need Q16 or HDRI enabled. The only requirement is that you have docker installed. The readme is available in the repo. |
Hi I have 2 options => i can call my core console and everything works well 2nd: this time the call to my core console fails due to this missing libjpeg.so.8 but i have libjpeg.so.62 the aim of this solution N° is to reduce the size of the image |
@laurentKTR I am trying to statically link ImageMagick with the help of @superstator. We have made some progress and the library works on the following base images: https://github.com/dlemstra/Magick.NET/blob/master/Source/Magick.NET.CrossPlatform/Linux.Verify.Dockerfile without doing any extra installation or building. Will work on seeing how well his works with running the unit test on a Linux machine. Will try to publish a new release once I have this working properly. |
@laurentKTR Can you give the latest release a try? |
works well, my dockerfile is now very simple, |
Has there been any more work on getting Magick.Net running on Raspberry Pi? I have tried what little instructions I have found and nothing seems to work. |
Hi I started to work in dotnet standard 2 there is nothing now in this version of dotnet standard to support the class of ColorTranslator. I just need the mothod of FromHtml() in that class. Is there anything in Magick.Net so I can convert the Hex text color to RGB ? |
@meysamSamanpour Could you start a new issue for this and explain in detail what you are talking about? |
@dlemstra I am slightly confused on how to build/deploy Magick.net using .net core running on linux and referencing the correct dll's. i have a .net core web app that i develop on windows and then i build and deploy it to a Docker container running Ubuntu using Jenkins. I have Magic.net working correctly on windows and now want to build and deploy it, but this is where i am confused.
|
@meysamSamanpour and @SepiaGroup Could you please open a new issue for your questions. Will close this issue because we have support for .NET Core now. |
@dlemstra are there any issues or plans for macOS support (or did this get implemented)? I've been tracking this issue as a proxy for that, noticed a lot of progress on native Linux binaries but wasn't sure if that also extended to macOS. |
@lmontoute I opened a new issue for that here: #216. This issue was being hijacked for other questions. |
What about net.core 2.2? |
ImageMagick is already cross platform, will it be possible you to create NuGet package that is also cross platform?
The text was updated successfully, but these errors were encountered: