@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 CHANGED
@@ -62,7 +62,7 @@ program
62
62
  }
63
63
  printSummary();
64
64
  printIssues();
65
- if (options.failOnIssues && $state.issues.size > 0) {
65
+ if (options.fail && $state.issues.size > 0) {
66
66
  exit(1);
67
67
  }
68
68
  });
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divriots/jampack",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Packer for static websites",
5
5
  "author": "Georges Gomes @georges-gomes",
6
6
  "bin": {