tags:

views:

19

answers:

1

I have a UTF-8 encoded file and would like to pop an output stream on the image part of the file. Any suggestions on how to filter everything out of the stream except the image data?

+2  A: 

Scan the file for the various image file magic numbers, and attempt decoding from that position.

Ignacio Vazquez-Abrams
Do you think the image is at the end of the file? I would find the magic numbers for the beginning and then stop at the end of the file or is there also magic termination characters?
Noah Seidman
Decoding will stop when the image processing library stops it.
Ignacio Vazquez-Abrams