Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ private void adjustImageScaling() {
addDistance(textureCords[6], distHorizontal), addDistance(textureCords[7], distVertical),
};
} else {
if (rotation == Rotation.ROTATION_270 || rotation == Rotation.ROTATION_90) {
ratioWidth = ratioWidth + ratioHeight;
ratioHeight = ratioWidth - ratioHeight;
ratioWidth = ratioWidth - ratioHeight;
}
cube = new float[]{
CUBE[0] / ratioHeight, CUBE[1] / ratioWidth,
CUBE[2] / ratioHeight, CUBE[3] / ratioWidth,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class Camera2Loader(private val activity: Activity) : CameraLoader() {
?.getOutputSizes(ImageFormat.YUV_420_888)

val orientation = getCameraOrientation()
val maxPreviewWidth = if (orientation == 90 or 270) viewHeight else viewWidth
val maxPreviewHeight = if (orientation == 90 or 270) viewWidth else viewHeight
val maxPreviewWidth = if (orientation == 90 || orientation == 270) viewHeight else viewWidth
val maxPreviewHeight = if (orientation == 90 || orientation == 270) viewWidth else viewHeight

return outputSizes?.filter {
it.width < maxPreviewWidth / 2 && it.height < maxPreviewHeight / 2
Expand Down