@divriots/jampack 0.7.0 → 0.7.1
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/dist/index.js +1 -1
- package/dist/optimize.js +2 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/optimize.js
CHANGED
|
@@ -322,7 +322,7 @@ async function setImageSize(htmlfile, img, image) {
|
|
|
322
322
|
if (!isNumeric(width)) {
|
|
323
323
|
$state.reportIssue(htmlfile, {
|
|
324
324
|
type: 'warn',
|
|
325
|
-
msg: `Invalid width attribute format: "${width}" - overriding`,
|
|
325
|
+
msg: `Invalid width attribute format: "${width}" - overriding for ${image.src}`,
|
|
326
326
|
});
|
|
327
327
|
width = undefined;
|
|
328
328
|
}
|
|
@@ -331,7 +331,7 @@ async function setImageSize(htmlfile, img, image) {
|
|
|
331
331
|
if (!isNumeric(height)) {
|
|
332
332
|
$state.reportIssue(htmlfile, {
|
|
333
333
|
type: 'warn',
|
|
334
|
-
msg: `Invalid height attribute format: "${height}" - overriding`,
|
|
334
|
+
msg: `Invalid height attribute format: "${height}" - overriding for ${image.src}`,
|
|
335
335
|
});
|
|
336
336
|
height = undefined;
|
|
337
337
|
}
|
|
@@ -349,15 +349,6 @@ async function setImageSize(htmlfile, img, image) {
|
|
|
349
349
|
// Both are provided
|
|
350
350
|
const w = parseInt(width, 10);
|
|
351
351
|
const h = parseInt(height, 10);
|
|
352
|
-
// Is ratio equal?
|
|
353
|
-
const providedRatio = Math.round((w / h) * 10) / 10;
|
|
354
|
-
const imageRatio = Math.round(originalRatio * 10) / 10;
|
|
355
|
-
if (providedRatio !== imageRatio) {
|
|
356
|
-
$state.reportIssue(htmlfile, {
|
|
357
|
-
type: 'warn',
|
|
358
|
-
msg: `Image aspect ratio in HTML (${providedRatio}) differs from image aspect ratio (${imageRatio}) - fix width and height or let jampack fill them.`,
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
352
|
return [w, h];
|
|
362
353
|
}
|
|
363
354
|
else if (width !== undefined && height === undefined) {
|