Code Monkey home page Code Monkey logo

image_voodoo's Issues

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

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.

Missing history entries

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

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?

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

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?

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....

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?

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?

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.

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.