@expo/image-utils
Advanced tools
Comparing version 0.3.14 to 0.3.15
@@ -127,2 +127,6 @@ "use strict"; | ||
}; | ||
// Default to contain | ||
if (!icon.resizeMode) { | ||
icon.resizeMode = 'contain'; | ||
} | ||
const mimeType = mime_1.default.getType(icon.src); | ||
@@ -129,0 +133,0 @@ if (!mimeType) { |
@@ -122,4 +122,14 @@ "use strict"; | ||
exports.getJimpImageAsync = getJimpImageAsync; | ||
async function resize({ input, quality = 100 }, { background, position, fit, width, height = es_1.default.AUTO }) { | ||
async function resize({ input, quality = 100 }, { background, position, fit, width, height }) { | ||
let initialImage = await getJimpImageAsync(input); | ||
if (width && !height) { | ||
height = es_1.default.AUTO; | ||
} | ||
else if (!width && height) { | ||
width = es_1.default.AUTO; | ||
} | ||
else { | ||
width = initialImage.bitmap.width; | ||
height = initialImage.bitmap.height; | ||
} | ||
const jimpPosition = convertPosition(position); | ||
@@ -126,0 +136,0 @@ const jimpQuality = typeof quality !== 'number' ? 100 : quality; |
{ | ||
"name": "@expo/image-utils", | ||
"version": "0.3.14", | ||
"version": "0.3.15", | ||
"description": "A package used by Expo CLI for processing images", | ||
@@ -43,3 +43,3 @@ "main": "build/index.js", | ||
"devDependencies": { | ||
"@expo/babel-preset-cli": "0.2.20", | ||
"@expo/babel-preset-cli": "0.2.21", | ||
"@types/fs-extra": "^9.0.1", | ||
@@ -46,0 +46,0 @@ "@types/getenv": "^0.7.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
100191
970