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

Add support for macOS to the .NET Core build. #216

Closed
dlemstra opened this issue May 18, 2018 · 11 comments
Closed

Add support for macOS to the .NET Core build. #216

dlemstra opened this issue May 18, 2018 · 11 comments
Assignees

Comments

@dlemstra
Copy link
Owner

The .NET Core build currently only support Windows and Linux. Support for macOS should also be added.

@dlemstra
Copy link
Owner Author

dlemstra commented May 27, 2018

The first steps have been made:

libMagick.NET-Q8-x64.Native.dll.dylib:
    /Users/vsts/agent/2.133.3/work/1/s/Magick.NET/Source/libMagick.NET-Q8-x64.Native.dll.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)

The library does not have support for a lot of delegates so it is not usable. I don't own a Mac and I would like to build all the required libraries before I add it to the travis build. For those who are brave the binary that I created can be found here: https://www.dropbox.com/s/w9569iz6cryg1a0/libMagick.NET-Q8-x64.Native.dll.dylib?dl=0. It should be possible to read a JPEG file on MacOS with this binary with the Magick.NET-Q8-x64 build. Would anyone be willing to give it a try?

@thnk2wn
Copy link

thnk2wn commented May 30, 2018

I was having problems loading Magick.NET with PowerShell Core on Mac. After downloading and adding that native dylib into the same folder I was able to load it...

[CmdletBinding()]

param ()

Add-Type -Path "$PSScriptRoot/Magick.NET-Q8-x64.dll"

function Read-Image ($filename) {
    Write-Verbose $"Loading $filename with ImageSharp"
    $image = New-Object ImageMagick.MagickImage($filename)
    $image
}

Read-Image "/Users/hudgeo/Pictures/By Year/2018/2018-04/IMG_3711.JPG"

test

@dlemstra
Copy link
Owner Author

Thanks for giving this a try @thnk2wn! Will continue working on this when I get my new build minutes next month. Due to my experiments this weekend I ran out of all my build minutes. Hope I can give it a try Sunday.

@thnk2wn
Copy link

thnk2wn commented May 30, 2018

No problem. As an FYI I also did a quick image resize test and that worked as well:

resize

Will be exercising other things like EXIF metadata and such soon most likely.

@dlemstra
Copy link
Owner Author

dlemstra commented Jun 2, 2018

@thnk2wn I just replaced the binary with a newer version that has support for the following delegates: fontconfig freetype heic jng jpeg lcms lzma png tiff webp xml zlib. I tried to statically link the libstdc++ library but I could not get that working so I decided to just link it instead:

2018-06-02T07:40:09.5621100Z libMagick.NET-Q8-x64.Native.dll.dylib:
2018-06-02T07:40:09.5635360Z 	/Users/vsts/agent/2.134.2/work/1/s/Magick.NET/Source/libMagick.NET-Q8-x64.Native.dll.dylib (compatibility version 0.0.0, current version 0.0.0)
2018-06-02T07:40:09.5649380Z 	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
2018-06-02T07:40:09.5663100Z 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)

Does this still work on your system and do you know if /usr/lib/libc++.1.dylib is installed on any macOS system?

@thnk2wn
Copy link

thnk2wn commented Jun 5, 2018

@dlemstra The new native dylib also worked fine for me. I didn't update Magic.NET dll.

As far as libc++.1.dylib, I'm not sure about any macOS system but it's on mine. I'm on 10.13.4 High Sierra. From what I can gather it looks like it's probably there from Version 10.11: "El Capitan" and higher (late 2015).

@dlemstra
Copy link
Owner Author

dlemstra commented Jun 5, 2018

Thanks for checking this for me @thnk2wn 👍 I will try to publish a new release this weekend.

@dlemstra
Copy link
Owner Author

@thnk2wn Could you do a quick check for me and test if the library works when you rename the file libMagick.NET-Q8-x64.Native.dll.dylib to Magick.NET-Q8-x64.Native.dll.dylib ?

@thnk2wn
Copy link

thnk2wn commented Jun 13, 2018 via email

@dlemstra
Copy link
Owner Author

Magick.NET 7.5.0.0 has been published and this release includes macOS support.

@jlankitus
Copy link

Are there instructions for how to do the build for Mac from source?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants