Giter VIP home page Giter VIP logo

magickwand's Introduction

Disclaimer

Project is currently under development.
Some feature may not work as expected or may not work at all.
Use at your own risk.

PRs and bugreports are more than welcome.

Swift MagickWand

Swift imagemagick MIT
Build Status codebeat badge Code Climate codecov
platforms SPM

This package supports 6.9.x version of ImageMagick.

Intallation

Shared

It should be possible it install MagickWand with required dependencies using script at /common/install-imagemagick.sh

curl -O -L https://github.com/naithar/MagickWand/raw/master/common/install-imagemagick.sh
bash install-imagemagick.sh

Mac OSX

brew install imagemagick@6

Linux

Install Dependencies
sudo apt-get -y build-dep imagemagick
Install ImageMagick
curl -OL https://www.imagemagick.org/download/releases/ImageMagick-6.9.6-8.tar.xz
tar xf ImageMagick-6.9.6-8.tar.xz
cd ImageMagick-6.9.6-8
./configure --prefix=/usr/local --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp --with-gs-font-dir=/usr/local/share/ghostscript/fonts
make
sudo make install

Add Package

Add this package to dependencies in your Package.swift file.

.Package(url: "https://github.com/naithar/MagickWand.git", majorVersion: 0)

Building and Testing

Shared

eval $(echo 'swift build -Xlinker -L/usr/local/lib/' `Magick-config --cflags` | sed 's/\(-[DI]\)/-Xcc \1/g')

eval $(echo 'swift test -Xlinker -L/usr/local/lib/' `Magick-config --cflags` | sed 's/\(-[DI]\)/-Xcc \1/g')

Mac OSX

swift build -Xswiftc -I/usr/local/opt/imagemagick@6/include/ImageMagick-6 -Xlinker -L/usr/local/opt/imagemagick@6/lib -Xcc -DMAGICKCORE_HDRI_ENABLE=0 -Xcc -DMAGICKCORE_QUANTUM_DEPTH=16

swift test -Xswiftc -I/usr/local/opt/imagemagick@6/include/ImageMagick-6 -Xlinker -L/usr/local/opt/imagemagick@6/lib -Xcc -DMAGICKCORE_HDRI_ENABLE=0 -Xcc -DMAGICKCORE_QUANTUM_DEPTH=16

Linux

swift build -Xcc -I/usr/local/include/ImageMagick-6/ -Xlinker -L/usr/local/lib/ -Xcc -DMAGICKCORE_HDRI_ENABLE=0 -Xcc -DMAGICKCORE_QUANTUM_DEPTH=16

swift test  -Xcc -I/usr/local/include/ImageMagick-6/ -Xlinker -L/usr/local/lib/ -Xcc -DMAGICKCORE_HDRI_ENABLE=0 -Xcc -DMAGICKCORE_QUANTUM_DEPTH=16

XCode Setup

Generate XCode project using this command:

swift package -Xlinker -L/usr/local/lib/ -Xcc -DMAGICKCORE_HDRI_ENABLE=0 -Xcc -DMAGICKCORE_QUANTUM_DEPTH=16 -Xswiftc -I/usr/local/include/ImageMagick-6 -Xcc -I/usr/local/include/ImageMagick-6 generate-xcodeproj

Both -Xcc and -Xswiftc flags can be requested using Magick-config --cflags command

magickwand's People

Contributors

naithar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

magickwand's Issues

TODOs

  • Fix MacOS-Linux dependency issue. solution
  • Enum names
  • Colors (RGBA, HLS, CMYK, HSV/HSB) in Double, Quantum (#5)
  • Structs (#5)
  • Badges (#4)
  • Travis (#4)
  • Test coverage (#7)
  • Codebeat (#6)
  • DrawingWand
  • Colors from imagemagick color list
  • Options for Magick[Get/Set]Option

Sandbox support ?

hi~
I have test use Magick++ for cocoa app. but fail when sandbox enable;
crash like this:

libc++abi.dylib: terminating with uncaught exception of type Magick::ErrorModule: SmallImage: UnableToLoadModule '/usr/local/Cellar/imagemagick/7.0.5-4/lib/ImageMagick//modules-Q16HDRI/coders/jpeg.la': file not found @ error/module.c/OpenModule/1279

Tests

  • Genesis - Terminus (#8)
  • Crashsafe usage without Genesis (#8)
  • Read
  • Write
  • Resize
  • Size, resolution acquiring
  • Color acquiring

Travis-CI build

>> Installing ImageMagick 6.9.6-5
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    47  100    47    0     0    270      0 --:--:-- --:--:-- --:--:--   271
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
./common/install-imagemagick.sh: 16: cd: can't cd to ImageMagick-6.9.6-5
./common/install-imagemagick.sh: 17: ./common/install-imagemagick.sh: ./configure: not found

-lMagickWand-6.Q8 not found

Hello!

Thanks for this library! I found your tool very helpful.

Now I have some strange error:

Linking ./.build/debug/App
ld: library not found for -lMagickWand-6.Q8 for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: build had 1 command failures

A few days ago my project built normally. I followed README but the error occurs.

MagickGetImageBlob returns nil

Hi there,
after try running the test I figured out that all 'ImageWandTests.swift' tests fail.
In the one listed below I figured some more informations out. Hopefully someone has a solution.

Thanks

In func testInitWithData() this fails:
XCTAssertNotNil(imageWand!.data, "ImageWand should have Data")

Here: ImageWand.swift in line 41 it returns nil:
guard let imageBlob = MagickGetImageBlob(self.pointer, &size) else { return [] }

screen shot 2017-06-08 at 20 05 51

PDF Support

I am having trouble getting PDFs to work. I assume the problem is that it is not linking properly to ghostscript. Do you know how to do this properly or do you know how to properly load a PDF?

More specifically I am getting a "false" returned from MagickReadImageBlob

I have run: brew install imagemagick@6 --with-ghostscript
Then I added link "gs.9" to the module map

My impression is that this is now linking in ghostscript but perhaps something extra needs to be done to imagemagick/magickwand to make use of it?

I have also tried setting the "filename" of the wand to a PDF before calling MagickReadImageBlob but that did not seem to help.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.