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

Remove java.awt dependency #485

Merged
merged 1 commit into from
Jun 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Source/com/drew/metadata/mov/atoms/TrackHeaderAtom.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.drew.metadata.mov.QuickTimeDirectory;
import com.drew.metadata.mp4.Mp4Directory;

import java.awt.*;
import java.io.IOException;

/**
Expand Down Expand Up @@ -57,10 +56,10 @@ public TrackHeaderAtom(SequentialReader reader, Atom atom) throws IOException {

public void addMetadata(QuickTimeDirectory directory) {
if (width != 0 && height != 0 && directory.getDoubleObject(Mp4Directory.TAG_ROTATION) == null) {
Point p = new Point(matrix[1] + matrix[4], matrix[0] + matrix[3]);
double theta = Math.atan2(p.y, p.x);
double degree = Math.toDegrees(theta);
degree -= 45;
double x = matrix[1] + matrix[4];
double y = matrix[0] + matrix[3];
double theta = Math.atan2(y, x);
double degree = Math.toDegrees(theta) - 45;
directory.setDouble(QuickTimeDirectory.TAG_ROTATION, Math.abs(degree));
}
}
Expand Down