@atlaskit/media-ui 25.8.0 → 25.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/media-ui
2
2
 
3
+ ## 25.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#93302](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/93302) [`c370864d9ece`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c370864d9ece) - Improve image dimensions logic for better reliability
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
3
13
  ## 25.8.0
4
14
 
5
15
  ### Minor Changes
@@ -54,7 +54,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
54
54
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ // Keep media player components used in media-viewer to use static colors from the new color palette to
55
55
  // support the hybrid theming in media viewer https://product-fabric.atlassian.net/browse/DSP-6067
56
56
  var packageName = "@atlaskit/media-ui";
57
- var packageVersion = "25.8.0";
57
+ var packageVersion = "25.9.0";
58
58
  var MEDIUM_VIDEO_MAX_WIDTH = 400;
59
59
  var SMALL_VIDEO_MAX_WIDTH = 160;
60
60
  var MINIMUM_DURATION_BEFORE_SAVING_TIME = 60;
@@ -30,6 +30,7 @@ Object.defineProperty(exports, "isRotated", {
30
30
  exports.readImageMetaData = readImageMetaData;
31
31
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
32
32
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
33
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
33
34
  var _types = require("./types");
34
35
  var _metatags = require("./metatags");
35
36
  var _util = require("../util");
@@ -185,7 +186,14 @@ function _readImageMetaData() {
185
186
  naturalHeight: height,
186
187
  tags: tags
187
188
  };
188
- if (!(isImageRotated || width === 0 && height === 0)) {
189
+ /*
190
+ * The PixelXDimension and PixelYDimension of image tags can mean something different than just width and height, especially when images are compressed or for other reasons.
191
+ * https://imagemagick.org/discourse-server/viewtopic.php?t=27037
192
+ * We've also received JAC tickets reporting incorrect dimensions because of this
193
+ * https://jira.atlassian.com/browse/CONFCLOUD-78275
194
+ * The best way to get accurate dimensions is by loading images into the HTML, which reflects the actual dimensions the browser will render
195
+ */
196
+ if (!((0, _platformFeatureFlags.getBooleanFF)('platform.corex.html-image-dimensions_18x3l') || isImageRotated || width === 0 && height === 0)) {
189
197
  _context3.next = 27;
190
198
  break;
191
199
  }
@@ -37,7 +37,7 @@ import { SkipTenBackwardIcon, SkipTenForwardIcon } from './icons';
37
37
  import { getControlsWrapperClassName } from './getControlsWrapperClassName';
38
38
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
39
39
  const packageName = "@atlaskit/media-ui";
40
- const packageVersion = "25.8.0";
40
+ const packageVersion = "25.9.0";
41
41
  const MEDIUM_VIDEO_MAX_WIDTH = 400;
42
42
  const SMALL_VIDEO_MAX_WIDTH = 160;
43
43
  const MINIMUM_DURATION_BEFORE_SAVING_TIME = 60;
@@ -1,3 +1,4 @@
1
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
1
2
  import { SupportedImageMetaTag, ExifOrientation } from './types';
2
3
  import { readImageMetaTags } from './metatags';
3
4
  import { loadImage, readImageNaturalOrientationFromDOM } from '../util';
@@ -113,7 +114,15 @@ export async function readImageMetaData(fileInfo) {
113
114
  naturalHeight: height,
114
115
  tags
115
116
  };
116
- if (isImageRotated || width === 0 && height === 0) {
117
+
118
+ /*
119
+ * The PixelXDimension and PixelYDimension of image tags can mean something different than just width and height, especially when images are compressed or for other reasons.
120
+ * https://imagemagick.org/discourse-server/viewtopic.php?t=27037
121
+ * We've also received JAC tickets reporting incorrect dimensions because of this
122
+ * https://jira.atlassian.com/browse/CONFCLOUD-78275
123
+ * The best way to get accurate dimensions is by loading images into the HTML, which reflects the actual dimensions the browser will render
124
+ */
125
+ if (getBooleanFF('platform.corex.html-image-dimensions_18x3l') || isImageRotated || width === 0 && height === 0) {
117
126
  try {
118
127
  const img = await loadImage(src);
119
128
  const {
@@ -47,7 +47,7 @@ import { SkipTenBackwardIcon, SkipTenForwardIcon } from './icons';
47
47
  import { getControlsWrapperClassName } from './getControlsWrapperClassName';
48
48
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
49
49
  var packageName = "@atlaskit/media-ui";
50
- var packageVersion = "25.8.0";
50
+ var packageVersion = "25.9.0";
51
51
  var MEDIUM_VIDEO_MAX_WIDTH = 400;
52
52
  var SMALL_VIDEO_MAX_WIDTH = 160;
53
53
  var MINIMUM_DURATION_BEFORE_SAVING_TIME = 60;
@@ -1,5 +1,6 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
4
  import { SupportedImageMetaTag, ExifOrientation } from './types';
4
5
  import { readImageMetaTags } from './metatags';
5
6
  import { loadImage, readImageNaturalOrientationFromDOM } from '../util';
@@ -156,7 +157,14 @@ function _readImageMetaData() {
156
157
  naturalHeight: height,
157
158
  tags: tags
158
159
  };
159
- if (!(isImageRotated || width === 0 && height === 0)) {
160
+ /*
161
+ * The PixelXDimension and PixelYDimension of image tags can mean something different than just width and height, especially when images are compressed or for other reasons.
162
+ * https://imagemagick.org/discourse-server/viewtopic.php?t=27037
163
+ * We've also received JAC tickets reporting incorrect dimensions because of this
164
+ * https://jira.atlassian.com/browse/CONFCLOUD-78275
165
+ * The best way to get accurate dimensions is by loading images into the HTML, which reflects the actual dimensions the browser will render
166
+ */
167
+ if (!(getBooleanFF('platform.corex.html-image-dimensions_18x3l') || isImageRotated || width === 0 && height === 0)) {
160
168
  _context3.next = 27;
161
169
  break;
162
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-ui",
3
- "version": "25.8.0",
3
+ "version": "25.9.0",
4
4
  "description": "Includes common components and utilities used by other media packages",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@atlaskit/analytics-next": "^9.2.0",
27
- "@atlaskit/button": "^17.12.0",
27
+ "@atlaskit/button": "^17.13.0",
28
28
  "@atlaskit/code": "^15.1.0",
29
29
  "@atlaskit/icon": "^22.1.0",
30
30
  "@atlaskit/icon-file-type": "^6.4.0",
@@ -115,6 +115,9 @@
115
115
  },
116
116
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
117
117
  "platform-feature-flags": {
118
+ "platform.corex.html-image-dimensions_18x3l": {
119
+ "type": "boolean"
120
+ },
118
121
  "platform.editor.a11y_video_controls_keyboard_support_yhcxh": {
119
122
  "type": "boolean"
120
123
  }