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

Extend orientation / rotation support for files on load #4781

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

OtterBotSociety
Copy link

Potentially fixes #4555, #4738, #3479 by adding support to parse out rotation frame side_data from FFMPEG / ffprobe

I manually tested this with a small set of reproducing JPEG images, but have not yet had the chance to try out other image types.

Thanks to @onlyhooops for their repro images, and to @zhyu for calling out the ffprobe tooling.

@@ -147,7 +147,7 @@ func (f *FFProbe) Path() string {

// NewVideoFile runs ffprobe on the given path and returns a VideoFile.
func (f *FFProbe) NewVideoFile(videoPath string) (*VideoFile, error) {
args := []string{"-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", "-show_error", videoPath}
args := []string{"-v", "quiet", "-print_format", "json", "-count_frames", "-show_format", "-show_streams", "-show_entries", "side_data=rotation", "-show_error", videoPath}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

count_frames here is probably not necessary

@onlyhooops
Copy link

Thank you for fixing this issue, it makes the project even more perfect.🎉

@zhyu
Copy link

zhyu commented Apr 23, 2024

JFYI, this repo contains example images with all possible EXIF orientation values.

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.

[Bug Report] Some images have the wrong proportions on image wall
3 participants