Can't save a picture on Mac OS

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Can't save a picture on Mac OS

Postby FemUser » Fri Sep 01, 2017 9:12 am

I am trying to save a picture with FreeCAD 0.17. I compiled from the latest version I could get, however It seems that I cannot save a picture.
<unknown exception traceback><type 'exceptions.RuntimeError'>: Cannot save null image.
I also tried this on windows 0.17 version and got the same issue. Any one knows of a workaround?
User avatar
PrzemoF
Posts: 2649
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Can't save a picture on Mac OS

Postby PrzemoF » Fri Sep 01, 2017 10:40 am

Can you describe exactly what do you do? Like "File->export", what is selected and so on. I want to test in on linux. Also post your model if it's possible.
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: Can't save a picture on Mac OS

Postby FemUser » Fri Sep 01, 2017 10:41 am

I found a previous post here, this subject looks like it happens from time to time:

https://forum.freecadweb.org/viewtopic. ... 44#p104437

It looks like they found a solution maybe for a different version them MAC. I decided to try it out anyway, however I cannot figure out where I can place the Boolean key. Maybe in FreeCAD 0.14 there was a place for it but now it doesn't exist.

Preferences > Document
wmayer wrote:
As you solved the issue while I was typing I decided not to reject the content in case someone else has a similar issue.

Open the parameter editor and go to the group: Preferences > Document:

1. There create a boolean key DisablePBuffers and set it to true. Try again.
2. If it doesn't work set the value to false. Try again.
3. If it doesn't work create the boolean key CoinOffscreenRenderer and set it to true. Try again.
4. If it doesn't work then close FreeCAD and set the environment variables:

Code: Select all

COIN_GLXGLUE_NO_PBUFFERS=1
COIN_GLXGLUE_NO_GLX13_PBUFFERS=1
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: Can't save a picture on Mac OS

Postby FemUser » Fri Sep 01, 2017 10:48 am

I have a solid built with Part. A cube. Then I go to Tools -> Save picture
Place a name there and hit save.

I don't do nothing that fancy. I tried also the option on the advanced panel.
Attachments
save1.jpg
save1.jpg (204.26 KiB) Viewed 1430 times
save.jpg
save.jpg (217.82 KiB) Viewed 1430 times
chrisb
Posts: 18042
Joined: Tue Mar 17, 2015 9:14 am

Re: Can't save a picture on Mac OS

Postby chrisb » Fri Sep 01, 2017 11:49 am

This has been a problem since very long time, I reported it months ago. As workaround I use Mac screenshots with CMD+Shift+4.
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: Can't save a picture on Mac OS

Postby FemUser » Fri Sep 01, 2017 12:45 pm

I was trying to take a high resolution picture. I also can take a screenshot, but for my needs I really require more print resolution... Chrisb thanks anyway. In 2014 they found a workaround to this I was wondering and hopping that in the 0.17 version there was a workaround.
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: Can't save a picture on Mac OS

Postby FemUser » Fri Sep 01, 2017 1:01 pm

It looks like the parameter location is on tools in version 0.17, however none of the variables worked.
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: Can't save a picture on Mac OS

Postby FemUser » Fri Sep 01, 2017 1:32 pm

I also found this past link. https://www.freecadweb.org/tracker/view.php?id=2282
The message comes from Qt: https://github.com/openwebos/qt/blob/ma ... n.cpp#L295
So, it's basically a problem with your graphic driver that you can't use pixel buffer.

It has nothing to do with the format in which you want to save the image because the problem appears much earlier when an image should be created by off-screen rendering.

So try this: go to Tools > Parameter editor. There go to the group BaseApp > Preferences > Document and create a boolean key called "DisablePBuffers" and set it to true. Try saving again an image.

If this doesn't work then set the above value to false (or remove it) and create a second key "CoinOffscreenRenderer" and set it to true.

If this doesn't work then try to get a preview version of 0.16. And if even this fails then there is nothing more we can do about it since it's clearly not a bug in FreeCAD but related to the driver.

However, in FreeCAD we can avoid to save an empty file, at least.

mrpace2

2015-09-30 12:26

reporter ~0006472
I tried the workarounds you suggested. The parameters did not resolve the issue with 0.15. So I tried 0.16-dev. Without the parameters, 0.16-dev out of the box failed with a red error message in the status bar: "Cannot save null image". Same for DisablePBuffers=true. However, 0.16-dev works with CoinOffscreenRenderer=true. Thanks for proposing the workaround.

Let me know if there is anything else you want me to try or log. Whatever the issue is, it did not surface with 0.14.

wmayer

2015-09-30 21:08

administrator ~0006473
> Let me know if there is anything else you want me to try or log. Whatever the issue is, it did not surface with 0.14.
Thanks but there is nothing more to test. With v0.15 there is no way to get it working (unless a driver update may fix the issue).

v0.16 re-enables OpenInventor's (Coin3D) off-screen renderer which apparently uses old OpenGL calls for pixel buffer while Qt uses new OpenGL functions which don't work properly with your driver.

As said there is nothing more we can do from our side. So, I close the ticket as solved.
User avatar
FemUser
Posts: 133
Joined: Wed Aug 23, 2017 6:45 pm

Re: Can't save a picture on Mac OS

Postby FemUser » Fri Sep 01, 2017 4:20 pm

Got a workaround. The previous post solved my problem.

Go to Tools -> Edit Parameters... ->Base App -> Document -> and add the following Boolean variable:

CoinOffscreenRenderer = true

My comment: This should be for me a bug since many people won't have this feature working out of the box. Why not have freeCAD generate automatically this variable for the hardware configurations that yield the error?

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11939 (Git)
Build type: Release
Branch: master
Hash: 6e7952ec672895900eec0c2a25807b25befba818
Python version: 2.7.13
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedStates (en_US)
chrisb
Posts: 18042
Joined: Tue Mar 17, 2015 9:14 am

Re: Can't save a picture on Mac OS

Postby chrisb » Fri Sep 01, 2017 9:07 pm

The Path to Document is slightly different here: Tools -> Edit Parameters... ->Base App -> Preferences -> Document ->
I added the parameter as boolean value, but I still get the Error message

<unknown exception traceback><type 'exceptions.RuntimeError'>: Cannot save null image.

I will retry - without much hope - when I have updated my version.

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11919 (Git)
Build type: Release
Branch: (detached from fccb5db)
Hash: fccb5dbc87b919164610296adc96aa8b4fe4825e
Python version: 2.7.13
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)