Skip to content

Commit

Permalink
Merge pull request #485 from drewnoakes/remove-awt-dependency
Browse files Browse the repository at this point in the history
Remove java.awt dependency
  • Loading branch information
drewnoakes authored Jun 14, 2020
2 parents b266e0a + 23ae995 commit 9874be3
Showing 1 changed file with 4 additions and 5 deletions.
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

0 comments on commit 9874be3

Please sign in to comment.