# MPO ByteArray Fun Time

**URL:** <https://forum.kirupa.com/t/mpo-bytearray-fun-time/324515>\
**Category:** flash\
**Created:** [August 25, 2011, 2:26am UTC](https://forum.kirupa.com/t/mpo-bytearray-fun-time/324515 "2011-08-25T02:26:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenBart](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@BenBart](https://forum.kirupa.com/u/BenBart)\
**Post date:** [August 25, 2011, 2:26am UTC](https://forum.kirupa.com/t/mpo-bytearray-fun-time/324515/1 "2011-08-25T02:26:43Z")

</div>

So, I’m trying to make an MPO encoder. Basically, it takes two BitmapData instances and encodes them as two Exif JPEGs in sequence.

I’m having trouble understanding some bits and pieces of the file structure of an MPO file, and also the differences between the AS3 CoreLabs JPEG encoder which is JFIF and how I should change it to be Exif.

I guess what I’m wondering is where I can find additional resources, or if anyone knows what I’m missing.

Here’s what I have so far:

MPO file specification Doc:  
www.cipa.jp/english/hyoujunka/kikaku/pdf/DC-007\_E.pdf

Exif Specification Doc:  
www. **exif**.org/ **Exif** 2-2.PDF

Exif on WikiPedia:

> **[Exif](https://en.wikipedia.org/wiki/Exchangeable_image_file_format)**
>
> Exchangeable image file format (officially Exif, according to JEIDA/JEITA/CIPA specifications) is a standard that specifies the formats for images, sound, and ancillary tags used by digital cameras (including smartphones), scanners and other systems handling image and sound files recorded by digital cameras. The specification uses the following existing file formats with the addition of specific metadata tags: JPEG discrete cosine transform (DCT) for compressed image files, TIFF Rev. 6.0 (RGB Th...

Exif explanation (most helpful so far):  
[http://gvsoft.homedns.org/exif/exif-explanation.html](http://gvsoft.homedns.org/exif/exif-explanation.html)

Here’s where I’m stuck, using an MPO file as an example, the first couple bytes look like this:

FFD8 //SOI  
FFE1 //APP1 marker attribute start “application marker”  
13AC //app1 data size – “5036” (5037 I see the EO1 marker)  
4578 69660000 //Exif Header “Exif…”  
4D4D // MM size of exif header?? “19789” doens’t point to anything meaningful for me. I’m not sure what this is!

The last word has got me stuck… any ideas?
