Saveframe() fails when exported application is emailed and run

Bit of an odd bug this one. If I export an application for OS X in 3.4 that uses saveframe() (see example code), and then run that application from my machine, the app functions correctly. If I zip that exported application, unzip it again, and then run it, the app functions correctly.

However, if I email the app to myself, download it and then run it, saveFrame doesn’t seem to work. The app doesn’t crash, it just doesn’t export the frames.

If I do something similar with an app that uses SVG Export, beginRecord() and endRecord(), the app will freeze.

It’s a pretty weird issue, and a pretty bizarre use case, but is causing a few frustrations on a current project. I’ve tried using a few different email accounts and file sharing services, and it seems to be a pretty universal problem. Any help you can provide would be most appreciated.

boolean saving;
int r1 = 10;
int r2 = 20;

void setup(){
 size(400,400);
 background(255);
}

void draw(){
  rectMode(CENTER);
  fill(random(0,50));
  rect(random(width),random(height),random(r1,r2),random(r1,r2));
  
  if(saving){
   saveFrame("frame-####.png"); 
  }
}

void keyPressed(){
 saving = !saving; 
}
1 Like

I take it you email your app as an attachment? In my experience (with various mail services) I can’t even send attachments which might harm someones computer (such as .exe files). It’s a far stretch, but perhaps, behind the curtains, your email scan service is affecting your program to reduce risk for other computers?

Have you tried using a service such as https://wetransfer.com/? I use this for sharing files which can’t be send through mail.

EDIT: Missed the ‘file sharing services’ part you mentioned, guess WeTransfer won’t work either in that case

Tested your code with Processing 3.5.3 on Windows 10. Exported it as 64-bit and send it via weTransfer. Downloaded it on two different computers and in both cases the sameFrame seems to work.

1 Like

Thanks for replying and for looking into it.

Yes, I’m emailing a zipped folder containing the app as an attachment - sometimes with the source code also included, sometimes without. It didn’t seem to make a difference.

That’s interesting that it’s working for you on Windows. I’ve just exported another application (this time without Java included), emailed it to myself and attempted to run it, and I’m still seeing the same issue (no frames exported). I’m working on OSX High Sierra, but have also tested this on Mojave with the same issue. I’ve also tried updating/reinstalling Java via Homebrew, but still no luck.

I had tried Wetransfer previously (as well as Dropbox pro, Google drive, Tresorit, and a few others), but have tried it again to check - still the same issue.

I’ve also run a search on my machine for any recently created file with “frame-” and “.png” as soon as attempting to export, to make sure they’re not being saved to a different location, but there’s nothing showing up.

Perhaps a Mac-only issue? Unfortunately I don’t have a convenient Windows or Linux machine for testing. I’ll attach the version I just exported for all systems. If anyone (Linux, Mac, or Windows) can test this out for me I’d really appreciate it. If I zip the application folder, move it to another machine via USB, unzip and run, there are no issues. As soon as I email it or similar, it won’t work on OSX.

1 Like

Please see the repository below.
https://github.com/JoePoc/ExportTest

I have just tried downloading from here and running without any luck exporting.

There also seems to be a similar issue with the Hamoid VideoExport library. I have built the basic example, zipped the app, unzipped it and run it (without emailing) and it runs correctly. When I wetransfer the zipped app to myself, download it, unzip it and run, the app freezes seemingly before getting to draw().

I can create a fresh repository for the VideoExport demo if that would help.