@divriots/jampack 0.25.0 → 0.26.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.
Files changed (2) hide show
  1. package/dist/optimize.js +7 -1
  2. package/package.json +1 -1
package/dist/optimize.js CHANGED
@@ -219,6 +219,10 @@ async function processImage(state, htmlfile, img, isAboveTheFold) {
219
219
  });
220
220
  return;
221
221
  }
222
+ const fullSizeRaw = img.attr('data-fullsize');
223
+ if (typeof fullSizeRaw !== undefined)
224
+ img.removeAttr('data-fullsize');
225
+ const fullSize = !!fullSizeRaw && parseInt(fullSizeRaw) > 0;
222
226
  const config = state.options;
223
227
  if (!isIncluded(attrib_src, config.image.src_include, config.image.src_exclude)) {
224
228
  // Setup to ignore
@@ -292,6 +296,8 @@ async function processImage(state, htmlfile, img, isAboveTheFold) {
292
296
  break;
293
297
  if (!isIncluded(attrib_src, config.image.cdn.src_include || /.*/, config.image.cdn.src_exclude))
294
298
  break;
299
+ if (fullSize)
300
+ return;
295
301
  let attrib_width = getIntAttr(img, 'width');
296
302
  if (!attrib_width) {
297
303
  state.reportIssue(htmlfile, {
@@ -478,7 +484,7 @@ async function processImage(state, htmlfile, img, isAboveTheFold) {
478
484
  // The compress pass will compress the images
479
485
  // of the srcset
480
486
  }
481
- else {
487
+ else if (!fullSize) {
482
488
  const new_srcset = await generateSrcSet(state, htmlfile, originalImage, img.attr('src'), imageLengthToBeatInSrcSet, { toFormat: srcToFormat });
483
489
  if (new_srcset !== null) {
484
490
  img.attr('srcset', new_srcset);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divriots/jampack",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "cache-version": {
5
5
  "img": "v1",
6
6
  "img-ext": "v1"