Re: [GM-help] Problem with MingW in Image::read
Swiss army knife of image processing
Brought to you by:
bfriesen
From: Vishakh T. <vis...@gm...> - 2006-05-02 14:51:50
|
Hi Bob Actually I am reading from a PNG file at the moment. The thing is that when I use VC++ with ImageMagick the same code works perfectly, but it fails completely when we try with GraphicsMagick compiled with MingW. It is the same test code. I have also tried using ffmpeg. But it has a memory corruption when we use it under windows, It crashes. at random. On 5/2/06, Bob Friesenhahn <bfr...@si...> wrote: > > On Tue, 2 May 2006, Vishakh Thomas wrote: > > printf(".%d", i); > > Blob blob1(picture, 480*336*8); > > printf("..%d", i); > > > > img1.read(blob1, geo); > > printf("...%d", i); > > imgList.push_back(img1); > > printf("....%d", i); > > imgList.push_back(img1); > > } > > writeImages(imgList.begin(), imgList.end(), "c:/flom-test.mpeg"); > > > > It crashes at the line: img1.read(blob1, geo); > > > > I have also tried img1.read(filename); But that also crashes. > > I suspect that "crashes" in this case really means that read() threw a > C++ exception and you did not include any try/catch block so the C++ > run-time invoked unhandled() which in turn invokes abort(). The > exception is likely occuring since the format auto-detect code did not > recognize the data. > > The approach you are using is intended for formatted data (like a > file) rather than raw raster data. You will likely encounter more > success if you use a different read() method. For example > > img1.read(480,336,"RGB",CharPixel,(const void *)picture); > > This example assumes that the data occurs in "RGB" format but maybe > the data is in some other order (e.g. "BGR"). > > With this approach, you don't need to use the Blob class at all. You > should definitely add C++ exception handling so that if an exception > is thrown, you can catch it and print its what() string. > > > The main problem is that I have an OpenGL project that loads a series o= f > > images stored in a proprietary file using a QT class. This class QImage > can > > return the raw RGB format of each image which i need to convert into an > MPEG > > file. Any inputs on how I can do it? > > GraphicsMagick is not the best tool for creating MPEG since it buffers > all the frames in memory and then needs to write a huge number of > temporary files as input to 'mpeg2encode'. Using ffmpeg (or a library > for ffmpeg) would be much more effective. > > Bob > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Bob Friesenhahn > bfr...@si..., http://www.simplesystems.org/users/bfriesen= / > GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ > -- -- VPT |