Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
JPEG file structure. I want a detailed explanation of .jpg file structure with an example?
i need to develop a php code for reading pixels from a jpg, for that I must know file structure of jpg.please help.
Thanks
Hi Chris,
thanks but I've already checked that link.
I wanted to learn about file structure so that i can read pixel value (color values) from jpg.
thanks anyway.
2 Answers
- 1 decade agoFavorite Answer
http://schmidt.devlib.org/file-formats/jpeg-image-...
Good luck with that one. I hope you like math ;)
A better solution would be to "not re-invent the wheel" and find a library that is already developed for handling jpeg files (like the one built into PHP).
Would also be helpful if you explained what you were doing and hoped to accomplish. If you just want to tell if an image is really a jpeg file just by reading the first few bytes, then:
0xff 0xd8 at file offset 0x00 are the magic bytes at the beginning of the file.
When opening jpegs with notepad, I notice they all seem to have JFIF at the beginning.
Also, see: