Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected MPO marker order #6839

Closed
wants to merge 1 commit into from
Closed

Conversation

radarhere
Copy link
Member

Helps #6720

In "5.1. Basic MP File Structure" of the specification, the order of the markers is SOI, APP1 and then APP2.

Testing Pillow at the moment, JPEG's APP0 marker comes immediately after SOI.

This PR stops passing encoderinfo["extra"] data to JpegImagePlugin, and instead has MpoImagePlugin write out the markers by itself, so that SOI is first, then the optional APP1 EXIF marker, then APP2, and then the data created by JpegImagePlugin.
I've also given up on the idea of writing data to file and then rewinding to populate the offsets to each frame later, and am instead using io.BytesIO to store the JPEG data until the offsets have been calculated, and then write to file.

@radarhere radarhere marked this pull request as draft December 29, 2022 12:25
@radarhere radarhere marked this pull request as ready for review December 29, 2022 12:52
@radarhere radarhere closed this Dec 29, 2022
@radarhere radarhere deleted the mpo branch December 29, 2022 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant