1

I'm always wondered where to find rules to encode known file formats, for example: .jpg, .png, .mpg programmatically. How to write these binary formats? Some years ago, when I surfed phpBB scripts, I found that they for example don't use any gd or imagemagick, they write it in binary way. Not only for php, but for other languages as well?

1
  • Internet is the source of such a knowledge. Just try google for "png file format". You'll be surprized Commented Jan 21, 2011 at 10:12

2 Answers 2

1

Video encoding is a whole different issue, and orders of magnitude more complex... Although I imagine one can already spend a lot of time understanding the JPEG format in depth.

Usually, looking up the desired format's article in Wikipedia will either give you the format definition, or a link to the specification.

Sign up to request clarification or add additional context in comments.

Comments

0

Do you mean the "data:" URI specification? http://en.wikipedia.org/wiki/Data_URI_scheme

<img src="data:image/gif;base64,AAAA" alt="blank">

Simply base64 encode your image, set the correct mime type, and have fun.

Note that this defeats browser caching of images, and base64-encoding leads to roughly 4/3 size increase of the data transfer required. So it's not an obvious performance win.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.