Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reconstructing a jpg from a blob
Message
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Title:
Reconstructing a jpg from a blob
Miscellaneous
Thread ID:
00939410
Message ID:
00939410
Views:
59
I've got a small problem trying to reconstruct a jpg file from a single stream text file. VFP appears to be adding some chars to the mix. To test this hypothesis, I took a good jpg file and read it in to a var using filetostr.

lcfile=filetostr('x.jpg')
Then I created another file using
strtofile(lcfile,'123.jpg',1)
strtofile(lcfile,'123.jpg',1)
strtofile('this is garbage','123.jpg',1)

I would have thought I should be able to write a routine that looked for the jpeg's (SOI) Start of Image [ÿØÿà] and (EOI) End of Image [ÿÙ] and pull the image from the stream. However, this is not working. Even if I get a string using the above search criteria, VFP is adding to the mix.

Has anyone else tackled this problem?

John
John Harvey
Shelbynet.com

"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright
Next
Reply
Map
View

Click here to load this message in the networking platform