Page 1 of 1

From Blob with MPG to PPM Image failure

Posted: 2007-09-03T07:55:09-07:00
by jrosinski
Hello,

i have frames from an imx-Movie (MPG with I-Frame only) and want do get the frames as ppm-Image with Magick++.

First i read it in a blob and then i want to generate an Image from it:

Blob blob(buffer, length);
Image image(buffer);
image.write("test.jpg");

But the Image is empty. When i manipulate the delegates, so that i can see status (use mpeg2decoder without -q) of the decoder i see, that the Image-constructor use mpeg2decoder to generate an ppm-Image in /tmp/...
But in the next step the constructor doesn't read this created temp-Image in so it generates an empty one.

When i use instead a

image.read("/tmp/filename.ppm");

before, it functions correctly.

What i made wrong?

Re: From Blob with MPG to PPM Image failure

Posted: 2007-09-05T19:58:59-07:00
by anthony
You need to convert the blob to an image, not just use it or read it.
See API manual.

Re: From Blob with MPG to PPM Image failure

Posted: 2007-09-10T05:51:43-07:00
by jrosinski
I just tried something like

image.magick("JPG");

but also didn't create a correct image, which i can write to disk.

Can you post a quick solution please?