I need to find the size of a JPEG (JFIF) image. The image is not saved as a stand-alone file, so I can\'t use GetFileSize or any other API such this one (the im
Since you don't have any language posted, I'm not sure that this will work, but:
Can you Stream.Seek(0, StreamOffset.End); and then take the stream's position?
Please be specific about what framework you are using.
The real fact of the matter is, if the file header doesn't specify the expected size, you have to seek (or read) to the end of the image.
EDIT
Since you are trying to stream multiple files, you will want to use a streaming friendly container format.
OGG should be a nice fit for this.
JPEG is actually already streaming friendly, but you must guarantee that each file has a valid terminator before sending it down the stream or else you run the risk of crashing your app with unexpected input.