Code Monkey home page Code Monkey logo

Comments (4)

enebo avatar enebo commented on June 5, 2024

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

PetrKaleta avatar PetrKaleta commented on June 5, 2024

@enebo did you find something?

from image_voodoo.

enebo avatar enebo commented on June 5, 2024

@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:

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

enebo avatar enebo commented on June 5, 2024

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)

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.