Skip to content
Closed
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
10 changes: 5 additions & 5 deletions tns-core-modules/image-asset/image-asset.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ export class ImageAsset extends common.ImageAsset {

var calculateAngleFromFile = function (filename: string) {
let rotationAngle = 0;
const ei = new android.media.ExifInterface(filename);
const orientation = ei.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, android.media.ExifInterface.ORIENTATION_NORMAL);
const ei = new android.support.media.ExifInterface(filename);
const orientation = ei.getAttributeInt(android.support.media.ExifInterface.TAG_ORIENTATION, android.support.media.ExifInterface.ORIENTATION_NORMAL);

switch (orientation) {
case android.media.ExifInterface.ORIENTATION_ROTATE_90:
case android.support.media.ExifInterface.ORIENTATION_ROTATE_90:
rotationAngle = 90;
break;
case android.media.ExifInterface.ORIENTATION_ROTATE_180:
case android.support.media.ExifInterface.ORIENTATION_ROTATE_180:
rotationAngle = 180;
break;
case android.media.ExifInterface.ORIENTATION_ROTATE_270:
case android.support.media.ExifInterface.ORIENTATION_ROTATE_270:
rotationAngle = 270;
break;
}
Expand Down
10 changes: 5 additions & 5 deletions tns-core-modules/image-source/image-source.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,17 @@ export class ImageSource implements ImageSourceDefinition {

private setRotationAngleFromFile(filename: string) {
this.rotationAngle = 0;
const ei = new android.media.ExifInterface(filename);
const orientation = ei.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, android.media.ExifInterface.ORIENTATION_NORMAL);
const ei = new android.support.media.ExifInterface(filename);
const orientation = ei.getAttributeInt(android.support.media.ExifInterface.TAG_ORIENTATION, android.support.media.ExifInterface.ORIENTATION_NORMAL);

switch (orientation) {
case android.media.ExifInterface.ORIENTATION_ROTATE_90:
case android.support.media.ExifInterface.ORIENTATION_ROTATE_90:
this.rotationAngle = 90;
break;
case android.media.ExifInterface.ORIENTATION_ROTATE_180:
case android.support.media.ExifInterface.ORIENTATION_ROTATE_180:
this.rotationAngle = 180;
break;
case android.media.ExifInterface.ORIENTATION_ROTATE_270:
case android.support.media.ExifInterface.ORIENTATION_ROTATE_270:
this.rotationAngle = 270;
break;
}
Expand Down
15 changes: 15 additions & 0 deletions tns-core-modules/ui/frame/transition-definitions.android.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@

// Definitions for Android API lvl 21 transitions
declare module android {
export module support {
export module media {
export class ExifInterface {
public static TAG_ORIENTATION: number;
public static ORIENTATION_NORMAL: number;
public static ORIENTATION_ROTATE_90: number;
public static ORIENTATION_ROTATE_180: number;
public static ORIENTATION_ROTATE_270: number;

constructor(filename?: string);

public getAttributeInt(attr: number, attr2: number): number;
}
}
}
export module transition {
export abstract class Transition extends java.lang.Object {
addListener(transition: Transition.TransitionListener): Transition;
Expand Down