jruby / image_voodoo Goto Github PK
View Code? Open in Web Editor NEWImageScience-compatible image processing for JRuby
License: MIT License
ImageScience-compatible image processing for JRuby
License: MIT License
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
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:
Please, do an analysis and/or fix if that's possible.
Currently 0.8.2 is the latest released gem, but the History file's latest entry is 0.8.0.
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?
NoMethodError: undefined method `hex_to_color' for #<ImageVoodoo:0x77bd0897>
from /Users/Petr/.rbenv/versions/jruby-1.7.20/lib/ruby/gems/shared/gems/image_voodoo-0.8.8/lib/image_voodoo/awt.rb:34:in `add_border'
hex_to_color is defined as class method...
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?
Produces empty instance <ImageVoodoo:0x75222006 @src=nil, @format="JPEG", @quality=nil>
I think its time to cover this gem with proper tests...
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....
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?
https://github.com/jruby/image_voodoo/blob/master/lib/image_voodoo.rb#L98
change 'calculate_thumbnail_dimentions' to 'calculate_thumbnail_dimensions'
Java Image APIs allow us to get most/all of the embedded data in an XML format (from what I remember). It would be nice to mixin an Exif module which can return this info.
image_voodo throws Unsupported Image Type exception when handling CMYK images.
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?
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.
Case 5 should be flip horizontally and rotate 90.
Case 8 is missing, which should be rotate 270.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.