Application exported doesn't run if there are images

edited March 2018 in Using Processing

Hi guys, i'm trying to export the sketch like an application. The sketch run corretly, if the sketch hasn't images and if i export it, run correctly, but, if i put images in the sketch and subsequently export it, the application show me just a grey window. I tried to export for Windows and i tried to export embedding Java and i tried to export not embedding Java but the result is always the same if there are images in the sketch. Can somebody help me? Thanks

Tagged:

Answers

  • Not with the information you've given.

    Where and what are the images?

  • I found the solution: i just had to put the images also in the exported application folder create after the exportation

  • It'll do that automatically if the images are in the data directory. Use either the add file menu option or drag the files onto the pde.

    See loadImage in the reference.

  • I put the images in the data sketch directory and the sketch run correctly but the problem happened when i exported the application, is like if exportation didn't move the images in the sketch folder to exported application folder

  • Without knowing exactly what you're doing I'm not going to say. But it has always worked for me in the past.

  • edited March 2018

    Ok, this is just a test. Try to run this code into the sketch and after try to export it and run the exported application. For me work just the sketch not exported.

    float x;
    float y;
    float easing = 0.05;
    PImage img1;
    
    void setup() {
      size(640, 360); 
      noStroke();  
      img1 = loadImage ("landscape.jpg");
    }
    
    void draw() { 
      background(51);
    
      image(img1, 0, 0, width, height);
    
      float targetX = mouseX;
      float dx = targetX - x;
      x += dx * easing;
    
      float targetY = mouseY;
      float dy = targetY - y;
      y += dy * easing;
    
      ellipse(x, y, 66, 66);
    }
    
  • i've just tried this using my own code. and it's fine.

    the above doesn't show us where the image is, which i suspect is the problem.

  • project source:

    .
    ├── data
    │   └── image.jpg
    └── tmpExport2.pde
    

    exported directory:

    application.linux64
    ├── data
    │   └── image.jpg
    ├── lib
    │   ├── core.jar
    │   ├── gluegen-rt.jar
    │   ├── gluegen-rt-natives-linux-amd64.jar
    │   ├── jogl-all.jar
    │   ├── jogl-all-natives-linux-amd64.jar
    │   └── tmpExport2.jar
    ├── source
    │   ├── tmpExport2.java
    │   └── tmpExport2.pde
    └── tmpExport2
    
  • edited March 2018

    My image is in the data folder like in your project source example, the difference is in the exported directory, here, there isn't the image. I put it in manually

  • @R_Sørensen What OS are you using as well as Processing version?

    Kf

  • edited March 2018

    Windows 10 Home, 64 bit

Sign In or Register to comment.