Comments (4)
@PetrKaleta I am not sure but I can see it. Loading AWT might push Java into some idea that it is going to be doing graphics. Off to the internets!
from image_voodoo.
@enebo did you find something?
from image_voodoo.
@PetrKaleta I might have a solution which will work. Java has a headless mode. In headless mode a series of AWT toolkit classes native impls are basically stubbed out. One side-effect is when headless it does not create the external window like you are seeing. So for batch processing:
jruby -J-Djava.awt.headless=true
or before image_voodoo is required:
java.lang.System.setProperty('java.awt.headless', true)
I am thinking about making a flag in bin/image_voodoo that detects whether preview is used and if so uses non-headless mode but without specifying this flag image_voodoo will by default be in headless mode. This has two points worth mentioning:
- If you already have loaded any AWT classes in question then it won't change anything as those classes usage will start Java in non-Java headless mode but I think that is ok.
- it means people who use image_voodoo and do want AWT classes used will need to explicitly take an action or image_voodoo will end up starting headless mode. I think this is a vast minority of use cases, but it is still a change in behavior.
from image_voodoo.
This is a big improvement. Thinking about this change a bit more I don't expect my fears of interactive users breaking will be real. For 1) are there any? :) and 2) If they are using AWT then it is extremely likely the first thing they load will be something else before image_voodoo in which case the headless property will have shown up too late to affect behavior.
from image_voodoo.
Related Issues (16)
- Missing history entries HOT 1
- Compression/quality setting doesn't work with GIF files
- Provide metadata information provided by EXIF to image formats which support it. HOT 1
- Add auto_orient support HOT 17
- NoMethodError: undefined method `hex_to_color' for #<ImageVoodoo:0x77bd0897>
- Format conversion doesn't seem to work` HOT 6
- unable to reading CMYK images HOT 4
- NoMethodError: private method `save_impl' called for.. HOT 6
- Typo in cropped_thumbnail
- correct_orientation_impl is incorrect
- Usage with paperclip HOT 1
- Save as JPEG with quality? HOT 18
- Method to get image type? HOT 5
- 0.8.3 ArgumentError: java.lang.IllegalArgumentException: Illegal output type! HOT 1
- 0.8.5 break ImageVoodoo.with_bytes again HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image_voodoo.