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 get the size of the JPEG file in order to read it as binary?
Posted 17-May-11 3:55am
Comments
Manfred R. Bihy at 17-May-11 8:58am
   
Do you intend to read the image as binary data or do you want the binary equivalent of the file content?
Gokulnath007 at 17-May-11 9:34am
   
I want to know the size of the jpeg file and then i want to read it completely.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Size of a jpeg file is just the size of the file, use anything that can be used to find file size, such as:
http://msdn.microsoft.com/en-us/library/aa364955%28v=vs.85%29.aspx[^]
  Permalink  
Comments
SAKryukov at 17-May-11 18:59pm
   
Correct answer, a 5.
--SA
Niklas Lindquist at 18-May-11 11:55am
   
Fived.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Open the file using CreateFile()
 
get the file size with GetFileSize()
 
and then Read the file using ReadFile()
 
once finished close the file using CloseHandle();
 
search for the functions on Google so you can learn the parameters. Smile | :)
  Permalink  
v2
Comments
SAKryukov at 17-May-11 18:59pm
   
Correct, a 5.
--SA
SafarTimura at 18-May-11 4:41am
   
thanks :)
Niklas Lindquist at 18-May-11 11:55am
   
That's a good answer. 5.
SafarTimura at 18-May-11 12:04pm
   
thanks I tired to offer an approach rather than code for him to copy.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 485
1 OriginalGriff 310
2 Shweta N Mishra 244
3 Mathew Soji 225
4 BillWoodruff 200
0 OriginalGriff 6,153
1 Sergey Alexandrovich Kryukov 5,758
2 DamithSL 4,958
3 Manas Bhardwaj 4,539
4 Maciej Los 3,735


Advertise | Privacy | Mobile
Web03 | 2.8.1411019.1 | Last Updated 17 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