Hi again:

I've found the problem involving saving JPEG files from the example osgscreencapture. Currently, the "writeImageFile" lines are commented out, and this may lead to thinking that uncommenting them will work and make the file "test_1.jpg". But this is not actually true, since: - The pixelFormat that WindowCaptureCallback use to recover the framebuffer is either GL_BGRA or GL_BGR.
- JPEG pluggin can only save GL_LUMINANCE, GL_ALPHA or GL_RGB pixel formats.

A change in the WindowCaptureCallback pixel format to GL_RGB makes the file saving work.

Iñaki García escribió:
Hi everybody:

I am trying to capture images to disk, using the WindowCaptureCallback of the example osgscreencapture, but I became locked in the osgDB::writeImageFile (callback is called, I hope it creates an image from readPixels). But I always get 0KB test_1.jpg file.

The error output of the operation is:
Error writing file test_1.jpg: Warning: Error in writing to "test_1.jpg".
Error writing file test_1.jpg: Warning: Could not find plugin to write image to file "test_1.jpg".

And I don't understand it. "osgdb_jpeg.dll" is in a directory in the PATH, I've also copied there jpeg62.dll in case it's needed. The oddest thing is that if I do:
osg::Image* img = osgDB::readImageFile("captura I.JPG");
osgDB::writeImageFile(*img, "captura_copy.jpg");
in other places (i.e. after creating the CompositeViewer, before realize it), it loads the image and stores it again.

But writeImageFile fails in WindowCaptureCallback::contextData::readPixels. Any idea of what's happening? May that warning log be spawned if the image is badly captured?

Sorry for the probably obvious question, but it's been two days since I'm trying to solve the riddle.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to