grahamrow / Muview2

3D visualization of micromagnetic simulation data from Mumax or OOMMF
GNU General Public License v2.0
41 stars 8 forks source link

Save fix #21

Closed syockit closed 7 years ago

syockit commented 8 years ago

Minor papercut fixes for save image & save image sequence.

syockit commented 8 years ago

Oh, forgot to mention that I fixed the save routine so that the image type is inferenced from the file extension. I'm assuming that there's no path to messing that up, as the "Save Image" dialog automatically adds the extension according to selected filter. Wait, let me check…

…oops, there seems a way to abuse it. If filename contains non-image registered extension, it will refuse to save. If filename is an image extension that Qt recognizes, it will be saved using that format instead (managed to do it with bmp and tif). I suppose I need to revert that particular change.

grahamrow commented 8 years ago

Well either way it's better than the current version (which will save files with the wrong suffix).

I'm actually planning to work on a feature to automatically save to movies directly, though I can't decide whether to simply call shell commands on some temporary files or actually use the ffmpeg API directly (the latter being more foreboding). Thoughts?

syockit commented 8 years ago

While the prospect of being able to feed frames directly to the encoder without temporary files sounds tempting, having extra dependency might be a headache. Or are you going to embed the whole library (ffmpeg or libav?) in the project?

syockit commented 8 years ago

I'm sorry, I couldn't find way to workaround this without overriding the file browser. I think I'll come up with a error popup when the image fails to save, by checking if the filename it tries to save to is not created. (Of course, the caveat is the popup won't appear if there's already a file by the same name e.g. "image.txt")