Giter VIP home page Giter VIP logo

mruby-mrmagick's Introduction

mruby-mrmagick Build Status Build status

ImageMagick binding for mruby.

I don't know or use the whole ImageMagick library. I have deliberately let some modules out of these bindings in order to focus on parts I understand and/or have a need for.

install by mrbgems

  • add conf.gem line to build_config.rb
MRuby::Build.new do |conf|

    # ... (snip) ...

    conf.gem :mgem => 'mruby-mrmagick'
end

example

img = Mrmagick::ImageList.new("sample.png") # read image file.
new_img = img.blur_image(0.0, 8.0) # returns new image which bluerd.
new_img.write("blur.jpg")
img = Mrmagick::ImageList.new("sample.jpg") # read image file.
new_img = img.scale(0.5) # returns new image which scaled.
new_img.write("half.png")
img = Mrmagick::ImageList.new("sample.png") # read image file.
img2 = img.blur_image(0.0, 8.0) # returns new image which bluerd.
img3 = img2.scale(4) # returns new image which scaled.
img3.write("blur_x4.jpg")
img = Mrmagick::ImageList.new("sample.jpg") # read image file.
img.get_exif_by_entry('GPSLatitude')
img = Mrmagick::ImageList.new("sample.jpg") # read image file.
img2 = img.blur_image(0.0, 8.0) # returns new image which bluerd.
File.open("blob.jpg", "wb") {|f|
  f.print img2.to_blob
}
img = Mrmagick::ImageList.new("sample_with_exif.jpg")
img.orientation # => 2
img = img.auto_orient
img.write("sample_ao.jpg")
img = Mrmagick::ImageList.new("sample_ao.jpg")
img.orientation # => 1

See also

License

under the MIT License:

  • see LICENSE file

mruby-mrmagick's People

Contributors

hfm avatar kjunichi avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

Forkers

asfluido hfm

mruby-mrmagick's Issues

TOP level missing in H2O compilation

New error when compile with H2O sudo make on Linux, I have MRuby 1.2 package that came with the Linux distribution is /usr/bin/mruby, however for H2O deps, there is no mruby executable.

/home/test/h2o/mruby/host/bin/

mirb  mrbc  mruby-config  mruby-strip
collect2: error: ld returned 1 exit status
rake aborted!
Command Failed: [g++  -o "/home/test/h2o/mruby/host/bin/mruby" "/home/test/h2o/mruby/host/mrbgems/mruby-bin-mruby/tools/mruby/mruby.o" "/home/test/h2o/mruby/host/lib/libmruby.a" -L/usr/local/lib -lMagick++-6.Q16 -lMagickWand-6.Q8 -lMagickCore-6.Q8 -L/usr/local/lib -lMagick++-6.Q16 -lMagickWand-6.Q8 -lMagickCore-6.Q8 -lm -lpthread -lpthread -lpthread -lhiredis ]
CMakeFiles/mruby.dir/build.make:57: recipe for target 'CMakeFiles/mruby' failed
make[2]: *** [CMakeFiles/mruby] Error 1
CMakeFiles/Makefile2:498: recipe for target 'CMakeFiles/mruby.dir/all' failed
make[1]: *** [CMakeFiles/mruby.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

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.