Skip to content

Commit 92e044b

Browse files
committed
Renamed MagickOrientation to Orientation.
1 parent 3b8f267 commit 92e044b

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

src/enums/magick-orientation.ts src/enums/orientation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* Specified the photo orientation of the image.
88
*/
9-
export const MagickOrientation = {
9+
export const Orientation = {
1010
/**
1111
* Undefined.
1212
*/
@@ -53,4 +53,4 @@ export const MagickOrientation = {
5353
LeftBottom: 8
5454
} as const;
5555

56-
export type MagickOrientation = typeof MagickOrientation[keyof typeof MagickOrientation];
56+
export type Orientation = typeof Orientation[keyof typeof Orientation];

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ export * from './enums/kernel';
5858
export * from './enums/log-event-types';
5959
export * from './enums/magick-error-severity';
6060
export * from './enums/magick-format';
61-
export * from './enums/magick-orientation';
6261
export * from './enums/morphology-method';
6362
export * from './enums/noise-type';
63+
export * from './enums/orientation';
6464
export * from './enums/paint-method';
6565
export * from './enums/pixel-channel';
6666
export * from './enums/pixel-intensity-method';

src/magick-image-info.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { Density } from "./types/density";
1010
import { Interlace } from "./enums/interlace";
1111
import { MagickFormat } from "./enums/magick-format";
1212
import { MagickImage } from "./magick-image";
13-
import { MagickOrientation } from "./enums/magick-orientation";
1413
import { MagickReadSettings } from "./settings/magick-read-settings";
14+
import { Orientation } from "./enums/orientation";
1515

1616
export interface IMagickImageInfo {
1717
/**
@@ -47,7 +47,7 @@ export interface IMagickImageInfo {
4747
/**
4848
* Gets the orientation of the image.
4949
*/
50-
readonly orientation: MagickOrientation;
50+
readonly orientation: Orientation;
5151

5252
/**
5353
* Gets the JPEG/MIFF/PNG compression level.
@@ -74,7 +74,7 @@ export class MagickImageInfo implements IMagickImageInfo {
7474
private _format: MagickFormat = MagickFormat.Unknown;
7575
private _height: number = 0;
7676
private _interlace: Interlace = Interlace.Undefined;
77-
private _orientation: MagickOrientation = MagickOrientation.Undefined;
77+
private _orientation: Orientation = Orientation.Undefined;
7878
private _quality: number = 0;
7979
private _width: number = 0;
8080

@@ -102,7 +102,7 @@ export class MagickImageInfo implements IMagickImageInfo {
102102
return this._interlace;
103103
}
104104

105-
get orientation(): MagickOrientation {
105+
get orientation(): Orientation {
106106
return this._orientation;
107107
}
108108

src/magick-image.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ import { MagickErrorInfo } from './types/magick-error-info';
4949
import { MagickFormat } from './enums/magick-format';
5050
import { MagickGeometry as MagickGeometry, IMagickGeometry } from './types/magick-geometry';
5151
import { MagickImageCollection, IMagickImageCollection } from './magick-image-collection';
52-
import { MagickOrientation } from './enums/magick-orientation';
5352
import { MagickReadSettings } from './settings/magick-read-settings';
5453
import { MagickRectangle } from './internal/magick-rectangle';
5554
import { MagickSettings } from './settings/magick-settings';
5655
import { MorphologySettings } from './settings/morphology-settings';
5756
import { NativeInstance } from './native-instance';
57+
import { Orientation } from './enums/orientation';
5858
import { NoiseType } from './enums/noise-type';
5959
import { Percentage } from './types/percentage';
6060
import { PerceptualHash, IPerceptualHash } from './statistics/perceptual-hash';
@@ -289,7 +289,7 @@ export interface IMagickImage extends IDisposable {
289289
/**
290290
* Gets or sets the photo orientation of the image.
291291
*/
292-
orientation: MagickOrientation;
292+
orientation: Orientation;
293293

294294
/**
295295
* Event that will be raised when progress is reported by this image.
@@ -2269,10 +2269,10 @@ export class MagickImage extends NativeInstance implements IMagickImage {
22692269
});
22702270
}
22712271

2272-
get orientation(): MagickOrientation {
2273-
return <MagickOrientation>ImageMagick._api._MagickImage_Orientation_Get(this._instance);
2272+
get orientation(): Orientation {
2273+
return <Orientation>ImageMagick._api._MagickImage_Orientation_Get(this._instance);
22742274
}
2275-
set orientation(value: MagickOrientation) {
2275+
set orientation(value: Orientation) {
22762276
ImageMagick._api._MagickImage_Orientation_Set(this._instance, value);
22772277
}
22782278

tests/magick-image-info/constructor.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { DensityUnit } from '@src/enums/density-unit';
99
import { Interlace } from '@src/enums/interlace';
1010
import { MagickFormat } from '@src/enums/magick-format';
1111
import { MagickImageInfo } from '@src/magick-image-info';
12-
import { MagickOrientation } from '@src/enums/magick-orientation';
12+
import { Orientation } from '@src/enums/orientation';
1313

1414
describe('MagickImageInfo#constructor', () => {
1515
it('should create empty uninitialized instance', () => {
@@ -22,7 +22,7 @@ describe('MagickImageInfo#constructor', () => {
2222
expect(magickImageInfo.format).toBe(MagickFormat.Unknown);
2323
expect(magickImageInfo.height).toBe(0);
2424
expect(magickImageInfo.interlace).toBe(Interlace.Undefined);
25-
expect(magickImageInfo.orientation).toBe(MagickOrientation.Undefined);
25+
expect(magickImageInfo.orientation).toBe(Orientation.Undefined);
2626
expect(magickImageInfo.quality).toBe(0);
2727
expect(magickImageInfo.width).toBe(0);
2828
});

tests/magick-image-info/create.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { DensityUnit } from '@src/enums/density-unit';
99
import { Interlace } from '@src/enums/interlace';
1010
import { MagickFormat } from '@src/enums/magick-format';
1111
import { MagickImageInfo } from '@src/magick-image-info';
12-
import { MagickOrientation } from '@src/enums/magick-orientation';
12+
import { Orientation } from '@src/enums/orientation';
1313
import { TestFiles } from '@test/test-files';
1414

1515
describe('MagickImageInfo#constructor', () => {
@@ -23,7 +23,7 @@ describe('MagickImageInfo#constructor', () => {
2323
expect(magickImageInfo.format).toBe(MagickFormat.Jpeg);
2424
expect(magickImageInfo.height).toBe(350);
2525
expect(magickImageInfo.interlace).toBe(Interlace.Jpeg);
26-
expect(magickImageInfo.orientation).toBe(MagickOrientation.Undefined);
26+
expect(magickImageInfo.orientation).toBe(Orientation.Undefined);
2727
expect(magickImageInfo.quality).toBe(91);
2828
expect(magickImageInfo.width).toBe(1400);
2929
});

tests/magick-image-info/read.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { DensityUnit } from '@src/enums/density-unit';
99
import { Interlace } from '@src/enums/interlace';
1010
import { MagickFormat } from '@src/enums/magick-format';
1111
import { MagickImageInfo } from '@src/magick-image-info';
12-
import { MagickOrientation } from '@src/enums/magick-orientation';
12+
import { Orientation } from '@src/enums/orientation';
1313
import { TestFiles } from '@test/test-files';
1414

1515
describe('MagickImageInfo#constructor', () => {
@@ -24,7 +24,7 @@ describe('MagickImageInfo#constructor', () => {
2424
expect(magickImageInfo.format).toBe(MagickFormat.Jpeg);
2525
expect(magickImageInfo.height).toBe(400);
2626
expect(magickImageInfo.interlace).toBe(Interlace.NoInterlace);
27-
expect(magickImageInfo.orientation).toBe(MagickOrientation.TopLeft);
27+
expect(magickImageInfo.orientation).toBe(Orientation.TopLeft);
2828
expect(magickImageInfo.quality).toBe(70);
2929
expect(magickImageInfo.width).toBe(600);
3030
});

tests/magick-image/auto-orient.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
Licensed under the Apache License, Version 2.0.
44
*/
55

6-
import { MagickOrientation } from '@src/enums/magick-orientation';
6+
import { Orientation } from '@src/enums/orientation';
77
import { TestFiles } from '@test/test-files';
88

99
describe('MagickImage#autoOrient', () => {
1010
it('should rotate the image', () => {
1111
TestFiles.Images.Builtin.logo.use(image => {
12-
image.orientation = MagickOrientation.LeftTop;
12+
image.orientation = Orientation.LeftTop;
1313
image.autoOrient();
1414

15-
expect(image.orientation).toBe(MagickOrientation.TopLeft);
15+
expect(image.orientation).toBe(Orientation.TopLeft);
1616
expect(image.width).toBe(480);
1717
expect(image.height).toBe(640);
1818
});

0 commit comments

Comments
 (0)