notmasteryet/pdf.js — comment on commit 90bf9bf117250ce9ea52bdf11a075a9ba06f4fed
File: pdf.js line 6049
By jviereck:

This line took me some minutes to understand that it really works^^.

If the image is using cmyk, there is no real DOM-`image` object, but just pure data. For someone reading this code, it doesn't make sense to ask for a domImage (which one expect to be something like document.create('image')) and then pass it to `tmpCtx.putImageData(domImage, 0, 0)`, which isn't possible.

Please add a flag on the `JpegImage` image like `hasPixelData` and store the processed data then on a new property like `image.pixelData` (feel free to rename this if you have a better name for it). That should make it easier to understand what the code is actually doing.