question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2 MiB JPEG in state -> tab crashes

See original GitHub issue
screen shot 2017-08-25 at 10 27 30

Type that gets placed inside an object inside the state:

/**
 * Result type of the rendering.
 */
export type RenderResult =
  { imageWidth: number,
    imageHeight: number,
    /**
     * The normalised image (orientation is now = 1, the default)
     */
    image: ImageData,
    thumbWidth: number,
    thumbHeight: number,
    /**
     * The thumbnail of the image.
     */
    thumb: ImageData,
    /**
     * Optional image data.
     */
    exif?: Object
  }

Data is extracted as such:

const image = scratch.getContext("2d").getImageData(0, 0, scratch.width, scratch.height);

This happens even if redux is not the active tab in DevTools, so this bug precludes e.g. having the console open.

Chromium latest via homebrew.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hafcommented, Aug 25, 2017

For posterity and googlers like myself in the future:


const ppValue = (value: any): any => {
  if (Array.isArray(value)) {
    return value.map(ppValue);
  } else if (value instanceof ImageData) {
    return `<<ImageData(w=${value.width}, h=${value.height}, #bytes=${value.data.byteLength}})>>`;
  } else if (value instanceof File) {
    return '<<File>>';
  } else if (value instanceof FileList) {
    return '<<FileList>>';
  } else if (typeof value === 'object') {
    return ppMap(value); // eslint-disable-line no-use-before-define
  } else {
    // primitives
    return value;
  }
}

const ppMap = (map: Object) => {
  if (map == null) {
    return map;
  }
  const tmp = {};
  Object.keys(map).filter(k => map.hasOwnProperty(k)).forEach(k => {
    tmp[k] = ppValue(map[k]);
  });
  return tmp;
}

// ... stateSanitizer: ppMap
0reactions
zalmoxisuscommented, Nov 27, 2018

That color shows that there’s an inconsistency between the state on client side and on the extension side (action index is different). We’d add an option to run it from client side in 3.0, so it won’t be necessary to sanitize.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows User instantly crashes tabs I open
Windows User instantly crashes tabs I open. Hello,. I've had my pc build for 2 years and it has been flawless throughout until...
Read more >
Was ist neu? - MusicBrainz Picard
PICARD-1974 - Picard crashes when using the same tag name more than once in "Tags from File Names..." PICARD-1975 - Tags from file...
Read more >
ArubaOS 8.4.0.1 Release Notes - Aruba Networks
failed to boot up and went into inactive and unlicensed state. The fix ... To access ArubaOS MIB files: 1. Log in to...
Read more >
Optics crashes when opening photo - Boris FX Forum
512GB PCIe® NVMe™ M.2 Solid State Drive ... optics crashes when trying to open tiff, psd, or jpeg in photoshop, lightroom and standalone....
Read more >
Supplemental Document: BIG-IP 11.6.1 Fixes and Known ... - AskF5
551010-7, 3-Major, Crash on unexpected WAM storage queue state ... 563474-2 : SNMP F5-BIGIP-APM-MIB::apmPmStatConfigSyncState returns 0 for edited access ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found