then you have to find hight and width marker of jpeg that is [ffco][ffc0].
after finding ffcoffc0 in binary formate, the the four,five bytes are hight and six and seven bytes are width.
eg: [ff co]c0] d8 c3 c2 [ff da] [00 ff] | | | | ->height ->width int position; unsigned char len_con[2]; /*Extract start of frame marker(FFCOFFC0) of width and hight and get the position*/ for(i=0;i<FILE_SIZE;i++) { if((image_buffer[i]==FF) && (image_buffer[i+1]==c0) ) { position=i; } } /*Moving to the particular byte position and assign byte value to pointer variable*/ position=position+5; *height=buffer_src[position]<<8|buffer_src[position+1]; *width=buffer_src[position+2]<<8|buffer_src[position+3]; printf("height %d",*height); printf("width %d",*width);