Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reconstructing a jpg from a blob
Message
 
To
04/09/2004 03:45:39
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
00939410
Message ID:
00939507
Views:
9
No help, I've tried several solutions and it's not happening. Maybe the file is corrupted. I'm going to try to get another file.

John



>Hi John.
>
>I dont think you can use FILETOSTR() because of possible char convertions etc. Instead you can use the Binary Memo field of a table or cursor. Create a table/cursor with such a field. Then use APPEND MEMO to read in an image file and COPY MEMO to write it out to another file.
>
>hth
>
>
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform