Giter VIP home page Giter VIP logo

raku-magickwand's Introduction

MagickWand

Actions Status

This provides a Raku object-oriented NativeCall-based API for ImageMagick's MagickWand C API.

Example

use v6;
use MagickWand;

# A new magic wand
my $wand = MagickWand.new;

# Read an image
$wand.read("examples/images/aero1.jpg");

# Lighten dark areas
$wand.auto-gamma;

# And then write a new image
$wand.write("output.png");

# And cleanup on exit
LEAVE {
  $wand.cleanup if $wand.defined;
}

For more examples, please see the examples folder. For examples of available image effects, please click here.

Prerequisites

Please follow the instructions below based on your platform:

Linux (Debian)

  • To install ImageMagick libraries, please run:
$ sudo apt install libmagickwand-dev

MacOSX (Darwin)

  • To install ImageMagick libraries via Homebrew, please run:
$ brew update
$ brew install imagemagick
  • To install ImageMagick libraries via MacPorts, please run:
$ sudo port install ImageMagick

Windows

For Windows, most people will want the standard 64-bit DLL installer. If you need 32-bit or other special options, select the appropriate alternate installer.

Also please remember to enable "Add to PATH" option.

Installation

  • Install this module using zef:
$ zef install MagickWand

Handling PDF files

To process PDF files, please remember to install Ghostscript from here.

Testing

  • To run tests:
$ prove --ext .rakutest -ve "raku -I."
  • To run all tests including author tests (Please make sure Test::Meta is installed):
$ zef install Test::META
$ TEST_AUTHOR=1 prove --ext .rakutest -ve "raku -I."

Author

Ahmad M. Zawawi, azawawi on #raku, https://github.com/azawawi/

License

MIT License

raku-magickwand's People

Contributors

azawawi avatar cono avatar samcv avatar sylints avatar thundergnat avatar ufobat avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

raku-magickwand's Issues

Can't work out how to get errors

I'm guessing maybe this isn't implemented but I can't figure out how to get the error when read returns false.

Ideally this would have a more modern, Perl6-y architecture where we would have atomic object creation with exceptions thrown, but any guide on how to get the error string from the magick wand would be helpful, even if it's just done in the examples or tests.

Install fails with Cannot locate native library 'CORE_RL_wand_.dll': error 0x7e

I'm using Windows 10 with Rakudo version 2017.07 and have tried both the 16 and 8 bit depth versions of ImageMagick-7.0.7-7

Looking in the Image Magick folder I can't see that dll, but there is one called CORE_RL_MagickWand_.dll

Here's the first bit of output from zef with the path shown first

PS C:\WINDOWS\system32> $Env:Path
C:\Program Files\ImageMagick-7.0.7-Q8;C:\ProgramData\Oracle\Java\javapath;C:\ProgramFiles\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows etc. etc.
PS C:\WINDOWS\system32> zef install MagickWand
Use of Nil in string context
in sub guess-path at C:\rakudo\share\perl6\site\sources\2A928C6F9B02AF49EBD04F99E07BE1820A3A1C9F (Zef::Config) line 21
Use of Nil in string context
in sub guess-path at C:\rakudo\share\perl6\site\sources\2A928C6F9B02AF49EBD04F99E07BE1820A3A1C9F (Zef::Config) line 21
===> Searching for: MagickWand
===> Searching for missing dependencies: LibraryCheck
===> Testing: LibraryCheck:ver('0.0.6'):auth('github:jonathanstowe')
===> Testing [OK] for LibraryCheck:ver('0.0.6'):auth('github:jonathanstowe')
===> Testing: MagickWand:ver('0.0.2'):auth('github:azawawi')
Cannot locate native library 'CORE_RL_wand_.dll': error 0x7e
in method setup at C:\rakudo\share\perl6\sources\24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 316
in method CALL-ME at C:\rakudo\share\perl6\sources\24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 328
in method read at C:\Users\ADMINI~1\AppData\Local\Temp.zef\store\perl6-magickwand.git\13bc0b051775f74f2422833017915dc
87aebcaec\lib\MagickWand.pm6 (MagickWand) line 72
in block at t\02-magickwand.t line 24

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.