caravaggio
Advanced tools
Comparing version 3.7.0 to 3.7.1
# Changelog | ||
## 3.7.1 | ||
- Correctly build | ||
## 3.7.0 | ||
@@ -4,0 +8,0 @@ |
@@ -43,3 +43,3 @@ "use strict"; | ||
const buffer = yield loader.get(url, req); | ||
const image = (0, sharp_1.default)(buffer); | ||
const image = (0, sharp_1.default)(buffer, { density: (0, misc_1.getImageDensityByUrl)(url) }); | ||
const operations = normalize([...defaultOperations, ...rawOperations]); | ||
@@ -46,0 +46,0 @@ const result = yield operations.reduce((acc, { name, op, params }) => __awaiter(void 0, void 0, void 0, function* () { |
@@ -14,1 +14,2 @@ import { Sharp } from 'sharp'; | ||
export declare const compose: (...fns: Function[]) => Function; | ||
export declare const getImageDensityByUrl: (url: string) => number | undefined; |
@@ -12,3 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.compose = exports.buildDocumentationLink = exports.percentageToPixel = exports.isPercentage = exports.getOutputType = exports.stringifyParams = void 0; | ||
exports.getImageDensityByUrl = exports.compose = exports.buildDocumentationLink = exports.percentageToPixel = exports.isPercentage = exports.getOutputType = exports.stringifyParams = void 0; | ||
const jsonReplacer = (key, value) => { | ||
@@ -51,1 +51,8 @@ if (Buffer.isBuffer(value)) { | ||
exports.compose = compose; | ||
const getImageDensityByUrl = (url) => { | ||
var _a; | ||
const ext = (_a = url.split('.').pop()) === null || _a === void 0 ? void 0 : _a.split(/#|\?/)[0]; | ||
if (ext === 'svg') | ||
return 600; | ||
}; | ||
exports.getImageDensityByUrl = getImageDensityByUrl; |
{ | ||
"name": "caravaggio", | ||
"version": "3.7.0", | ||
"version": "3.7.1", | ||
"description": "A blazing fast image processor service", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
141249
3057