Code Monkey home page Code Monkey logo

image_voodoo's Introduction

JRuby - an implementation of the Ruby language on the JVM

Master: JRuby CI, JRuby CI (Windows) 9.3 branch: JRuby CI, JRuby CI (Windows)

About

JRuby is an implementation of the Ruby language using the JVM.

It aims to be a complete, correct and fast implementation of Ruby, at the same time as providing powerful new features such as concurrency without a global-interpreter-lock, true parallelism, and tight integration to the Java language to allow you to use Java classes in your Ruby program and to allow JRuby to be embedded into a Java application.

You can use JRuby simply as a faster version of Ruby, you can use it to run Ruby on the JVM and access powerful JVM libraries such as highly tuned concurrency primitives, you can use it to embed Ruby as a scripting language in your Java program, or many other possibilities.

We're a welcoming community - you can talk to us on #jruby on Libera. There are core team members in the EU and US time zones.

Visit the JRuby website and the JRuby wiki for more information.

Getting JRuby

To run JRuby you will need a JRE (the Java VM runtime environment) version 8 or higher.

Your operating system may provide a JRE and JRuby in a package manager, but you may find that this version is very old.

An alternative is to use one of the Ruby version managers.

For rbenv you will need the ruby-build plugin. You may find that your system package manager can provide these. To see which versions of JRuby are available you should run:

$ rbenv install jruby

Note: if you do not regularly git update rbenv this list of versions may be out of date.

We recommend always selecting the latest version of JRuby from the list. You can install that particular version (9.2.13.0 is just for illustration):

$ rbenv install jruby-9.2.13.0

For rvm you can simply do:

$ rvm install jruby

Using Homebrew works too:

$ brew install jruby

You can also download packages from the JRuby website that you can unpack and run in place.

Building JRuby

See BUILDING for information about prerequisites, how to compile JRuby from source and how to test it.

Authors

Stefan Matthias Aust, Anders Bengtsson, Geert Bevin, Ola Bini, Piergiuliano Bossi, Johannes Brodwall, Rocky Burt, Paul Butcher, Benoit Cerrina, Wyss Clemens, David Corbin, Benoit Daloze, Thomas E Enebo, Robert Feldt, Chad Fowler, Russ Freeman, Joey Gibson, Kiel Hodges, Xandy Johnson, Kelvin Liu, Kevin Menard, Alan Moore, Akinori Musha, Charles Nutter, Takashi Okamoto, Jan Arne Petersen, Tobias Reif, David Saff, Subramanya Sastry, Chris Seaton, Nick Sieger, Ed Sinjiashvili, Vladimir Sizikov, Daiki Ueno, Matthias Veit, Jason Voegele, Sergey Yevtushenko, Robert Yokota, and many gracious contributors from the community.

JRuby uses code generously shared by the creator of the Ruby language, Yukihiro Matsumoto [email protected].

Project Contact: Thomas E Enebo [email protected]

License

JRuby is licensed under a tri EPL/GPL/LGPL license. You can use it, redistribute it and/or modify it under the terms of the:

Eclipse Public License version 2.0 OR GNU General Public License version 2 OR GNU Lesser General Public License version 2.1

Some components have other licenses and copyright. See the COPYING file for more specifics.

image_voodoo's People

Contributors

banzaiman avatar enebo avatar hendricksond avatar nicksieger avatar olleolleolle avatar ravbaker avatar wilg 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

Watchers

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

image_voodoo's Issues

Format conversion doesn't seem to work`

Given this PNG input image:

test

and this code:

ImageVoodoo.with_image("test.png").bytes("JPG")

Results in this broken file:

out

Am I just doing something wrong here?

ImageVoodoo.with_bytes(ImageVoodoo.with_image("test.png").bytes("JPG")).format

returns JPG as expected

NoMethodError: private method `save_impl' called for..

Hi!

In the project I'm using ImageVoodoo gem indirectly. It's a depedency of another gem: carrierwave_imagevoodoo (0.1.0-java)

We've recently upgraded imagevoodoo from 0.8.2 to 0.8.6 and this error started appearing:

NoMethodError (private method `save_impl' called for #<ImageVoodoo:0x54440629>):#012  app/services/foobar.rb:50

We don't use your gem directly (nor carrierwave).

Looks like one of 2 things happened and I'm not sure which one:

  • you've modified public API in a patch release and that would be bad
  • carrierwave (probably) is invoking a private method from your codebase - and the effect is bad as you may see

Please, do an analysis and/or fix if that's possible.

Method to get image type?

Sometimes you can process image files without extension, so its handy to know, what is type of currently processed image. So it should return symbol :jpg, :png, :bmp, ... or maybe mime_type like image/jpg,... what do you think?

Launching empty Java app after console starts

I have this simple rake task:

task :console do
  require 'image_voodoo'
  require 'irb'
  require 'irb/completion'

  ARGV.clear && ARGV.concat(['--prompt', 'simple'])
  IRB.start
end

Once I ran this task, it automatically runs Java application with empty window. So I loose focus from console, so then must switch windows etc... Can you prevent this? What is the reason to do that?

Add auto_orient support

One of the very common tasks we must do on our server is to auto_orient images based on its EXIF. iOS devices are not rotating images "physically" but just changing its EXIF.

While we were using ImageMagick, we used --auto-orient flag which did this job perfectly. I was looking for any possible solutions with BufferedImage but it seems to be a hard one :/ Any suggestions?

Usage with paperclip

I've been unable to find any docs for how to use this gem with paperclip under jruby. Are there any usage guides for this use-case?

Compression/quality setting doesn't work with GIF files

When I use the .quality(...) method and I'm saving a file as GIF I'm getting an error.

jruby-1.7.12 :026 > i=ImageVoodoo.with_image('/Users/ravbaker/Downloads/1.png')
 => #<ImageVoodoo:0x27ba52a2 @src=#<Java::JavaAwtImage::BufferedImage:0x556c08de>, @format="PNG", @quality=nil>
jruby-1.7.12 :027 > i.quality(0.85).save('/tmp/test2.png')
 => true
jruby-1.7.12 :028 > i.quality(0.85).save('/tmp/test2.gif')
Java::JavaLang::IllegalStateException: No compression type set!
    from javax.imageio.ImageWriteParam.setCompressionQuality(javax/imageio/ImageWriteParam.java:1244)
    from java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:606)
    from RUBY.write_new_image(/Users/ravbaker/.rvm/gems/jruby-1.7.12/gems/image_voodoo-0.8.6/lib/image_voodoo/awt.rb:274)
    from RUBY.save_impl(/Users/ravbaker/.rvm/gems/jruby-1.7.12/gems/image_voodoo-0.8.6/lib/image_voodoo/awt.rb:260)
    from RUBY.save(/Users/ravbaker/.rvm/gems/jruby-1.7.12/gems/image_voodoo-0.8.6/lib/image_voodoo.rb:171)

I'm going to investigate it and fix it in next PR.

Missing history entries

Currently 0.8.2 is the latest released gem, but the History file's latest entry is 0.8.0.

Save as JPEG with quality?

It seems there's no way to set quality when saving jpegs. Which is quite important option, i think. Based on results its default value is 70% which is producing quite bad looking images, especially when processing photos....

0.8.3 ArgumentError: java.lang.IllegalArgumentException: Illegal output type!

Failing at [GEM_ROOT]/gems/image_voodoo-0.8.3/lib/image_voodoo.rb:158:in 'resize'

This issue is not happening on 0.8.2! It seems to be related to our new quality method. Its happening only when ImageVoodoo object is initialised using ImageVoodoo.with_bytes

original = ImageVoodoo.with_bytes(bytes_str) # bytes_str is response body of downloaded image
original.resize(trans_width, trans_height) do |transformed| # crashes here
  # ...
end

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.