Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC8.0
How to convert the JPEG image to blob?
Posted 11-May-11 1:02am
Comments
S Mewara at 11-May-11 6:26am
   
Elaborate.
AspDotNetDev at 11-May-11 19:28pm
   
Not sure, but this is how you convert blob to JPEG image: http://4.bp.blogspot.com/_W3bLkLDR-6o/TAkRCcm3J5I/AAAAAAAAHX8/zY0wa64j_AU/s1600/Copia+de+The_Blob_1988.jpg
Archit9373284448 at 12-May-11 3:23am
   
what was that?
AspDotNetDev at 12-May-11 23:37pm
   
It's... the Blob!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

your image (physical file is already a blob)...you can import this in the memory RAM
 
FileStram imgStream = File.OpenRead("C:\\photos\me.jpg");
byte[] blob = new byte[imgStream.Length];
imgStream.Read( blob, 0, (int)imgStream.Length);
 
imgStream.Dispose( );
 
Now blob array contains the binary view of your picture...
  Permalink  
v2
Comments
Gokulnath007 at 12-May-11 8:59am
   
I have tried with this method, but only 4 symbols are there in it.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

A jpeg encoded image is a BLOB, as is almost anything else.
  Permalink  
Comments
Gokulnath007 at 11-May-11 6:43am
   
I need to get the JPEG image's binary bits so that it can be saved in to the blob field of the database.
Niklas Lindquist at 11-May-11 6:46am
   
Don't you have a pointer to the jpeg image? That will be the BLOB.
Gokulnath007 at 11-May-11 6:56am
   
How to get the pointer for the JPEG image?
Niklas Lindquist at 11-May-11 7:26am
   
Don't you have a jpeg image? Is it located on disk? If so read the entire file to a chunk of memory. There you have it. The BLOB.
Gokulnath007 at 12-May-11 8:59am
   
I have tried with this method, but only 4 symbols are there in it.
Niklas Lindquist at 13-May-11 3:28am
   
What are you talking about? What symbols?
1: Where is your image?
2. What exactly is it that makes it hard to save it to the database?
 
Maybe you should update your question with a small code snippet, showing what you have done?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Kornfeld Eliyahu Peter 275
1 Maciej Los 214
2 Sergey Alexandrovich Kryukov 200
3 King Fisher 185
4 OriginalGriff 163
0 OriginalGriff 6,223
1 DamithSL 4,724
2 Maciej Los 4,196
3 Kornfeld Eliyahu Peter 3,894
4 Sergey Alexandrovich Kryukov 3,496


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 11 May 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100