Link to home
Start Free TrialLog in
Avatar of ang3lus
ang3lus

asked on

find length of file depend on end marker

Hi

after i run this command to search about end marker of jpeg file:

xxd image.raw | grep -i "ffd9" | head -n 7 ===>

0082560 2903 9068 ffd9 4bb1 f6d2 c69c 1a4c 7195      (..h[.K......nq

how i can calculate length of jpeg file include footer depend on output ?




Avatar of raysonlee
raysonlee

Search for FFD8 which is the start of image and FFD9 which is the end of image, you'll then get the image size. Refer to detail JPG format here http://en.wikipedia.org/wiki/JPEG for more information.
Avatar of ang3lus

ASKER


there is no possible to find length of file depend only on output.

cause the
the solution of above question is from output :

ffd9 end at 0082565 and the length of file is 0082566.

=================
I am not understand how 0082565 has been calculated and how length become 0082566( 0082565 +1)

thanks
ASKER CERTIFIED SOLUTION
Avatar of raysonlee
raysonlee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ang3lus

ASKER

many Thanks

you are helping me alot