Investigated photon-node usage and binary build.
UnderstandTested compatibility in Node.js, Bun binary, and tsx.
VerifyImplemented lazy-loaded wrapper for photon.ts.
BuildVerified fix in all environments including Docker.
VerifyAnalyze GitHub issue(s): https://github.com/badlogic/pi-mono/issues/784 test in docker locally, temp container
For each issue:
Read the issue in full, including all comments and linked issues/PRs.
For bugs:
For feature requests:
Do NOT implement unless explicitly asked. Analyze and propose only.
The user wants me to analyze GitHub issue #784. Let me first read the issue to understand what it's about.
>gh issue view 784 --repo badlogic/pi-mono --json title,body,comments,labels,state{"body":"Seems like standalone Pi binary is broken since v0.46.0 – at least on x86 Linux. \n\n## Reproduction\n```bash\n$ mkdir /tmp/pi-0.47.0\n$ cd /tmp/pi-0.47.0\n$ wget https://github.com/badlogic/pi-mono/releases/download/v0.47.0/pi-linux-x64.tar.gz\n$ tar -xzf pi-linux-x64.tar.gz\n$ /tmp/pi-0.47.0/pi/pi\n44698 | table.set(offset + 0, undefined);\n44699 | table.set(offset + 1, null);\n44700 | table.set(offset + 2, true);\n44701 | table.set(offset + 3, false);\n44702 | };\n44703 | var bytes = __require(\"fs\").readFileSync(path7);\n ^\nENOENT: no such file or directory, open '/home/runner/work/pi-mono/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm'\n path: \"/home/runner/work/pi-mono/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm\",\n syscall: \"open\",\n errno: -2,\n code: \"ENOENT\"\n\n at <anonymous> (/$bunfs/root/pi:44703:43)\n at <anonymous> (/$bunfs/root/pi:36:47)\n at /$bunfs/root/pi:186295:51\n at loadAndEvaluateModule (1:11)\n\nBun v1.2.20 (Linux x64 baseline)\n```\n\nAnd if you try the same with 0.45.7 it works:\n\n```bash\n$ mkdir /tmp/pi-0.45.7\n$ cd /tmp/pi-0.45.7\n$ wget https://github.com/badlogic/pi-mono/releases/download/v0.45.7/pi-linux-x64.tar.gz\n$ tar -xzf pi-linux-x64.tar.gz\n$ /tmp/pi-0.45.7/pi/pi\n\n pi v0.45.7\n escape to interrupt\n ctrl+c to clear\n ctrl+c twice to exit\n ctrl+d to exit (empty)\n ctrl+z to suspend\n ctrl+k to delete to end\n shift+tab to cycle thinking\n ctrl+p/shift+ctrl+p to cycle models\n ctrl+l to select model\n ctrl+o to expand tools\n ctrl+t to toggle thinking\n ctrl+g for external editor\n / for commands\n ! to run bash\n !! to run bash (no context)\n alt+enter to queue follow-up\n alt+up to edit all queued messages\n ctrl+v to paste image\n drop files to attach\n...\n```\n\n## Root cause\nIt looks like it tries to load Photon's WASM module from a hard-coded path and fails. Ideally we should embed this file within the binary, so it doesn't require users to have any module installed in their hosts.","comments":[],"labels":[],"state":"OPEN","title":"Standalone Pi binary is broken on x86 Linux 0.46.0 onward"}This is a bug report. The standalone Pi binary is broken on x86 Linux since v0.46.0. The error shows it's trying to load a WASM file from a hardcoded path that was used during build time on GitHub Actions.
The issue is with the @silvia-odwyer/photon-node package. Let me investigate:
Let me look at the relevant code files.
Let me investigate the issue. I'll look at the photon-node usage and how the binary is built.
>cd /Users/badlogic/workspaces/pi-mono && grep -r "photon" --include="*.ts" --include="*.js" --include="*.json" -l 2>/dev/null./node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js
./node_modules/@silvia-odwyer/photon-node/photon_rs.d.ts
./node_modules/@silvia-odwyer/photon-node/package.json
./node_modules/@silvia-odwyer/photon-node/photon_rs.js
./node_modules/.package-lock.json
./package-lock.json
./packages/coding-agent/dist/utils/image-convert.js
./packages/coding-agent/dist/utils/image-resize.js
./packages/coding-agent/package.json
./packages/coding-agent/vitest.config.ts
./packages/coding-agent/src/utils/image-convert.ts
./packages/coding-agent/src/utils/image-resize.tsSo photon is used in packages/coding-agent for image processing. Let me read the relevant files.
>cd /Users/badlogic/workspaces/pi-mono && cat node_modules/@silvia-odwyer/photon-node/photon_rs.js_assertClass(photon_img, PhotonImage);
const ret = wasm.shearx(photon_img.__wbg_ptr, shear);
return PhotonImage.__wrap(ret);
};
/**
* Shear the image along the Y axis.
* A sheared PhotonImage is returned.
*
* # Arguments
* * `img` - A PhotonImage. See the PhotonImage struct for details.
* * `shear` - Amount to shear.
*
* # Example
*
* ```no_run
* // For example, to shear an image by 0.5:
* use photon_rs::native::open_image;
* use photon_rs::transform::sheary;
*
* let img = open_image("img.jpg").expect("File should open");
* let sheared_img = sheary(&img, 0.5);
* ```
* @param {PhotonImage} photon_img
* @param {number} shear
* @returns {PhotonImage}
*/
module.exports.sheary = function(photon_img, shear) {
_assertClass(photon_img, PhotonImage);
const ret = wasm.sheary(photon_img.__wbg_ptr, shear);
return PhotonImage.__wrap(ret);
};
/**
* Apply uniform padding around the PhotonImage
* A padded PhotonImage is returned.
* # Arguments
* * `img` - A PhotonImage. See the PhotonImage struct for details.
* * `padding` - The amount of padding to be applied to the PhotonImage.
* * `padding_rgba` - Tuple containing the RGBA code for padding color.
*
* # Example
*
* ```no_run
* // For example, to apply a padding of 10 pixels around a PhotonImage:
* use photon_rs::transform::padding_uniform;
* use photon_rs::native::open_image;
* use photon_rs::Rgba;
*
* let mut img = open_image("img.jpg").expect("File should open");
* let rgba = Rgba::new(200_u8, 100_u8, 150_u8, 255_u8);
* padding_uniform(&img, 10_u32, rgba);
* ```
* @param {PhotonImage} img
* @param {number} padding
* @param {Rgba} padding_rgba
* @returns {PhotonImage}
*/
module.exports.padding_uniform = function(img, padding, padding_rgba) {
_assertClass(img, PhotonImage);
_assertClass(padding_rgba, Rgba);
var ptr0 = padding_rgba.__destroy_into_raw();
const ret = wasm.padding_uniform(img.__wbg_ptr, padding, ptr0);
return PhotonImage.__wrap(ret);
};
/**
* Apply padding on the left side of the PhotonImage
* A padded PhotonImage is returned.
* # Arguments
* * `img` - A PhotonImage. See the PhotonImage struct for details.
* * `padding` - The amount of padding to be applied to the PhotonImage.
* * `padding_rgba` - Tuple containing the RGBA code for padding color.
*
* # Example
*
* ```no_run
* // For example, to apply a padding of 10 pixels on the left side of a PhotonImage:
* use photon_rs::transform::padding_left;
* use photon_rs::native::open_image;
* use photon_rs::Rgba;
*
* let mut img = open_image("img.jpg").expect("File should open");
* let rgba = Rgba::new(200_u8, 100_u8, 150_u8, 255_u8);
* padding_left(&img, 10_u32, rgba);
* ```
* @param {PhotonImage} img
* @param {number} padding
* @param {Rgba} padding_rgba
* @returns {PhotonImage}
*/
module.exports.padding_left = function(img, padding, padding_rgba) {
_assertClass(img, PhotonImage);
_assertClass(padding_rgba, Rgba);
var ptr0 = padding_rgba.__destroy_into_raw();
const ret = wasm.padding_left(img.__wbg_ptr, padding, ptr0);
return PhotonImage.__wrap(ret);
};
/**
* Apply padding on the left side of the PhotonImage
* A padded PhotonImage is returned.
* # Arguments
* * `img` - A PhotonImage. See the PhotonImage struct for details.
* * `padding` - The amount of padding to be applied to the PhotonImage.
* * `padding_rgba` - Tuple containing the RGBA code for padding color.
*
* # Example
*
* ```no_run
* // For example, to apply a padding of 10 pixels on the right side of a PhotonImage:
* use photon_rs::transform::padding_right;
* use photon_rs::native::open_image;
* use photon_rs::Rgba;
*
* let mut img = open_image("img.jpg").expect("File should open");
* let rgba = Rgba::new(200_u8, 100_u8, 150_u8, 255_u8);
* padding_right(&img, 10_u32, rgba);
* ```
* @param {PhotonImage} img
* @param {number} padding
* @param {Rgba} padding_rgba
* @returns {PhotonImage}
*/
module.exports.padding_right = function(img, padding, padding_rgba) {
_assertClass(img, PhotonImage);
_assertClass(padding_rgba, Rgba);
var ptr0 = padding_rgba.__destroy_into_raw();
const ret = wasm.padding_right(img.__wbg_ptr, padding, ptr0);
return PhotonImage.__wrap(ret);
};
/**
* Apply padding on the left side of the PhotonImage
* A padded PhotonImage is returned.
* # Arguments
* * `img` - A PhotonImage. See the PhotonImage struct for details.
* * `padding` - The amount of padding to be applied to the PhotonImage.
* * `padding_rgba` - Tuple containing the RGBA code for padding color.
*
* # Example
*
* ```no_run
* // For example, to apply a padding of 10 pixels on the top of a PhotonImage:
* use photon_rs::transform::padding_top;
* use photon_rs::native::open_image;
* use photon_rs::Rgba;
*
* let mut img = open_image("img.jpg").expect("File should open");
* let rgba = Rgba::new(200_u8, 100_u8, 150_u8, 255_u8);
* padding_top(&img, 10_u32, rgba);
* ```
* @param {PhotonImage} img
* @param {number} padding
* @param {Rgba} padding_rgba
* @returns {PhotonImage}
*/
module.exports.padding_top = function(img, padding, padding_rgba) {
_assertClass(img, PhotonImage);
_assertClass(padding_rgba, Rgba);
var ptr0 = padding_rgba.__destroy_into_raw();
const ret = wasm.padding_top(img.__wbg_ptr, padding, ptr0);
return PhotonImage.__wrap(ret);
};
/**
* Apply padding on the left side of the PhotonImage
* A padded PhotonImage is returned.
* # Arguments
* * `img` - A PhotonImage. See the PhotonImage struct for details.
* * `padding` - The amount of padding to be applied to the PhotonImage.
* * `padding_rgba` - Tuple containing the RGBA code for padding color.
*
* # Example
*
* ```no_run
* // For example, to apply a padding of 10 pixels on the bottom of a PhotonImage:
* use photon_rs::transform::padding_bottom;
* use photon_rs::native::open_image;
* use photon_rs::Rgba;
*
* let mut img = open_image("img.jpg").expect("File should open");
* let rgba = Rgba::new(200_u8, 100_u8, 150_u8, 255_u8);
* padding_bottom(&img, 10_u32, rgba);
* ```
* @param {PhotonImage} img
* @param {number} padding
* @param {Rgba} padding_rgba
* @returns {PhotonImage}
*/
module.exports.padding_bottom = function(img, padding, padding_rgba) {
_assertClass(img, PhotonImage);
_assertClass(padding_rgba, Rgba);
var ptr0 = padding_rgba.__destroy_into_raw();
const ret = wasm.padding_bottom(img.__wbg_ptr, padding, ptr0);
return PhotonImage.__wrap(ret);
};
/**
* Rotate the PhotonImage on an arbitrary angle
* A rotated PhotonImage is returned.
*
* # Arguments
* * `img` - A PhotonImage. See the PhotonImage struct for details.
* * `angle` - Rotation angle in degrees.
*
* # Example
*
* ```no_run
* // For example, to rotate a PhotonImage by 30 degrees:
* use photon_rs::native::open_image;
* use photon_rs::transform::rotate;
*
* let img = open_image("img.jpg").expect("File should open");
* let rotated_img = rotate(&img, 30.0);
* ```
* @param {PhotonImage} photon_img
* @param {number} angle
* @returns {PhotonImage}
*/
module.exports.rotate = function(photon_img, angle) {
_assertClass(photon_img, PhotonImage);
const ret = wasm.rotate(photon_img.__wbg_ptr, angle);
return PhotonImage.__wrap(ret);
};
/**
* Resample the PhotonImage.
*
* # Arguments
* * `img` - A PhotonImage. See the PhotonImage struct for details.
* * `dst_width` - Target width.
* * `dst_height` - Target height.
*
* # Example
*
* ```no_run
* // For example, to resample a PhotonImage to 1920x1080 size:
* use photon_rs::native::open_image;
* use photon_rs::transform::resample;
*
* let img = open_image("img.jpg").expect("File should open");
* let rotated_img = resample(&img, 1920, 1080);
* ```
* @param {PhotonImage} img
* @param {number} dst_width
* @param {number} dst_height
* @returns {PhotonImage}
*/
module.exports.resample = function(img, dst_width, dst_height) {
_assertClass(img, PhotonImage);
const ret = wasm.resample(img.__wbg_ptr, dst_width, dst_height);
return PhotonImage.__wrap(ret);
};
/**
* Adds an offset to the image by a certain number of pixels.
*
* This creates an RGB shift effect.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `channel_index`: The index of the channel to increment. 0 for red, 1 for green and 2 for blue.
* * `offset` - The offset is added to the pixels in the image.
* # Example
*
* ```no_run
* // For example, to offset pixels by 30 pixels on the red channel:
* use photon_rs::effects::offset;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* offset(&mut img, 0_usize, 30_u32);
* ```
* @param {PhotonImage} photon_image
* @param {number} channel_index
* @param {number} offset
*/
module.exports.offset = function(photon_image, channel_index, offset) {
_assertClass(photon_image, PhotonImage);
wasm.offset(photon_image.__wbg_ptr, channel_index, offset);
};
/**
* Adds an offset to the red channel by a certain number of pixels.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `offset` - The offset you want to move the red channel by.
* # Example
*
* ```no_run
* // For example, to add an offset to the red channel by 30 pixels.
* use photon_rs::effects::offset_red;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* offset_red(&mut img, 30_u32);
* ```
* @param {PhotonImage} img
* @param {number} offset_amt
*/
module.exports.offset_red = function(img, offset_amt) {
_assertClass(img, PhotonImage);
wasm.offset_red(img.__wbg_ptr, offset_amt);
};
/**
* Adds an offset to the green channel by a certain number of pixels.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `offset` - The offset you want to move the green channel by.
* # Example
*
* ```no_run
* // For example, to add an offset to the green channel by 30 pixels.
* use photon_rs::effects::offset_green;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* offset_green(&mut img, 30_u32);
* ```
* @param {PhotonImage} img
* @param {number} offset_amt
*/
module.exports.offset_green = function(img, offset_amt) {
_assertClass(img, PhotonImage);
wasm.offset_green(img.__wbg_ptr, offset_amt);
};
/**
* Adds an offset to the blue channel by a certain number of pixels.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `offset_amt` - The offset you want to move the blue channel by.
* # Example
* // For example, to add an offset to the green channel by 40 pixels.
*
* ```no_run
* use photon_rs::effects::offset_blue;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* offset_blue(&mut img, 40_u32);
* ```
* @param {PhotonImage} img
* @param {number} offset_amt
*/
module.exports.offset_blue = function(img, offset_amt) {
_assertClass(img, PhotonImage);
wasm.offset_blue(img.__wbg_ptr, offset_amt);
};
/**
* Adds multiple offsets to the image by a certain number of pixels (on two channels).
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `offset` - The offset is added to the pixels in the image.
* # Example
*
* ```no_run
* // For example, to add a 30-pixel offset to both the red and blue channels:
* use photon_rs::effects::multiple_offsets;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* multiple_offsets(&mut img, 30_u32, 0_usize, 2_usize);
* ```
* @param {PhotonImage} photon_image
* @param {number} offset
* @param {number} channel_index
* @param {number} channel_index2
*/
module.exports.multiple_offsets = function(photon_image, offset, channel_index, channel_index2) {
_assertClass(photon_image, PhotonImage);
wasm.multiple_offsets(photon_image.__wbg_ptr, offset, channel_index, channel_index2);
};
/**
* Halftoning effect.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* # Example
*
* ```no_run
* // For example:
* use photon_rs::effects::halftone;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* halftone(&mut img);
* ```
* @param {PhotonImage} photon_image
*/
module.exports.halftone = function(photon_image) {
_assertClass(photon_image, PhotonImage);
wasm.halftone(photon_image.__wbg_ptr);
};
/**
* Reduces an image to the primary colours.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* # Example
*
* ```no_run
* // For example, to add a primary colour effect to an image of type `DynamicImage`:
* use photon_rs::effects::primary;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* primary(&mut img);
* ```
* @param {PhotonImage} img
*/
module.exports.primary = function(img) {
_assertClass(img, PhotonImage);
wasm.primary(img.__wbg_ptr);
};
/**
* Colorizes the green channels of the image.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* # Example
*
* ```no_run
* // For example, to colorize an image of type `PhotonImage`:
* use photon_rs::effects::colorize;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* colorize(&mut img);
* ```
* @param {PhotonImage} photon_image
*/
module.exports.colorize = function(photon_image) {
_assertClass(photon_image, PhotonImage);
wasm.colorize(photon_image.__wbg_ptr);
};
/**
* Applies a solarizing effect to an image.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* # Example
*
* ```no_run
* // For example, to colorize an image of type `PhotonImage`:
* use photon_rs::effects::solarize;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* solarize(&mut img);
* ```
* @param {PhotonImage} photon_image
*/
module.exports.solarize = function(photon_image) {
_assertClass(photon_image, PhotonImage);
wasm.solarize(photon_image.__wbg_ptr);
};
/**
* Applies a solarizing effect to an image and returns the resulting PhotonImage.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* # Example
*
* ```no_run
* // For example, to solarize "retimg" an image of type `PhotonImage`:
* use photon_rs::effects::solarize_retimg;
* use photon_rs::native::open_image;
* use photon_rs::PhotonImage;
*
* let img = open_image("img.jpg").expect("File should open");
* let result: PhotonImage = solarize_retimg(&img);
* ```
* @param {PhotonImage} photon_image
* @returns {PhotonImage}
*/
module.exports.solarize_retimg = function(photon_image) {
_assertClass(photon_image, PhotonImage);
const ret = wasm.solarize_retimg(photon_image.__wbg_ptr);
return PhotonImage.__wrap(ret);
};
/**
* Adjust the brightness of an image by a factor.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `brightness` - A u8 to add or subtract to the brightness. To increase
* the brightness, pass a positive number (up to 255). To decrease the brightness,
* pass a negative number instead.
* # Example
*
* ```no_run
* use photon_rs::effects::adjust_brightness;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* adjust_brightness(&mut img, 10_i16);
* ```
* @param {PhotonImage} photon_image
* @param {number} brightness
*/
module.exports.adjust_brightness = function(photon_image, brightness) {
_assertClass(photon_image, PhotonImage);
wasm.adjust_brightness(photon_image.__wbg_ptr, brightness);
};
/**
* Increase the brightness of an image by a constant.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `brightness` - A u8 to add to the brightness.
* # Example
*
* ```no_run
* use photon_rs::effects::inc_brightness;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* inc_brightness(&mut img, 10_u8);
* ```
* @param {PhotonImage} photon_image
* @param {number} brightness
*/
module.exports.inc_brightness = function(photon_image, brightness) {
_assertClass(photon_image, PhotonImage);
wasm.inc_brightness(photon_image.__wbg_ptr, brightness);
};
/**
* Decrease the brightness of an image by a constant.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `brightness` - A u8 to subtract from the brightness. It should be a positive number,
* and this value will then be subtracted from the brightness.
* # Example
*
* ```no_run
* use photon_rs::effects::dec_brightness;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* dec_brightness(&mut img, 10_u8);
* ```
* @param {PhotonImage} photon_image
* @param {number} brightness
*/
module.exports.dec_brightness = function(photon_image, brightness) {
_assertClass(photon_image, PhotonImage);
wasm.dec_brightness(photon_image.__wbg_ptr, brightness);
};
/**
* Adjust the contrast of an image by a factor.
*
* # Arguments
* * `photon_image` - A PhotonImage that contains a view into the image.
* * `contrast` - An f32 factor used to adjust contrast. Between [-255.0, 255.0]. The algorithm will
* clamp results if passed factor is out of range.
* # Example
*
* ```no_run
* use photon_rs::effects::adjust_contrast;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* adjust_contrast(&mut img, 30_f32);
* ```
* @param {PhotonImage} photon_image
* @param {number} contrast
*/
module.exports.adjust_contrast = function(photon_image, contrast) {
_assertClass(photon_image, PhotonImage);
wasm.adjust_contrast(photon_image.__wbg_ptr, contrast);
};
/**
* Tint an image by adding an offset to averaged RGB channel values.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `r_offset` - The amount the R channel should be incremented by.
* * `g_offset` - The amount the G channel should be incremented by.
* * `b_offset` - The amount the B channel should be incremented by.
* # Example
*
* ```no_run
* // For example, to tint an image of type `PhotonImage`:
* use photon_rs::effects::tint;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* tint(&mut img, 10_u32, 20_u32, 15_u32);
* ```
* @param {PhotonImage} photon_image
* @param {number} r_offset
* @param {number} g_offset
* @param {number} b_offset
*/
module.exports.tint = function(photon_image, r_offset, g_offset, b_offset) {
_assertClass(photon_image, PhotonImage);
wasm.tint(photon_image.__wbg_ptr, r_offset, g_offset, b_offset);
};
/**
* Horizontal strips. Divide an image into a series of equal-height strips, for an artistic effect.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `num_strips` - The number of strips
* # Example
*
* ```no_run
* // For example, to draw horizontal strips on a `PhotonImage`:
* use photon_rs::effects::horizontal_strips;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* horizontal_strips(&mut img, 8u8);
* ```
* @param {PhotonImage} photon_image
* @param {number} num_strips
*/
module.exports.horizontal_strips = function(photon_image, num_strips) {
_assertClass(photon_image, PhotonImage);
wasm.horizontal_strips(photon_image.__wbg_ptr, num_strips);
};
/**
* Horizontal strips. Divide an image into a series of equal-width strips, for an artistic effect. Sepcify a color as well.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `num_strips` - The numbder of strips
* * `color` - Color of strips.
* # Example
*
* ```no_run
* // For example, to draw blue horizontal strips on a `PhotonImage`:
* use photon_rs::effects::color_horizontal_strips;
* use photon_rs::native::open_image;
* use photon_rs::Rgb;
*
* let color = Rgb::new(255u8, 0u8, 0u8);
* let mut img = open_image("img.jpg").expect("File should open");
* color_horizontal_strips(&mut img, 8u8, color);
* ```
* @param {PhotonImage} photon_image
* @param {number} num_strips
* @param {Rgb} color
*/
module.exports.color_horizontal_strips = function(photon_image, num_strips, color) {
_assertClass(photon_image, PhotonImage);
_assertClass(color, Rgb);
var ptr0 = color.__destroy_into_raw();
wasm.color_horizontal_strips(photon_image.__wbg_ptr, num_strips, ptr0);
};
/**
* Vertical strips. Divide an image into a series of equal-width strips, for an artistic effect.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `num_strips` - The numbder of strips
* # Example
*
* ```no_run
* // For example, to draw vertical strips on a `PhotonImage`:
* use photon_rs::effects::vertical_strips;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* vertical_strips(&mut img, 8u8);
* ```
* @param {PhotonImage} photon_image
* @param {number} num_strips
*/
module.exports.vertical_strips = function(photon_image, num_strips) {
_assertClass(photon_image, PhotonImage);
wasm.vertical_strips(photon_image.__wbg_ptr, num_strips);
};
/**
* Vertical strips. Divide an image into a series of equal-width strips, for an artistic effect. Sepcify a color as well.
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `num_strips` - The numbder of strips
* * `color` - Color of strips.
* # Example
*
* ```no_run
* // For example, to draw red vertical strips on a `PhotonImage`:
* use photon_rs::effects::color_vertical_strips;
* use photon_rs::native::open_image;
* use photon_rs::Rgb;
*
* let color = Rgb::new(255u8, 0u8, 0u8);
* let mut img = open_image("img.jpg").expect("File should open");
* color_vertical_strips(&mut img, 8u8, color);
* ```
* @param {PhotonImage} photon_image
* @param {number} num_strips
* @param {Rgb} color
*/
module.exports.color_vertical_strips = function(photon_image, num_strips, color) {
_assertClass(photon_image, PhotonImage);
_assertClass(color, Rgb);
var ptr0 = color.__destroy_into_raw();
wasm.color_vertical_strips(photon_image.__wbg_ptr, num_strips, ptr0);
};
/**
* Turn an image into an oil painting
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* * `radius` - Radius of each paint particle
* * `intesnity` - How artsy an Image should be
* # Example
*
* ```no_run
* // For example, to oil an image of type `PhotonImage`:
* use photon_rs::effects::oil;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* oil(&mut img, 4i32, 55.0);
* ```
* @param {PhotonImage} photon_image
* @param {number} radius
* @param {number} intensity
*/
module.exports.oil = function(photon_image, radius, intensity) {
_assertClass(photon_image, PhotonImage);
wasm.oil(photon_image.__wbg_ptr, radius, intensity);
};
/**
* Turn an image into an frosted glass see through
*
* # Arguments
* * `img` - A PhotonImage that contains a view into the image.
* # Example
*
* ```no_run
* // For example, to turn an image of type `PhotonImage` into frosted glass see through:
* use photon_rs::effects::frosted_glass;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* frosted_glass(&mut img);
* ```
* @param {PhotonImage} photon_image
*/
module.exports.frosted_glass = function(photon_image) {
_assertClass(photon_image, PhotonImage);
wasm.frosted_glass(photon_image.__wbg_ptr);
};
/**
* Pixelize an image.
*
* # Arguments
* * `photon_image` - A PhotonImage that contains a view into the image.
* * `pixel_size` - Targeted pixel size of generated image.
* # Example
*
* ```no_run
* // For example, to turn an image of type `PhotonImage` into a pixelized image with 50 pixels blocks:
* use photon_rs::effects::pixelize;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* pixelize(&mut img, 50);
* ```
* @param {PhotonImage} photon_image
* @param {number} pixel_size
*/
module.exports.pixelize = function(photon_image, pixel_size) {
_assertClass(photon_image, PhotonImage);
wasm.pixelize(photon_image.__wbg_ptr, pixel_size);
};
/**
* Normalizes an image by remapping its range of pixels values. Only RGB
* channels are processed and each channel is stretched to \[0, 255\] range
* independently. This process is also known as contrast stretching.
* # Arguments
* * `photon_image` - A PhotonImage that contains a view into the image.
* # Example
*
* ```no_run
* // For example, to turn an image of type `PhotonImage` into a normalized image:
* use photon_rs::effects::normalize;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* normalize(&mut img);
* ```
* @param {PhotonImage} photon_image
*/
module.exports.normalize = function(photon_image) {
_assertClass(photon_image, PhotonImage);
wasm.normalize(photon_image.__wbg_ptr);
};
/**
* Applies Floyd-Steinberg dithering to an image.
* Only RGB channels are processed, alpha remains unchanged.
* # Arguments
* * `photon_image` - A PhotonImage that contains a view into the image.
* * `depth` - bits per channel. Clamped between 1 and 8.
* # Example
*
* ```no_run
* // For example, to turn an image of type `PhotonImage` into a dithered image:
* use photon_rs::effects::dither;
* use photon_rs::native::open_image;
*
* let mut img = open_image("img.jpg").expect("File should open");
* let depth = 1;
* dither(&mut img, depth);
* ```
* @param {PhotonImage} photon_image
* @param {number} depth
*/
module.exports.dither = function(photon_image, depth) {
_assertClass(photon_image, PhotonImage);
wasm.dither(photon_image.__wbg_ptr, depth);
};
/**
* @param {PhotonImage} photon_image
* @param {Rgb} color_a
* @param {Rgb} color_b
*/
module.exports.duotone = function(photon_image, color_a, color_b) {
_assertClass(photon_image, PhotonImage);
_assertClass(color_a, Rgb);
var ptr0 = color_a.__destroy_into_raw();
_assertClass(color_b, Rgb);
var ptr1 = color_b.__destroy_into_raw();
wasm.duotone(photon_image.__wbg_ptr, ptr0, ptr1);
};
/**
* Add bordered-text to an image.
* The only font available as of now is Roboto.
* Note: A graphic design/text-drawing library is currently being developed, so stay tuned.
*
* # Arguments
* * `photon_image` - A PhotonImage.
* * `text` - Text string to be drawn to the image.
* * `x` - x-coordinate of where first letter's 1st pixel should be drawn.
* * `y` - y-coordinate of where first letter's 1st pixel should be drawn.
* * `font_size` - Font size in pixels of the text to be drawn.
*
* # Example
*
* ```no_run
* // For example to draw the string "Welcome to Photon!" at 10, 10:
* use photon_rs::native::open_image;
* use photon_rs::text::draw_text_with_border;
*
* // Open the image. A PhotonImage is returned.
* let mut img = open_image("img.jpg").expect("File should open");
* draw_text_with_border(&mut img, "Welcome to Photon!", 10_i32, 10_i32, 90_f32);
* ```
* @param {PhotonImage} photon_img
* @param {string} text
* @param {number} x
* @param {number} y
* @param {number} font_size
*/
module.exports.draw_text_with_border = function(photon_img, text, x, y, font_size) {
_assertClass(photon_img, PhotonImage);
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
wasm.draw_text_with_border(photon_img.__wbg_ptr, ptr0, len0, x, y, font_size);
};
/**
* Add text to an image.
* The only font available as of now is Roboto.
* Note: A graphic design/text-drawing library is currently being developed, so stay tuned.
*
* # Arguments
* * `photon_image` - A PhotonImage.
* * `text` - Text string to be drawn to the image.
* * `x` - x-coordinate of where first letter's 1st pixel should be drawn.
* * `y` - y-coordinate of where first letter's 1st pixel should be drawn.
* * `font_size` - Font size in pixels of the text to be drawn.
*
* # Example
*
* ```no_run
* // For example to draw the string "Welcome to Photon!" at 10, 10:
* use photon_rs::native::open_image;
* use photon_rs::text::draw_text;
*
* // Open the image. A PhotonImage is returned.
* let mut img = open_image("img.jpg").expect("File should open");
* draw_text(&mut img, "Welcome to Photon!", 10_i32, 10_i32, 90_f32);
* ```
* @param {PhotonImage} photon_img
* @param {string} text
* @param {number} x
* @param {number} y
* @param {number} font_size
*/
module.exports.draw_text = function(photon_img, text, x, y, font_size) {
_assertClass(photon_img, PhotonImage);
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
wasm.draw_text(photon_img.__wbg_ptr, ptr0, len0, x, y, font_size);
};
function passArray8ToWasm0(arg, malloc) {
const ptr = malloc(arg.length * 1, 1) >>> 0;
getUint8ArrayMemory0().set(arg, ptr / 1);
WASM_VECTOR_LEN = arg.length;
return ptr;
}
function getArrayU8FromWasm0(ptr, len) {
ptr = ptr >>> 0;
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
}
function takeFromExternrefTable0(idx) {
const value = wasm.__wbindgen_export_2.get(idx);
wasm.__externref_table_dealloc(idx);
return value;
}
/**
*! [temp] Check if WASM is supported.
*/
module.exports.run = function() {
const ret = wasm.run();
if (ret[1]) {
throw takeFromExternrefTable0(ret[0]);
}
};
/**
* Get the ImageData from a 2D canvas context
* @param {HTMLCanvasElement} canvas
* @param {CanvasRenderingContext2D} ctx
* @returns {ImageData}
*/
module.exports.get_image_data = function(canvas, ctx) {
const ret = wasm.get_image_data(canvas, ctx);
return ret;
};
/**
* Place a PhotonImage onto a 2D canvas.
* @param {HTMLCanvasElement} canvas
* @param {CanvasRenderingContext2D} ctx
* @param {PhotonImage} new_image
*/
module.exports.putImageData = function(canvas, ctx, new_image) {
_assertClass(new_image, PhotonImage);
var ptr0 = new_image.__destroy_into_raw();
wasm.putImageData(canvas, ctx, ptr0);
};
/**
* Convert a HTML5 Canvas Element to a PhotonImage.
*
* This converts the ImageData found in the canvas context to a PhotonImage,
* which can then have effects or filters applied to it.
* @param {HTMLCanvasElement} canvas
* @param {CanvasRenderingContext2D} ctx
* @returns {PhotonImage}
*/
module.exports.open_image = function(canvas, ctx) {
const ret = wasm.open_image(canvas, ctx);
return PhotonImage.__wrap(ret);
};
/**
* Convert ImageData to a raw pixel vec of u8s.
* @param {ImageData} imgdata
* @returns {Uint8Array}
*/
module.exports.to_raw_pixels = function(imgdata) {
const ret = wasm.to_raw_pixels(imgdata);
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
return v1;
};
/**
* Convert a base64 string to a PhotonImage.
* @param {string} base64
* @returns {PhotonImage}
*/
module.exports.base64_to_image = function(base64) {
const ptr0 = passStringToWasm0(base64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.base64_to_image(ptr0, len0);
return PhotonImage.__wrap(ret);
};
/**
* Convert a base64 string to a Vec of u8s.
* @param {string} base64
* @returns {Uint8Array}
*/
module.exports.base64_to_vec = function(base64) {
const ptr0 = passStringToWasm0(base64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.base64_to_vec(ptr0, len0);
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
return v2;
};
/**
* Convert a PhotonImage to JS-compatible ImageData.
* @param {PhotonImage} photon_image
* @returns {ImageData}
*/
module.exports.to_image_data = function(photon_image) {
_assertClass(photon_image, PhotonImage);
var ptr0 = photon_image.__destroy_into_raw();
const ret = wasm.to_image_data(ptr0);
return ret;
};
function isLikeNone(x) {
return x === undefined || x === null;
}
function addToExternrefTable0(obj) {
const idx = wasm.__externref_table_alloc();
wasm.__wbindgen_export_2.set(idx, obj);
return idx;
}
function handleError(f, args) {
try {
return f.apply(this, args);
} catch (e) {
const idx = addToExternrefTable0(e);
wasm.__wbindgen_exn_store(idx);
}
}
let cachedUint8ClampedArrayMemory0 = null;
function getUint8ClampedArrayMemory0() {
if (cachedUint8ClampedArrayMemory0 === null || cachedUint8ClampedArrayMemory0.byteLength === 0) {
cachedUint8ClampedArrayMemory0 = new Uint8ClampedArray(wasm.memory.buffer);
}
return cachedUint8ClampedArrayMemory0;
}
function getClampedArrayU8FromWasm0(ptr, len) {
ptr = ptr >>> 0;
return getUint8ClampedArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
}
module.exports.SamplingFilter = Object.freeze({ Nearest:1,"1":"Nearest",Triangle:2,"2":"Triangle",CatmullRom:3,"3":"CatmullRom",Gaussian:4,"4":"Gaussian",Lanczos3:5,"5":"Lanczos3", });
const PhotonImageFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_photonimage_free(ptr >>> 0, 1));
/**
* Provides the image's height, width, and contains the image's raw pixels.
* For use when communicating between JS and WASM, and also natively.
*/
class PhotonImage {
static __wrap(ptr) {
ptr = ptr >>> 0;
const obj = Object.create(PhotonImage.prototype);
obj.__wbg_ptr = ptr;
PhotonImageFinalization.register(obj, obj.__wbg_ptr, obj);
return obj;
}
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
PhotonImageFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_photonimage_free(ptr, 0);
}
/**
* Create a new PhotonImage from a Vec of u8s, which represent raw pixels.
* @param {Uint8Array} raw_pixels
* @param {number} width
* @param {number} height
*/
constructor(raw_pixels, width, height) {
const ptr0 = passArray8ToWasm0(raw_pixels, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.photonimage_new(ptr0, len0, width, height);
this.__wbg_ptr = ret >>> 0;
PhotonImageFinalization.register(this, this.__wbg_ptr, this);
return this;
}
/**
* Create a new PhotonImage from a base64 string.
* @param {string} base64
* @returns {PhotonImage}
*/
static new_from_base64(base64) {
const ptr0 = passStringToWasm0(base64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.base64_to_image(ptr0, len0);
return PhotonImage.__wrap(ret);
}
/**
* Create a new PhotonImage from a byteslice.
* @param {Uint8Array} vec
* @returns {PhotonImage}
*/
static new_from_byteslice(vec) {
const ptr0 = passArray8ToWasm0(vec, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.photonimage_new_from_byteslice(ptr0, len0);
return PhotonImage.__wrap(ret);
}
/**
* Create a new PhotonImage from a Blob/File.
* @param {Blob} blob
* @returns {PhotonImage}
*/
static new_from_blob(blob) {
const ret = wasm.photonimage_new_from_blob(blob);
return PhotonImage.__wrap(ret);
}
/**
* Create a new PhotonImage from a HTMLImageElement
* @param {HTMLImageElement} image
* @returns {PhotonImage}
*/
static new_from_image(image) {
const ret = wasm.photonimage_new_from_image(image);
return PhotonImage.__wrap(ret);
}
/**
* Get the width of the PhotonImage.
* @returns {number}
*/
get_width() {
const ret = wasm.photonimage_get_width(this.__wbg_ptr);
return ret >>> 0;
}
/**
* Get the PhotonImage's pixels as a Vec of u8s.
* @returns {Uint8Array}
*/
get_raw_pixels() {
const ret = wasm.photonimage_get_raw_pixels(this.__wbg_ptr);
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
return v1;
}
/**
* Get the height of the PhotonImage.
* @returns {number}
*/
get_height() {
const ret = wasm.photonimage_get_height(this.__wbg_ptr);
return ret >>> 0;
}
/**
* Convert the PhotonImage to base64.
* @returns {string}
*/
get_base64() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.photonimage_get_base64(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* Convert the PhotonImage to raw bytes. Returns PNG.
* @returns {Uint8Array}
*/
get_bytes() {
const ret = wasm.photonimage_get_bytes(this.__wbg_ptr);
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
return v1;
}
/**
* Convert the PhotonImage to raw bytes. Returns a JPEG.
* @param {number} quality
* @returns {Uint8Array}
*/
get_bytes_jpeg(quality) {
const ret = wasm.photonimage_get_bytes_jpeg(this.__wbg_ptr, quality);
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
return v1;
}
/**
* Convert the PhotonImage to raw bytes. Returns a WEBP.
* @returns {Uint8Array}
*/
get_bytes_webp() {
const ret = wasm.photonimage_get_bytes_webp(this.__wbg_ptr);
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
return v1;
}
/**
* Convert the PhotonImage's raw pixels to JS-compatible ImageData.
* @returns {ImageData}
*/
get_image_data() {
const ret = wasm.photonimage_get_image_data(this.__wbg_ptr);
return ret;
}
/**
* Convert ImageData to raw pixels, and update the PhotonImage's raw pixels to this.
* @param {ImageData} img_data
*/
set_imgdata(img_data) {
wasm.photonimage_set_imgdata(this.__wbg_ptr, img_data);
}
/**
* Calculates estimated filesize and returns number of bytes
* @returns {bigint}
*/
get_estimated_filesize() {
const ret = wasm.photonimage_get_estimated_filesize(this.__wbg_ptr);
return BigInt.asUintN(64, ret);
}
}
module.exports.PhotonImage = PhotonImage;
const RgbFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_rgb_free(ptr >>> 0, 1));
/**
* RGB color type.
*/
class Rgb {
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
RgbFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_rgb_free(ptr, 0);
}
/**
* Create a new RGB struct.
* @param {number} r
* @param {number} g
* @param {number} b
*/
constructor(r, g, b) {
const ret = wasm.rgb_new(r, g, b);
this.__wbg_ptr = ret >>> 0;
RgbFinalization.register(this, this.__wbg_ptr, this);
return this;
}
/**
* Set the Red value.
* @param {number} r
*/
set_red(r) {
wasm.rgb_set_red(this.__wbg_ptr, r);
}
/**
* Get the Green value.
* @param {number} g
*/
set_green(g) {
wasm.rgb_set_green(this.__wbg_ptr, g);
}
/**
* Set the Blue value.
* @param {number} b
*/
set_blue(b) {
wasm.rgb_set_blue(this.__wbg_ptr, b);
}
/**
* Get the Red value.
* @returns {number}
*/
get_red() {
const ret = wasm.rgb_get_red(this.__wbg_ptr);
return ret;
}
/**
* Get the Green value.
* @returns {number}
*/
get_green() {
const ret = wasm.rgb_get_green(this.__wbg_ptr);
return ret;
}
/**
* Get the Blue value.
* @returns {number}
*/
get_blue() {
const ret = wasm.rgb_get_blue(this.__wbg_ptr);
return ret;
}
}
module.exports.Rgb = Rgb;
const RgbaFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_rgba_free(ptr >>> 0, 1));
/**
* RGBA color type.
*/
class Rgba {
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
RgbaFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_rgba_free(ptr, 0);
}
/**
* Create a new RGBA struct.
* @param {number} r
* @param {number} g
* @param {number} b
* @param {number} a
*/
constructor(r, g, b, a) {
const ret = wasm.rgba_new(r, g, b, a);
this.__wbg_ptr = ret >>> 0;
RgbaFinalization.register(this, this.__wbg_ptr, this);
return this;
}
/**
* Set the Red value.
* @param {number} r
*/
set_red(r) {
wasm.rgb_set_red(this.__wbg_ptr, r);
}
/**
* Get the Green value.
* @param {number} g
*/
set_green(g) {
wasm.rgb_set_green(this.__wbg_ptr, g);
}
/**
* Set the Blue value.
* @param {number} b
*/
set_blue(b) {
wasm.rgb_set_blue(this.__wbg_ptr, b);
}
/**
* Set the alpha value.
* @param {number} a
*/
set_alpha(a) {
wasm.rgba_set_alpha(this.__wbg_ptr, a);
}
/**
* Get the Red value.
* @returns {number}
*/
get_red() {
const ret = wasm.rgb_get_red(this.__wbg_ptr);
return ret;
}
/**
* Get the Green value.
* @returns {number}
*/
get_green() {
const ret = wasm.rgb_get_green(this.__wbg_ptr);
return ret;
}
/**
* Get the Blue value.
* @returns {number}
*/
get_blue() {
const ret = wasm.rgb_get_blue(this.__wbg_ptr);
return ret;
}
/**
* Get the alpha value for this color.
* @returns {number}
*/
get_alpha() {
const ret = wasm.rgba_get_alpha(this.__wbg_ptr);
return ret;
}
}
module.exports.Rgba = Rgba;
module.exports.__wbg_new_abda76e883ba8a5f = function() {
const ret = new Error();
return ret;
};
module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
const ret = arg1.stack;
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len1 = WASM_VECTOR_LEN;
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};
module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
let deferred0_0;
let deferred0_1;
try {
deferred0_0 = arg0;
deferred0_1 = arg1;
console.error(getStringFromWasm0(arg0, arg1));
} finally {
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
}
};
module.exports.__wbg_instanceof_Window_c4b70662a0d2c5ec = function(arg0) {
let result;
try {
result = arg0 instanceof Window;
} catch (_) {
result = false;
}
const ret = result;
return ret;
};
module.exports.__wbg_document_e5c1786dea6542e4 = function(arg0) {
const ret = arg0.document;
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};
module.exports.__wbg_body_e70ae6abd01ae584 = function(arg0) {
const ret = arg0.body;
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};
module.exports.__wbg_createElement_5d4c76f218b78145 = function() { return handleError(function (arg0, arg1, arg2) {
const ret = arg0.createElement(getStringFromWasm0(arg1, arg2));
return ret;
}, arguments) };
module.exports.__wbg_width_4c6f0048d64cf86b = function(arg0) {
const ret = arg0.width;
return ret;
};
module.exports.__wbg_height_21f0d3fd8f753394 = function(arg0) {
const ret = arg0.height;
return ret;
};
module.exports.__wbg_width_79e0847ed5883b03 = function(arg0) {
const ret = arg0.width;
return ret;
};
module.exports.__wbg_height_e4e4e4779f8feac0 = function(arg0) {
const ret = arg0.height;
return ret;
};
module.exports.__wbg_data_fda507064d127f5b = function(arg0, arg1) {
const ret = arg1.data;
const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
const len1 = WASM_VECTOR_LEN;
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};
module.exports.__wbg_newwithu8clampedarrayandsh_1fddccb3a94a5e05 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
const ret = new ImageData(getClampedArrayU8FromWasm0(arg0, arg1), arg2 >>> 0, arg3 >>> 0);
return ret;
}, arguments) };
module.exports.__wbg_instanceof_CanvasRenderingContext2d_3abbe7ec7af32cae = function(arg0) {
let result;
try {
result = arg0 instanceof CanvasRenderingContext2D;
} catch (_) {
result = false;
}
const ret = result;
return ret;
};
module.exports.__wbg_drawImage_fede06db74e39a60 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
arg0.drawImage(arg1, arg2, arg3);
}, arguments) };
module.exports.__wbg_drawImage_f395c8e43c79a909 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
arg0.drawImage(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
}, arguments) };
module.exports.__wbg_getImageData_5e1c242046e6b59e = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
const ret = arg0.getImageData(arg1, arg2, arg3, arg4);
return ret;
}, arguments) };
module.exports.__wbg_putImageData_a8b3e177ee06d521 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
arg0.putImageData(arg1, arg2, arg3);
}, arguments) };
module.exports.__wbg_instanceof_HtmlCanvasElement_25d964a0dde6717e = function(arg0) {
let result;
try {
result = arg0 instanceof HTMLCanvasElement;
} catch (_) {
result = false;
}
const ret = result;
return ret;
};
module.exports.__wbg_width_dc225e55343b745e = function(arg0) {
const ret = arg0.width;
return ret;
};
module.exports.__wbg_setwidth_488780db69b08846 = function(arg0, arg1) {
arg0.width = arg1 >>> 0;
};
module.exports.__wbg_height_3a8bec2f3fe71b26 = function(arg0) {
const ret = arg0.height;
return ret;
};
module.exports.__wbg_setheight_1761808c18403921 = function(arg0, arg1) {
arg0.height = arg1 >>> 0;
};
module.exports.__wbg_getContext_fc99dbd3a9a7e318 = function() { return handleError(function (arg0, arg1, arg2) {
const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
}, arguments) };
module.exports.__wbg_settextContent_f82a86a8df347e1c = function(arg0, arg1, arg2) {
arg0.textContent = arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2);
};
module.exports.__wbg_appendChild_fa3b00dade9fc4cf = function() { return handleError(function (arg0, arg1) {
const ret = arg0.appendChild(arg1);
return ret;
}, arguments) };
module.exports.__wbg_newnoargs_e643855c6572a4a8 = function(arg0, arg1) {
const ret = new Function(getStringFromWasm0(arg0, arg1));
return ret;
};
module.exports.__wbg_call_f96b398515635514 = function() { return handleError(function (arg0, arg1) {
const ret = arg0.call(arg1);
return ret;
}, arguments) };
module.exports.__wbg_self_b9aad7f1c618bfaf = function() { return handleError(function () {
const ret = self.self;
return ret;
}, arguments) };
module.exports.__wbg_window_55e469842c98b086 = function() { return handleError(function () {
const ret = window.window;
return ret;
}, arguments) };
module.exports.__wbg_globalThis_d0957e302752547e = function() { return handleError(function () {
const ret = globalThis.globalThis;
return ret;
}, arguments) };
module.exports.__wbg_global_ae2f87312b8987fb = function() { return handleError(function () {
const ret = global.global;
return ret;
}, arguments) };
module.exports.__wbindgen_is_undefined = function(arg0) {
const ret = arg0 === undefined;
return ret;
};
module.exports.__wbg_buffer_fcbfb6d88b2732e9 = function(arg0) {
const ret = arg0.buffer;
return ret;
};
module.exports.__wbg_new_bc5d9aad3f9ac80e = function(arg0) {
const ret = new Uint8Array(arg0);
return ret;
};
module.exports.__wbg_set_4b3aa8445ac1e91c = function(arg0, arg1, arg2) {
arg0.set(arg1, arg2 >>> 0);
};
module.exports.__wbg_length_d9c4ded7e708c6a1 = function(arg0) {
const ret = arg0.length;
return ret;
};
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
const ret = debugString(arg1);
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len1 = WASM_VECTOR_LEN;
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};
module.exports.__wbindgen_throw = function(arg0, arg1) {
throw new Error(getStringFromWasm0(arg0, arg1));
};
module.exports.__wbindgen_memory = function() {
const ret = wasm.memory;
return ret;
};
module.exports.__wbindgen_init_externref_table = function() {
const table = wasm.__wbindgen_export_2;
const offset = table.grow(4);
table.set(0, undefined);
table.set(offset + 0, undefined);
table.set(offset + 1, null);
table.set(offset + 2, true);
table.set(offset + 3, false);
;
};
const path = require('path').join(__dirname, 'photon_rs_bg.wasm');
const bytes = require('fs').readFileSync(path);
const wasmModule = new WebAssembly.Module(bytes);
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
wasm = wasmInstance.exports;
module.exports.__wasm = wasm;
wasm.__wbindgen_start();
[Showing lines 780-2463 of 2463 (50.0KB limit). Full output: /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/pi-bash-222d08a976bea191.log]The issue is clear now. Looking at the last lines of photon_rs.js:
const path = require('path').join(__dirname, 'photon_rs_bg.wasm');const bytes = require('fs').readFileSync(path);This is trying to load the WASM file using require('fs').readFileSync(). When Bun bundles the binary, this path gets hardcoded to the absolute path during build time on GitHub Actions: /home/runner/work/pi-mono/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm.
But Bun can handle this if the wasm file is embedded. Let me look at how the binary is built.
>cd /Users/badlogic/workspaces/pi-mono && cat node_modules/@silvia-odwyer/photon-node/photon_rs.js | tail -20const table = wasm.__wbindgen_export_2;
const offset = table.grow(4);
table.set(0, undefined);
table.set(offset + 0, undefined);
table.set(offset + 1, null);
table.set(offset + 2, true);
table.set(offset + 3, false);
;
};
const path = require('path').join(__dirname, 'photon_rs_bg.wasm');
const bytes = require('fs').readFileSync(path);
const wasmModule = new WebAssembly.Module(bytes);
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
wasm = wasmInstance.exports;
module.exports.__wasm = wasm;
wasm.__wbindgen_start();I see the issue now. The build command is:
bun build --compile ./dist/cli.js --outfile dist/piThis bundles the JS code, but the WASM file from @silvia-odwyer/photon-node isn't embedded properly. The photon_rs.js file tries to read the WASM file at runtime with:
const path = require('path').join(__dirname, 'photon_rs_bg.wasm');const bytes = require('fs').readFileSync(path);But when bundled, __dirname becomes the build machine's path: /home/runner/work/pi-mono/pi-mono/node_modules/@silvia-odwyer/photon-node/.
Let me check when photon was added to the project and how other wasm modules might be handled.
Let me check what changed between v0.45.7 and v0.46.0 when the issue started:
>cd /Users/badlogic/workspaces/pi-mono && git log --oneline v0.45.7..v0.46.0 -- packages/coding-agent/package.json packages/coding-agent/src/utils/image-resize.ts packages/coding-agent/src/utils/image-convert.ts 2>/dev/null | head -200aaa4ef5 Release v0.46.0
6bf073f1 build(coding-agent): replaced wasm-vips with @silvia-odwyer/photon-node for image processing (#710)>cd /Users/badlogic/workspaces/pi-mono && git log --oneline --all | grep -i "photon\|image\|resize" | head -106bf073f1 build(coding-agent): replaced wasm-vips with @silvia-odwyer/photon-node for image processing (#710)
e45fc5f9 Replace sharp with wasm-vips for image processing
1d8d5d3d Add handleImage and multiTurn tests for vercel-ai-gateway in stream.test.ts
90e0b95c Merge branch 'fix/image-paste-in-wayland'
538ae6a0 fix(coding-agent): paste clipboard images on Wayland via wl-paste/xclip
df5ad091 docs: add blockImages setting to README
a1d0b1c1 Merge PR #492: Add blockImages setting
1fc2a912 Add blockImages setting to prevent images from being sent to LLM providers
b582a6b7 feat(coding-agent): add blockImages setting to prevent image uploads
affa618b docs: add note about macOS Finder image copy behaviorThe issue was introduced in v0.46.0 with commit 6bf073f1 that replaced wasm-vips with @silvia-odwyer/photon-node. Let me see what issue #710 was about and if wasm-vips had a special handling.
The root cause is clear: photon_rs.js from @silvia-odwyer/photon-node uses:
const path = require('path').join(__dirname, 'photon_rs_bg.wasm');const bytes = require('fs').readFileSync(path);When Bun compiles the binary, this path becomes hardcoded to the build machine path (/home/runner/work/...). The WASM file isn't embedded in the binary.
Let me verify Docker can reproduce this and then explore potential solutions.
Now let me test locally in Docker to confirm the issue:
>cd /Users/badlogic/workspaces/pi-mono && docker run --rm -it debian:bookworm-slim bash -c "
apt-get update && apt-get install -y wget ca-certificates >/dev/null 2>&1 && \
mkdir /tmp/pi-test && cd /tmp/pi-test && \
wget -q https://github.com/badlogic/pi-mono/releases/download/v0.47.0/pi-linux-x64.tar.gz && \
tar -xzf pi-linux-x64.tar.gz && \
./pi/pi --version 2>&1 || echo '--- test failed as expected ---'
"the input device is not a TTY
Command exited with code 1Let me run without -it flag:
>cd /Users/badlogic/workspaces/pi-mono && docker run --rm debian:bookworm-slim bash -c "
apt-get update && apt-get install -y wget ca-certificates >/dev/null 2>&1 && \
mkdir /tmp/pi-test && cd /tmp/pi-test && \
wget -q https://github.com/badlogic/pi-mono/releases/download/v0.47.0/pi-linux-x64.tar.gz && \
tar -xzf pi-linux-x64.tar.gz && \
./pi/pi --version 2>&1 || echo '--- command failed ---'
"Unable to find image 'debian:bookworm-slim' locally
bookworm-slim: Pulling from library/debian
33bdc9671af8: Pulling fs layer
33bdc9671af8: Verifying Checksum
33bdc9671af8: Download complete
33bdc9671af8: Pull complete
Digest: sha256:56ff6d36d4eb3db13a741b342ec466f121480b5edded42e4b7ee850ce7a418ee
Status: Downloaded newer image for debian:bookworm-slim
Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:4 http://deb.debian.org/debian bookworm/main arm64 Packages [8691 kB]
Get:5 http://deb.debian.org/debian bookworm-updates/main arm64 Packages [6936 B]
Get:6 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages [287 kB]
Fetched 9239 kB in 1s (6734 kB/s)
Reading package lists...
rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2
--- command failed ---
bash: line 2: 2692 Trace/breakpoint trap ./pi/pi --version 2>&1Rosetta issue (running x86 on ARM Mac). Let me try a different approach. I should test on a proper x86 platform but since I can confirm from the issue report that the error is real, let me focus on analyzing the root cause and proposing a fix.
The root cause is clear:
@silvia-odwyer/photon-node has a photon_rs.js file that loads the WASM file at runtime using fs.readFileSync(__dirname + '/photon_rs_bg.wasm')__dirname becomes the absolute path from the build machine (/home/runner/work/...)The solution needs to ensure the WASM file is embedded in the binary.
Possible solutions:
Use Bun's --asset-naming or file embedding: Bun can embed assets but needs explicit configuration.
Create a wrapper module: Create our own module that uses a different loading approach:
Dynamic import with URL: Some WASM modules support loading via URL/fetch
Patch at build time: Modify the photon_rs.js during build to use an embedded approach
Use a different image library: One that doesn't have this WASM loading issue
Let me investigate how Bun handles WASM files in compiled binaries:
Let me investigate how Bun handles WASM in compiled binaries and check for potential solutions:
>cd /Users/badlogic/workspaces/pi-mono && grep -r "wasm" packages/coding-agent/src --include="*.ts" | grep -v ".d.ts" | head -20(no output)>cd /Users/badlogic/workspaces/pi-mono && ls node_modules/@silvia-odwyer/photon-node/LICENSE.md
package.json
photon_rs_bg.js
photon_rs_bg.wasm
photon_rs.d.ts
photon_rs.js
README.mdLet me check the photon_rs_bg.js file. This is typically the WASM binding that initializes things.
>cd /Users/badlogic/workspaces/pi-mono && head -100 node_modules/@silvia-odwyer/photon-node/photon_rs_bg.jsimport * as wasm from './photon_rs_bg.wasm';
const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];
heap[idx] = obj;
return idx;
}
function debugString(val) {
// primitive types
const type = typeof val;
if (type == 'number' || type == 'boolean' || val == null) {
return `${val}`;
}
if (type == 'string') {
return `"${val}"`;
}
if (type == 'symbol') {
const description = val.description;
if (description == null) {
return 'Symbol';
} else {
return `Symbol(${description})`;
}
}
if (type == 'function') {
const name = val.name;
if (typeof name == 'string' && name.length > 0) {
return `Function(${name})`;
} else {
return 'Function';
}
}
// objects
if (Array.isArray(val)) {
const length = val.length;
let debug = '[';
if (length > 0) {
debug += debugString(val[0]);
}
for(let i = 1; i < length; i++) {
debug += ', ' + debugString(val[i]);
}
debug += ']';
return debug;
}
// Test for built-in
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
let className;
if (builtInMatches.length > 1) {
className = builtInMatches[1];
} else {
// Failed to match the standard '[object ClassName]'
return toString.call(val);
}
if (className == 'Object') {
// we're a user defined class or Object
// JSON.stringify avoids problems with cycles, and is generally much
// easier than looping through ownProperties of `val`.
try {
return 'Object(' + JSON.stringify(val) + ')';
} catch (_) {
return 'Object';
}
}
// errors
if (val instanceof Error) {
return `${val.name}: ${val.message}\n${val.stack}`;
}
// TODO we could test for more things here, like `Set`s and `Map`s.
return className;
}
let WASM_VECTOR_LEN = 0;
let cachegetUint8Memory0 = null;
function getUint8Memory0() {>cd /Users/badlogic/workspaces/pi-mono && cat node_modules/@silvia-odwyer/photon-node/package.json{
"name": "@silvia-odwyer/photon-node",
"collaborators": [
"Silvia O'Dwyer <[REDACTED]>"
],
"description": "High-performance image processing library for native use and the web",
"version": "0.3.4",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/silvia-odwyer/photon"
},
"files": [
"photon_rs_bg.wasm",
"photon_rs.js",
"photon_rs_bg.js",
"photon_rs.d.ts",
"LICENSE.md"
],
"main": "photon_rs.js",
"homepage": "https://silvia-odwyer.github.io/photon/",
"types": "photon_rs.d.ts"
}Interesting! The package has two entry points:
photon_rs.js (main): Uses CommonJS style with require('fs').readFileSync(path) to load WASM at runtimephoton_rs_bg.js: Uses ESM-style import with import * as wasm from './photon_rs_bg.wasm'This is important. When using ESM (photon_rs_bg.js), Bun can potentially handle the WASM import correctly. But when using CJS (photon_rs.js), it uses filesystem access which breaks in compiled binaries.
The current code in image-resize.ts and image-convert.ts uses:tsimport photon from "@silvia-odwyer/photon-node";
This resolves to the main field in package.json, which is photon_rs.js (the problematic one).
Solution approaches:
Import from photon_rs_bg.js directly: This might work better with Bun's bundler since it uses ESM imports for WASM.
Create a wrapper that loads WASM differently: Load the WASM bytes directly and instantiate manually.
Use Bun's asset embedding: Use bun: special imports or embed the WASM as base64.
Let me check if we can use the ESM entry point directly.
Let me check how the imports work and if there's an ESM variant we could use:
>cd /Users/badlogic/workspaces/pi-mono && head -50 node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js && echo "---" && tail -50 node_modules/@silvia-odwyer/photon-node/photon_rs_bg.jsimport * as wasm from './photon_rs_bg.wasm';
const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function dropObject(idx) {
if (idx < 36) return;
heap[idx] = heap_next;
heap_next = idx;
}
function takeObject(idx) {
const ret = getObject(idx);
dropObject(idx);
return ret;
}
function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx];
heap[idx] = obj;
return idx;
}
function debugString(val) {
// primitive types
const type = typeof val;
if (type == 'number' || type == 'boolean' || val == null) {
return `${val}`;
}
if (type == 'string') {
return `"${val}"`;
}
if (type == 'symbol') {
const description = val.description;
if (description == null) {
return 'Symbol';
} else {
return `Symbol(${description})`;
}
}
if (type == 'function') {
const name = val.name;
---
var ret = getObject(arg0).call(getObject(arg1));
return addHeapObject(ret);
}, arguments) };
export function __wbindgen_object_clone_ref(arg0) {
var ret = getObject(arg0);
return addHeapObject(ret);
};
export function __wbg_self_c6fbdfc2918d5e58() { return handleError(function () {
var ret = self.self;
return addHeapObject(ret);
}, arguments) };
export function __wbg_window_baec038b5ab35c54() { return handleError(function () {
var ret = window.window;
return addHeapObject(ret);
}, arguments) };
export function __wbg_globalThis_3f735a5746d41fbd() { return handleError(function () {
var ret = globalThis.globalThis;
return addHeapObject(ret);
}, arguments) };
export function __wbg_global_1bc0b39582740e95() { return handleError(function () {
var ret = global.global;
return addHeapObject(ret);
}, arguments) };
export function __wbindgen_is_undefined(arg0) {
var ret = getObject(arg0) === undefined;
return ret;
};
export function __wbindgen_debug_string(arg0, arg1) {
var ret = debugString(getObject(arg1));
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len0;
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
};
export function __wbindgen_throw(arg0, arg1) {
throw new Error(getStringFromWasm0(arg0, arg1));
};
export function __wbindgen_rethrow(arg0) {
throw takeObject(arg0);
};The ESM version (photon_rs_bg.js) uses import * as wasm from './photon_rs_bg.wasm' which should allow Bun to properly embed the WASM file when compiling.
However, looking at the current code:ts import photon from "@silvia-odwyer/photon-node";
This imports from the main field (photon_rs.js) which uses fs.readFileSync().
Looking at photon_rs_bg.js, it exports individual functions, not a default photon object. The structure is different from photon_rs.js.
Let me check what photon_rs.js exports vs photon_rs_bg.js.
>cd /Users/badlogic/workspaces/pi-mono && grep -E "^(module\.)?exports\." node_modules/@silvia-odwyer/photon-node/photon_rs.js | head -30module.exports.alter_channel = function(img, channel, amt) {
module.exports.alter_red_channel = function(photon_image, amt) {
module.exports.alter_green_channel = function(img, amt) {
module.exports.alter_blue_channel = function(img, amt) {
module.exports.alter_two_channels = function(img, channel1, amt1, channel2, amt2) {
module.exports.alter_channels = function(img, r_amt, g_amt, b_amt) {
module.exports.remove_channel = function(img, channel, min_filter) {
module.exports.remove_red_channel = function(img, min_filter) {
module.exports.remove_green_channel = function(img, min_filter) {
module.exports.remove_blue_channel = function(img, min_filter) {
module.exports.swap_channels = function(img, channel1, channel2) {
module.exports.invert = function(photon_image) {
module.exports.selective_hue_rotate = function(photon_image, ref_color, degrees) {
module.exports.selective_color_convert = function(photon_image, ref_color, new_color, fraction) {
module.exports.selective_lighten = function(img, ref_color, amt) {
module.exports.selective_desaturate = function(img, ref_color, amt) {
module.exports.selective_saturate = function(img, ref_color, amt) {
module.exports.selective_greyscale = function(photon_image, ref_color) {
module.exports.monochrome = function(img, r_offset, g_offset, b_offset) {
module.exports.sepia = function(img) {
module.exports.grayscale = function(img) {
module.exports.grayscale_human_corrected = function(img) {
module.exports.desaturate = function(img) {
module.exports.decompose_min = function(img) {
module.exports.decompose_max = function(img) {
module.exports.grayscale_shades = function(photon_image, num_shades) {
module.exports.r_grayscale = function(photon_image) {
module.exports.g_grayscale = function(photon_image) {
module.exports.b_grayscale = function(photon_image) {
module.exports.single_channel_grayscale = function(photon_image, channel) {>cd /Users/badlogic/workspaces/pi-mono && grep "^export " node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js | head -30export function crop(photon_image, x1, y1, x2, y2) {
export function crop_img_browser(source_canvas, width, height, left, top) {
export function fliph(photon_image) {
export function flipv(photon_image) {
export function resize_img_browser(photon_img, width, height, sampling_filter) {
export function resize(photon_img, width, height, sampling_filter) {
export function seam_carve(img, width, height) {
export function padding_uniform(img, padding, padding_rgba) {
export function padding_left(img, padding, padding_rgba) {
export function padding_right(img, padding, padding_rgba) {
export function padding_top(img, padding, padding_rgba) {
export function padding_bottom(img, padding, padding_rgba) {
export function rotate(img, angle) {
export function resample(img, dst_width, dst_height) {
export function draw_text_with_border(photon_img, text, x, y) {
export function draw_text(photon_img, text, x, y) {
export function run() {
export function get_image_data(canvas, ctx) {
export function putImageData(canvas, ctx, new_image) {
export function open_image(canvas, ctx) {
export function to_raw_pixels(imgdata) {
export function base64_to_image(base64) {
export function base64_to_vec(base64) {
export function to_image_data(photon_image) {
export function alter_channel(img, channel, amt) {
export function alter_red_channel(photon_image, amt) {
export function alter_green_channel(img, amt) {
export function alter_blue_channel(img, amt) {
export function alter_two_channels(img, channel1, amt1, channel2, amt2) {
export function alter_channels(img, r_amt, g_amt, b_amt) {Both modules export the same functions. The ESM version (photon_rs_bg.js) exports named functions, while the CJS version (photon_rs.js) attaches them to module.exports.Let me check if photon_rs_bg.js also exports the PhotonImage class and SamplingFilter which are used in the codebase:
>cd /Users/badlogic/workspaces/pi-mono && grep -E "^export (class|const) " node_modules/@silvia-odwyer/photon-node/photon_rs_bg.jsexport const SamplingFilter = Object.freeze({ Nearest:1,"1":"Nearest",Triangle:2,"2":"Triangle",CatmullRom:3,"3":"CatmullRom",Gaussian:4,"4":"Gaussian",Lanczos3:5,"5":"Lanczos3", });
export class PhotonImage {
export class Rgb {
export class Rgba {>cd /Users/badlogic/workspaces/pi-mono && grep "PhotonImage\|SamplingFilter" packages/coding-agent/src/utils/image-resize.ts packages/coding-agent/src/utils/image-convert.tspackages/coding-agent/src/utils/image-resize.ts: let image: ReturnType<typeof photon.PhotonImage.new_from_byteslice> | undefined;
packages/coding-agent/src/utils/image-resize.ts: image = photon.PhotonImage.new_from_byteslice(new Uint8Array(inputBuffer));
packages/coding-agent/src/utils/image-resize.ts: const resized = photon.resize(image!, width, height, photon.SamplingFilter.Lanczos3);
packages/coding-agent/src/utils/image-convert.ts: const image = photon.PhotonImage.new_from_byteslice(new Uint8Array(Buffer.from(base64Data, "base64")));Both PhotonImage and SamplingFilter are exported from photon_rs_bg.js. The fix should be:
@silvia-odwyer/photon-node/photon_rs_bg.js instead of @silvia-odwyer/photon-nodeThe current code does:tsimport photon from "@silvia-odwyer/photon-node";Then uses:- photon.PhotonImage.new_from_byteslice(...)- photon.resize(...)- photon.SamplingFilter.Lanczos3
With the ESM variant, it would be:tsimport { PhotonImage, resize, SamplingFilter } from "@silvia-odwyer/photon-node/photon_rs_bg.js"; Then:- PhotonImage.new_from_byteslice(...)- resize(...)- SamplingFilter.Lanczos3This should allow Bun's bundler to properly handle the WASM import (import * as wasm from './photon_rs_bg.wasm') and embed it in the compiled binary.Let me create a summary of the analysis.
Root Cause:
The issue was introduced in commit 6bf073f1 (v0.46.0) when wasm-vips was replaced with @silvia-odwyer/photon-node for image processing.
The @silvia-odwyer/photon-node package has two entry points:
photon_rs.js (main, CJS): Loads WASM at runtime via fs.readFileSync(__dirname + '/photon_rs_bg.wasm')photon_rs_bg.js (ESM): Uses import * as wasm from './photon_rs_bg.wasm'The current code imports from the main entry point:
import photon from "@silvia-odwyer/photon-node"; // resolves to photon_rs.jsWhen Bun compiles the binary, __dirname in photon_rs.js becomes the absolute build-time path (/home/runner/work/pi-mono/pi-mono/node_modules/@silvia-odwyer/photon-node/), which doesn't exist on the user's machine.
Change the import to use the ESM entry point (photon_rs_bg.js) which uses ESM-style WASM imports that Bun can properly embed:
Files to modify:
packages/coding-agent/src/utils/image-resize.ts:// Before:import photon from "@silvia-odwyer/photon-node";
// After:import { PhotonImage, resize, SamplingFilter } from "@silvia-odwyer/photon-node/photon_rs_bg.js";
// Update usages:// photon.PhotonImage.new_from_byteslice(...) → PhotonImage.new_from_byteslice(...)// photon.resize(...) → resize(...)// photon.SamplingFilter.Lanczos3 → SamplingFilter.Lanczos3packages/coding-agent/src/utils/image-convert.ts:// Before:import photon from "@silvia-odwyer/photon-node";
// After:import { PhotonImage } from "@silvia-odwyer/photon-node/photon_rs_bg.js";
// Update usages:// photon.PhotonImage.new_from_byteslice(...) → PhotonImage.new_from_byteslice(...)This approach should allow Bun to properly embed the WASM file during compilation since the ESM import syntax is recognized by bundlers.
Risk: The photon_rs_bg.js file uses ESM-style import for the WASM file. This is the standard approach that bundlers like Bun understand and can embed properly. The fix is minimal and doesn't change functionality, only the module resolution path.
make the change
The user wants me to implement the fix. I need to:
npm run check to verifyLet me start by reading both files.
Now I'll update both files to use the ESM entry point. Let me make the changes:
Now I need to update the usages in the files:1. image-resize.ts: Replace photon.PhotonImage with PhotonImage, photon.resize with resize, photon.SamplingFilter with SamplingFilter
2. image-convert.ts: Replace photon.PhotonImage with PhotonImage
Now I should run npm run check to verify everything works.
>cd /Users/badlogic/workspaces/pi-mono && npm run check 2>&1> pi-monorepo@0.0.3 check
> biome check --write . && tsgo --noEmit && npm run check -w @mariozechner/pi-web-ui
Checked 405 files in 335ms. No fixes applied.
packages/coding-agent/src/utils/image-convert.ts(3,29): error TS7016: Could not find a declaration file for module '@silvia-odwyer/photon-node/photon_rs_bg.js'. '/Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/silvia-odwyer__photon-node` if it exists or add a new declaration (.d.ts) file containing `declare module '@silvia-odwyer/photon-node/photon_rs_bg.js';`
packages/coding-agent/src/utils/image-resize.ts(4,53): error TS7016: Could not find a declaration file for module '@silvia-odwyer/photon-node/photon_rs_bg.js'. '/Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/silvia-odwyer__photon-node` if it exists or add a new declaration (.d.ts) file containing `declare module '@silvia-odwyer/photon-node/photon_rs_bg.js';`
Command exited with code 2The TypeScript compiler can't find types for the ESM entry point. I need to create a declaration file for it. The main entry (photon_rs.js) has types from photon_rs.d.ts, but there's no declaration for photon_rs_bg.js.
I have two options:
.d.ts file that declares the moduleLet me check what the existing types look like:
The types file is extensive. I need to create a declaration file that tells TypeScript that the ESM entry point exports the same types. The easiest approach is to add a TypeScript declaration that re-exports from the main types.
Let me create a declaration file for the ESM entry point.
I need to add a TypeScript declaration for the ESM entry point. Let me create one:
Now I need to make sure TypeScript picks up this declaration file. Let me check the tsconfig.
>cd /Users/badlogic/workspaces/pi-mono && npm run check 2>&1> pi-monorepo@0.0.3 check
> biome check --write . && tsgo --noEmit && npm run check -w @mariozechner/pi-web-ui
Checked 406 files in 338ms. No fixes applied.
> @mariozechner/pi-web-ui@0.47.0 check
> biome check --write . && tsc --noEmit && cd example && biome check --write . && tsc --noEmit
Checked 73 files in 46ms. No fixes applied.
Checked 3 files in 8ms. No fixes applied.The check passes now. Let me verify the files look correct by reading them.
Check passes. Let me verify the changes:
The changes look good. Now I should build the binary locally to test if the WASM is properly embedded. Let me try building locally.
Now let me build and test locally:
>cd /Users/badlogic/workspaces/pi-mono/packages/coding-agent && npm run build:binary 2>&1> @mariozechner/pi-coding-agent@0.47.0 build:binary
> npm run build && bun build --compile ./dist/cli.js --outfile dist/pi && npm run copy-binary-assets
> @mariozechner/pi-coding-agent@0.47.0 build
> tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js && npm run copy-assets
src/utils/image-convert.ts(3,29): error TS7016: Could not find a declaration file for module '@silvia-odwyer/photon-node/photon_rs_bg.js'. '/Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/silvia-odwyer__photon-node` if it exists or add a new declaration (.d.ts) file containing `declare module '@silvia-odwyer/photon-node/photon_rs_bg.js';`
src/utils/image-resize.ts(4,53): error TS7016: Could not find a declaration file for module '@silvia-odwyer/photon-node/photon_rs_bg.js'. '/Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/silvia-odwyer__photon-node` if it exists or add a new declaration (.d.ts) file containing `declare module '@silvia-odwyer/photon-node/photon_rs_bg.js';`
npm error Lifecycle script `build` failed with error:
npm error code 1
npm error path /Users/badlogic/workspaces/pi-mono/packages/coding-agent
npm error workspace @mariozechner/pi-coding-agent@0.47.0
npm error location /Users/badlogic/workspaces/pi-mono/packages/coding-agent
npm error command failed
npm error command sh -c tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js && npm run copy-assets
npm error Lifecycle script `build:binary` failed with error:
npm error code 1
npm error path /Users/badlogic/workspaces/pi-mono/packages/coding-agent
npm error workspace @mariozechner/pi-coding-agent@0.47.0
npm error location /Users/badlogic/workspaces/pi-mono/packages/coding-agent
npm error command failed
npm error command sh -c npm run build && bun build --compile ./dist/cli.js --outfile dist/pi && npm run copy-binary-assets
Command exited with code 1The build is using a separate tsconfig for building. Let me check how the build config differs:
The tsconfig.build.json explicitly excludes **/*.d.ts and src/**/*.d.ts files, so my declaration file is being ignored. Looking at the base config to understand the project structure:
The issue is that tsconfig.build.json explicitly excludes .d.ts files. This is typical to avoid emitting declaration files during build. I need to make the declaration file visible to TypeScript regardless of the build config.The correct approach is to use TypeScript's typeRoots or add the types directory to the config. But since the file is being excluded, I should probably:1. Add a reference in typeRoots
2. Or include it explicitlyActually, looking at the problem more carefully: the --noEmit check worked because it doesn't exclude .d.ts files. But the build config does. The solution is to either:1. Not exclude .d.ts files from the build config (they shouldn't be compiled anyway since they're declarations)
2. Or put the declaration in a global types directory that gets included
Let me check if there's a global types directory used across the monorepo:
>cd /Users/badlogic/workspaces/pi-mono && find . -name "*.d.ts" -path "*/src/*" -not -path "*/node_modules/*" | head -10./packages/coding-agent/src/types/photon-node.d.tsLet me check if other packages have declarations and how they're handled. Actually, the simplest fix here is to modify the build config to not exclude .d.ts files since they aren't compiled anyway, just used for type checking. Or I could move the declaration to a location that isn't excluded.Alternatively, since the type declaration is just adding a module augmentation, I could put it in a file that TypeScript will read. Let me check what options exist.
Actually the cleaner solution is to remove the exclusion of .d.ts files from the build config, since TypeScript doesn't emit them during compilation anyway (they're just declarations). Or I could explicitly include my declarations.
The build config excludes .d.ts files. Let me fix the config to include the type declarations:
Now let me try the build again.
>cd /Users/badlogic/workspaces/pi-mono/packages/coding-agent && npm run build:binary 2>&1658 | wasm.run();
^
warn: Import "run" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:658:10
676 | var ret = wasm.get_image_data(addBorrowedObject(canvas), addBorrowedObject(ctx));
^
warn: Import "get_image_data" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:676:24
694 | wasm.putImageData(addHeapObject(canvas), addHeapObject(ctx), ptr0);
^
warn: Import "putImageData" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:694:10
707 | var ret = wasm.open_image(addHeapObject(canvas), addHeapObject(ctx));
^
warn: Import "open_image" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:707:20
718 | const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
^
warn: Import "__wbindgen_add_to_stack_pointer" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:718:29
719 | wasm.to_raw_pixels(retptr, addHeapObject(imgdata));
^
warn: Import "to_raw_pixels" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:719:14
723 | wasm.__wbindgen_free(r0, r1 * 1);
^
warn: Import "__wbindgen_free" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:723:14
738 | var ret = wasm.base64_to_image(ptr0, len0);
^
warn: Import "base64_to_image" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:738:20
752 | wasm.base64_to_vec(retptr, ptr0, len0);
^
warn: Import "base64_to_vec" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:752:14
772 | var ret = wasm.to_image_data(ptr0);
^
warn: Import "to_image_data" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:772:20
815 | wasm.alter_channel(img.ptr, channel, amt);
^
warn: Import "alter_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:815:10
840 | wasm.alter_red_channel(photon_image.ptr, amt);
^
warn: Import "alter_red_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:840:10
865 | wasm.alter_green_channel(img.ptr, amt);
^
warn: Import "alter_green_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:865:10
890 | wasm.alter_blue_channel(img.ptr, amt);
^
warn: Import "alter_blue_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:890:10
921 | wasm.alter_two_channels(img.ptr, channel1, amt1, channel2, amt2);
^
warn: Import "alter_two_channels" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:921:10
951 | wasm.alter_channels(img.ptr, r_amt, g_amt, b_amt);
^
warn: Import "alter_channels" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:951:10
980 | wasm.remove_channel(img.ptr, channel, min_filter);
^
warn: Import "remove_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:980:10
1005 | wasm.remove_red_channel(img.ptr, min_filter);
^
warn: Import "remove_red_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1005:10
1030 | wasm.remove_green_channel(img.ptr, min_filter);
^
warn: Import "remove_green_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1030:10
1055 | wasm.remove_blue_channel(img.ptr, min_filter);
^
warn: Import "remove_blue_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1055:10
1082 | wasm.swap_channels(img.ptr, channel1, channel2);
^
warn: Import "swap_channels" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1082:10
1103 | wasm.invert(photon_image.ptr);
^
warn: Import "invert" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1103:10
1138 | wasm.selective_hue_rotate(photon_image.ptr, ptr0, degrees);
^
warn: Import "selective_hue_rotate" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1138:10
1179 | wasm.selective_color_convert(photon_image.ptr, ptr0, ptr1, fraction);
^
warn: Import "selective_color_convert" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1179:10
1213 | wasm.selective_lighten(img.ptr, ptr0, amt);
^
warn: Import "selective_lighten" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1213:10
1248 | wasm.selective_desaturate(img.ptr, ptr0, amt);
^
warn: Import "selective_desaturate" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1248:10
1283 | wasm.selective_saturate(img.ptr, ptr0, amt);
^
warn: Import "selective_saturate" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1283:10
1319 | wasm.selective_greyscale(ptr0, ptr1);
^
warn: Import "selective_greyscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1319:10
1350 | wasm.monochrome(img.ptr, r_offset, g_offset, b_offset);
^
warn: Import "monochrome" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1350:10
1372 | wasm.sepia(img.ptr);
^
warn: Import "sepia" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1372:10
1394 | wasm.grayscale(img.ptr);
^
warn: Import "grayscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1394:10
1416 | wasm.grayscale_human_corrected(img.ptr);
^
warn: Import "grayscale_human_corrected" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1416:10
1438 | wasm.desaturate(img.ptr);
^
warn: Import "desaturate" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1438:10
1460 | wasm.decompose_min(img.ptr);
^
warn: Import "decompose_min" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1460:10
1482 | wasm.decompose_max(img.ptr);
^
warn: Import "decompose_max" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1482:10
1506 | wasm.grayscale_shades(photon_image.ptr, num_shades);
^
warn: Import "grayscale_shades" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1506:10
1527 | wasm.r_grayscale(photon_image.ptr);
^
warn: Import "r_grayscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1527:10
1548 | wasm.g_grayscale(photon_image.ptr);
^
warn: Import "g_grayscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1548:10
1569 | wasm.b_grayscale(photon_image.ptr);
^
warn: Import "b_grayscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1569:10
1592 | wasm.single_channel_grayscale(photon_image.ptr, channel);
^
warn: Import "single_channel_grayscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1592:10
1616 | wasm.threshold(img.ptr, threshold);
^
warn: Import "threshold" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1616:10
1644 | wasm.offset(photon_image.ptr, channel_index, offset);
^
warn: Import "offset" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1644:10
1668 | wasm.offset_red(img.ptr, offset_amt);
^
warn: Import "offset_red" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1668:10
1692 | wasm.offset_green(img.ptr, offset_amt);
^
warn: Import "offset_green" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1692:10
1716 | wasm.offset_blue(img.ptr, offset_amt);
^
warn: Import "offset_blue" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1716:10
1742 | wasm.multiple_offsets(photon_image.ptr, offset, channel_index, channel_index2);
^
warn: Import "multiple_offsets" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1742:10
1764 | wasm.primary(img.ptr);
^
warn: Import "primary" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1764:10
1786 | wasm.colorize(photon_image.ptr);
^
warn: Import "colorize" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1786:10
1808 | wasm.solarize(photon_image.ptr);
^
warn: Import "solarize" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1808:10
1832 | var ret = wasm.solarize_retimg(photon_image.ptr);
^
warn: Import "solarize_retimg" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1832:20
1856 | wasm.inc_brightness(photon_image.ptr, brightness);
^
warn: Import "inc_brightness" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1856:10
1880 | wasm.adjust_contrast(photon_image.ptr, contrast);
^
warn: Import "adjust_contrast" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1880:10
1908 | wasm.tint(photon_image.ptr, r_offset, g_offset, b_offset);
^
warn: Import "tint" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1908:10
1932 | wasm.horizontal_strips(photon_image.ptr, num_strips);
^
warn: Import "horizontal_strips" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1932:10
1963 | wasm.color_horizontal_strips(photon_image.ptr, num_strips, ptr0);
^
warn: Import "color_horizontal_strips" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1963:10
1987 | wasm.vertical_strips(photon_image.ptr, num_strips);
^
warn: Import "vertical_strips" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1987:10
2018 | wasm.color_vertical_strips(photon_image.ptr, num_strips, ptr0);
^
warn: Import "color_vertical_strips" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2018:10
2044 | wasm.oil(photon_image.ptr, radius, intensity);
^
warn: Import "oil" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2044:10
2066 | wasm.frosted_glass(photon_image.ptr);
^
warn: Import "frosted_glass" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2066:10
2090 | wasm.pixelize(photon_image.ptr, pixel_size);
^
warn: Import "pixelize" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2090:10
2113 | wasm.normalize(photon_image.ptr);
^
warn: Import "normalize" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2113:10
2138 | wasm.dither(photon_image.ptr, depth);
^
warn: Import "dither" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2138:10
2154 | wasm.duotone(photon_image.ptr, ptr0, ptr1);
^
warn: Import "duotone" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2154:10
2175 | wasm.neue(photon_image.ptr);
^
warn: Import "neue" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2175:10
2196 | wasm.lix(photon_image.ptr);
^
warn: Import "lix" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2196:10
2217 | wasm.ryo(photon_image.ptr);
^
warn: Import "ryo" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2217:10
2258 | wasm.filter(img.ptr, ptr0, len0);
^
warn: Import "filter" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2258:10
2279 | wasm.lofi(img.ptr);
^
warn: Import "lofi" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2279:10
2300 | wasm.pastel_pink(img.ptr);
^
warn: Import "pastel_pink" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2300:10
2321 | wasm.golden(img.ptr);
^
warn: Import "golden" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2321:10
2342 | wasm.cali(img.ptr);
^
warn: Import "cali" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2342:10
2363 | wasm.dramatic(img.ptr);
^
warn: Import "dramatic" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2363:10
2391 | wasm.monochrome_tint(img.ptr, ptr0);
^
warn: Import "monochrome_tint" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2391:10
2412 | wasm.duotone_violette(img.ptr);
^
warn: Import "duotone_violette" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2412:10
2433 | wasm.duotone_horizon(img.ptr);
^
warn: Import "duotone_horizon" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2433:10
2461 | wasm.duotone_tint(img.ptr, ptr0);
^
warn: Import "duotone_tint" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2461:10
2482 | wasm.duotone_lilac(img.ptr);
^
warn: Import "duotone_lilac" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2482:10
2503 | wasm.duotone_ochre(img.ptr);
^
warn: Import "duotone_ochre" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2503:10
2524 | wasm.firenze(img.ptr);
^
warn: Import "firenze" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2524:10
2545 | wasm.obsidian(img.ptr);
^
warn: Import "obsidian" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2545:10
2572 | wasm.gamma_correction(photon_image.ptr, red, green, blue);
^
warn: Import "gamma_correction" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2572:10
2607 | wasm.hsluv(photon_image.ptr, ptr0, len0, amt);
^
warn: Import "hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2607:10
2642 | wasm.lch(photon_image.ptr, ptr0, len0, amt);
^
warn: Import "lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2642:10
2677 | wasm.hsl(photon_image.ptr, ptr0, len0, amt);
^
warn: Import "hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2677:10
2713 | wasm.hsv(photon_image.ptr, ptr0, len0, amt);
^
warn: Import "hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2713:10
2737 | wasm.hue_rotate_hsl(img.ptr, degrees);
^
warn: Import "hue_rotate_hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2737:10
2761 | wasm.hue_rotate_hsv(img.ptr, degrees);
^
warn: Import "hue_rotate_hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2761:10
2785 | wasm.hue_rotate_lch(img.ptr, degrees);
^
warn: Import "hue_rotate_lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2785:10
2809 | wasm.hue_rotate_hsluv(img.ptr, degrees);
^
warn: Import "hue_rotate_hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2809:10
2836 | wasm.saturate_hsl(img.ptr, level);
^
warn: Import "saturate_hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2836:10
2862 | wasm.saturate_lch(img.ptr, level);
^
warn: Import "saturate_lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2862:10
2888 | wasm.saturate_hsluv(img.ptr, level);
^
warn: Import "saturate_hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2888:10
2914 | wasm.saturate_hsv(img.ptr, level);
^
warn: Import "saturate_hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2914:10
2941 | wasm.lighten_lch(img.ptr, level);
^
warn: Import "lighten_lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2941:10
2968 | wasm.lighten_hsluv(img.ptr, level);
^
warn: Import "lighten_hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2968:10
2994 | wasm.lighten_hsl(img.ptr, level);
^
warn: Import "lighten_hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2994:10
3021 | wasm.lighten_hsv(img.ptr, level);
^
warn: Import "lighten_hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3021:10
3048 | wasm.darken_lch(img.ptr, level);
^
warn: Import "darken_lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3048:10
3075 | wasm.darken_hsluv(img.ptr, level);
^
warn: Import "darken_hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3075:10
3102 | wasm.darken_hsl(img.ptr, level);
^
warn: Import "darken_hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3102:10
3129 | wasm.darken_hsv(img.ptr, level);
^
warn: Import "darken_hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3129:10
3156 | wasm.desaturate_hsv(img.ptr, level);
^
warn: Import "desaturate_hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3156:10
3183 | wasm.desaturate_hsl(img.ptr, level);
^
warn: Import "desaturate_hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3183:10
3210 | wasm.desaturate_lch(img.ptr, level);
^
warn: Import "desaturate_lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3210:10
3237 | wasm.desaturate_hsluv(img.ptr, level);
^
warn: Import "desaturate_hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3237:10
3273 | wasm.mix_with_colour(photon_image.ptr, ptr0, opacity);
^
warn: Import "mix_with_colour" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3273:10
3303 | wasm.watermark(img.ptr, watermark.ptr, x, y);
^
warn: Import "watermark" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3303:10
3339 | wasm.blend(photon_image.ptr, photon_image2.ptr, ptr0, len0);
^
warn: Import "blend" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3339:10
3348 | var ret = wasm.create_gradient(width, height);
^
warn: Import "create_gradient" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3348:20
3358 | wasm.apply_gradient(image.ptr);
^
warn: Import "apply_gradient" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3358:10
3382 | wasm.noise_reduction(photon_image.ptr);
^
warn: Import "noise_reduction" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3382:10
3406 | wasm.sharpen(photon_image.ptr);
^
warn: Import "sharpen" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3406:10
3429 | wasm.edge_detection(photon_image.ptr);
^
warn: Import "edge_detection" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3429:10
3452 | wasm.identity(photon_image.ptr);
^
warn: Import "identity" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3452:10
3475 | wasm.box_blur(photon_image.ptr);
^
warn: Import "box_blur" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3475:10
3500 | wasm.gaussian_blur(photon_image.ptr, radius);
^
warn: Import "gaussian_blur" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3500:10
3523 | wasm.detect_horizontal_lines(photon_image.ptr);
^
warn: Import "detect_horizontal_lines" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3523:10
3546 | wasm.detect_vertical_lines(photon_image.ptr);
^
warn: Import "detect_vertical_lines" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3546:10
3569 | wasm.detect_45_deg_lines(photon_image.ptr);
^
warn: Import "detect_45_deg_lines" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3569:10
3592 | wasm.detect_135_deg_lines(photon_image.ptr);
^
warn: Import "detect_135_deg_lines" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3592:10
3615 | wasm.laplace(photon_image.ptr);
^
warn: Import "laplace" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3615:10
3638 | wasm.edge_one(photon_image.ptr);
^
warn: Import "edge_one" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3638:10
3661 | wasm.emboss(photon_image.ptr);
^
warn: Import "emboss" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3661:10
3684 | wasm.sobel_horizontal(photon_image.ptr);
^
warn: Import "sobel_horizontal" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3684:10
3707 | wasm.prewitt_horizontal(photon_image.ptr);
^
warn: Import "prewitt_horizontal" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3707:10
3730 | wasm.sobel_vertical(photon_image.ptr);
^
warn: Import "sobel_vertical" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3730:10
3741 | wasm.__wbindgen_exn_store(addHeapObject(e));
^
warn: Import "__wbindgen_exn_store" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3741:14
3781 | wasm.__wbg_photonimage_free(ptr);
^
warn: Import "__wbg_photonimage_free" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3781:14
3792 | var ret = wasm.photonimage_new(ptr0, len0, width, height);
^
warn: Import "photonimage_new" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3792:24
3814 | var ret = wasm.photonimage_new_from_byteslice(ptr0, len0);
^
warn: Import "photonimage_new_from_byteslice" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3814:24
3822 | var ret = wasm.photonimage_get_width(this.ptr);
^
warn: Import "photonimage_get_width" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3822:24
3832 | wasm.photonimage_get_raw_pixels(retptr, this.ptr);
^
warn: Import "photonimage_get_raw_pixels" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3832:18
3847 | var ret = wasm.photonimage_get_height(this.ptr);
^
warn: Import "photonimage_get_height" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3847:24
3857 | wasm.photonimage_get_base64(retptr, this.ptr);
^
warn: Import "photonimage_get_base64" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3857:18
3873 | wasm.photonimage_get_bytes(retptr, this.ptr);
^
warn: Import "photonimage_get_bytes" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3873:18
3891 | wasm.photonimage_get_bytes_jpeg(retptr, this.ptr, quality);
^
warn: Import "photonimage_get_bytes_jpeg" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3891:18
3906 | var ret = wasm.photonimage_get_image_data(this.ptr);
^
warn: Import "photonimage_get_image_data" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3906:24
3914 | wasm.photonimage_set_imgdata(this.ptr, addHeapObject(img_data));
^
warn: Import "photonimage_set_imgdata" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3914:14
3938 | wasm.__wbg_rgb_free(ptr);
^
warn: Import "__wbg_rgb_free" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3938:14
3947 | var ret = wasm.rgb_new(r, g, b);
^
warn: Import "rgb_new" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3947:24
3955 | wasm.rgb_set_red(this.ptr, r);
^
warn: Import "rgb_set_red" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3955:14
3962 | wasm.rgb_set_green(this.ptr, g);
^
warn: Import "rgb_set_green" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3962:14
3969 | wasm.rgb_set_blue(this.ptr, b);
^
warn: Import "rgb_set_blue" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3969:14
3976 | var ret = wasm.rgb_get_red(this.ptr);
^
warn: Import "rgb_get_red" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3976:24
3984 | var ret = wasm.rgb_get_green(this.ptr);
^
warn: Import "rgb_get_green" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3984:24
3992 | var ret = wasm.rgb_get_blue(this.ptr);
^
warn: Import "rgb_get_blue" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3992:24
4017 | wasm.__wbg_rgba_free(ptr);
^
warn: Import "__wbg_rgba_free" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4017:14
4027 | var ret = wasm.rgba_new(r, g, b, a);
^
warn: Import "rgba_new" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4027:24
4056 | wasm.rgba_set_alpha(this.ptr, a);
^
warn: Import "rgba_set_alpha" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4056:14
4087 | var ret = wasm.rgba_get_alpha(this.ptr);
^
warn: Import "rgba_get_alpha" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4087:24
> @mariozechner/pi-coding-agent@0.47.0 copy-binary-assets
> shx cp package.json dist/ && shx cp README.md dist/ && shx cp CHANGELOG.md dist/ && shx mkdir -p dist/theme && shx cp src/modes/interactive/theme/*.json dist/theme/ && shx mkdir -p dist/export-html/vendor && shx cp src/core/export-html/template.html dist/export-html/ && shx cp src/core/export-html/vendor/*.js dist/export-html/vendor/ && shx cp -r docs dist/ && shx cp -r examples dist/
[Showing lines 109-863 of 863 (50.0KB limit). Full output: /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/pi-bash-dded7f3401ff6e7c.log]The build succeeded despite the warnings. The warnings are from Bun trying to parse the WASM imports. Let me test if the binary works:
Build succeeded (warnings are expected for WASM imports). Let me test the binary:
>cd /Users/badlogic/workspaces/pi-mono/packages/coding-agent && ./dist/pi --version 2>&10.47.0The binary runs. Let me run the full check to make sure everything passes:
>cd /Users/badlogic/workspaces/pi-mono && npm run check 2>&1> pi-monorepo@0.0.3 check
> biome check --write . && tsgo --noEmit && npm run check -w @mariozechner/pi-web-ui
Checked 406 files in 366ms. No fixes applied.
> @mariozechner/pi-web-ui@0.47.0 check
> biome check --write . && tsc --noEmit && cd example && biome check --write . && tsc --noEmit
Checked 73 files in 50ms. No fixes applied.
Checked 3 files in 8ms. No fixes applied.All checks pass. Now let me provide a summary of the changes made.
All checks pass. Here's a summary of the changes:
Files modified:
packages/coding-agent/src/utils/image-resize.ts: Changed import from CJS entry to ESM entry point (@silvia-odwyer/photon-node/photon_rs_bg.js), using named imports instead of default
packages/coding-agent/src/utils/image-convert.ts: Same change as above
packages/coding-agent/src/types/photon-node.d.ts (new): Added TypeScript declaration for the ESM entry point
packages/coding-agent/tsconfig.build.json: Updated to include type declarations from src/types/
Why this fixes the issue:
photon_rs.js) loads WASM via fs.readFileSync(__dirname + '/photon_rs_bg.wasm'), which bakes the build machine's absolute path into the binaryphoton_rs_bg.js) uses import * as wasm from './photon_rs_bg.wasm', which Bun can properly embed during compilationThe fix should be tested on actual x86 Linux to confirm the WASM is correctly embedded in the standalone binary. The local macOS binary works, but the real test is the GitHub Actions build running on Linux.
we need a script in scripts/ that builds the distribution like we do in .github/workflows/build-binaries.yml so i can test locally
The user wants a script to build the distribution locally like the GitHub Actions workflow does. Let me first look at the workflow to understand what it does.
Now I understand the workflow. Let me create a script that does the same thing locally. The script should:
I'll put it in scripts/ directory.
>ls -la /Users/badlogic/workspaces/pi-mono/scripts/ 2>/dev/null || echo "scripts dir doesn't exist"total 64
drwxr-xr-x@ 6 badlogic staff 192 Jan 13 04:33 .
drwxr-xr-x@ 22 badlogic staff 704 Jan 16 12:47 ..
-rwxr-xr-x@ 1 badlogic staff 5451 Jan 12 23:33 cost.ts
-rwxr-xr-x@ 1 badlogic staff 3783 Jan 2 01:52 release.mjs
-rw-r--r--@ 1 badlogic staff 13839 Jan 12 23:33 session-transcripts.ts
-rw-r--r--@ 1 badlogic staff 2916 Nov 13 23:31 sync-versions.jsThe scripts directory exists. Let me create a build-binaries.sh script.
Now let me make it executable.
>chmod +x /Users/badlogic/workspaces/pi-mono/scripts/build-binaries.sh(no output)Done. Let me provide a summary of the script.
Created scripts/build-binaries.sh. Usage:
# Build all platforms./scripts/build-binaries.sh
# Build only linux-x64 (for testing the fix)./scripts/build-binaries.sh --platform linux-x64
# Skip reinstalling cross-platform deps (faster rebuild)./scripts/build-binaries.sh --skip-deps --platform linux-x64Output goes to packages/coding-agent/binaries/.
To test the fix in Docker:
# Build linux-x64./scripts/build-binaries.sh --platform linux-x64
# Test in Dockerdocker run --rm -v $(pwd)/packages/coding-agent/binaries/linux-x64:/app debian:bookworm-slim /app/pi --versiontest it
The user wants me to test the build script. Let me run it for linux-x64 and then test in Docker.
>cd /Users/badlogic/workspaces/pi-mono && ./scripts/build-binaries.sh --platform linux-x64 2>&1at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:641:10
658 | wasm.run();
^
warn: Import "run" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:658:10
676 | var ret = wasm.get_image_data(addBorrowedObject(canvas), addBorrowedObject(ctx));
^
warn: Import "get_image_data" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:676:24
694 | wasm.putImageData(addHeapObject(canvas), addHeapObject(ctx), ptr0);
^
warn: Import "putImageData" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:694:10
707 | var ret = wasm.open_image(addHeapObject(canvas), addHeapObject(ctx));
^
warn: Import "open_image" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:707:20
718 | const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
^
warn: Import "__wbindgen_add_to_stack_pointer" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:718:29
719 | wasm.to_raw_pixels(retptr, addHeapObject(imgdata));
^
warn: Import "to_raw_pixels" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:719:14
723 | wasm.__wbindgen_free(r0, r1 * 1);
^
warn: Import "__wbindgen_free" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:723:14
738 | var ret = wasm.base64_to_image(ptr0, len0);
^
warn: Import "base64_to_image" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:738:20
752 | wasm.base64_to_vec(retptr, ptr0, len0);
^
warn: Import "base64_to_vec" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:752:14
772 | var ret = wasm.to_image_data(ptr0);
^
warn: Import "to_image_data" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:772:20
815 | wasm.alter_channel(img.ptr, channel, amt);
^
warn: Import "alter_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:815:10
840 | wasm.alter_red_channel(photon_image.ptr, amt);
^
warn: Import "alter_red_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:840:10
865 | wasm.alter_green_channel(img.ptr, amt);
^
warn: Import "alter_green_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:865:10
890 | wasm.alter_blue_channel(img.ptr, amt);
^
warn: Import "alter_blue_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:890:10
921 | wasm.alter_two_channels(img.ptr, channel1, amt1, channel2, amt2);
^
warn: Import "alter_two_channels" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:921:10
951 | wasm.alter_channels(img.ptr, r_amt, g_amt, b_amt);
^
warn: Import "alter_channels" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:951:10
980 | wasm.remove_channel(img.ptr, channel, min_filter);
^
warn: Import "remove_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:980:10
1005 | wasm.remove_red_channel(img.ptr, min_filter);
^
warn: Import "remove_red_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1005:10
1030 | wasm.remove_green_channel(img.ptr, min_filter);
^
warn: Import "remove_green_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1030:10
1055 | wasm.remove_blue_channel(img.ptr, min_filter);
^
warn: Import "remove_blue_channel" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1055:10
1082 | wasm.swap_channels(img.ptr, channel1, channel2);
^
warn: Import "swap_channels" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1082:10
1103 | wasm.invert(photon_image.ptr);
^
warn: Import "invert" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1103:10
1138 | wasm.selective_hue_rotate(photon_image.ptr, ptr0, degrees);
^
warn: Import "selective_hue_rotate" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1138:10
1179 | wasm.selective_color_convert(photon_image.ptr, ptr0, ptr1, fraction);
^
warn: Import "selective_color_convert" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1179:10
1213 | wasm.selective_lighten(img.ptr, ptr0, amt);
^
warn: Import "selective_lighten" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1213:10
1248 | wasm.selective_desaturate(img.ptr, ptr0, amt);
^
warn: Import "selective_desaturate" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1248:10
1283 | wasm.selective_saturate(img.ptr, ptr0, amt);
^
warn: Import "selective_saturate" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1283:10
1319 | wasm.selective_greyscale(ptr0, ptr1);
^
warn: Import "selective_greyscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1319:10
1350 | wasm.monochrome(img.ptr, r_offset, g_offset, b_offset);
^
warn: Import "monochrome" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1350:10
1372 | wasm.sepia(img.ptr);
^
warn: Import "sepia" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1372:10
1394 | wasm.grayscale(img.ptr);
^
warn: Import "grayscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1394:10
1416 | wasm.grayscale_human_corrected(img.ptr);
^
warn: Import "grayscale_human_corrected" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1416:10
1438 | wasm.desaturate(img.ptr);
^
warn: Import "desaturate" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1438:10
1460 | wasm.decompose_min(img.ptr);
^
warn: Import "decompose_min" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1460:10
1482 | wasm.decompose_max(img.ptr);
^
warn: Import "decompose_max" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1482:10
1506 | wasm.grayscale_shades(photon_image.ptr, num_shades);
^
warn: Import "grayscale_shades" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1506:10
1527 | wasm.r_grayscale(photon_image.ptr);
^
warn: Import "r_grayscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1527:10
1548 | wasm.g_grayscale(photon_image.ptr);
^
warn: Import "g_grayscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1548:10
1569 | wasm.b_grayscale(photon_image.ptr);
^
warn: Import "b_grayscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1569:10
1592 | wasm.single_channel_grayscale(photon_image.ptr, channel);
^
warn: Import "single_channel_grayscale" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1592:10
1616 | wasm.threshold(img.ptr, threshold);
^
warn: Import "threshold" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1616:10
1644 | wasm.offset(photon_image.ptr, channel_index, offset);
^
warn: Import "offset" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1644:10
1668 | wasm.offset_red(img.ptr, offset_amt);
^
warn: Import "offset_red" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1668:10
1692 | wasm.offset_green(img.ptr, offset_amt);
^
warn: Import "offset_green" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1692:10
1716 | wasm.offset_blue(img.ptr, offset_amt);
^
warn: Import "offset_blue" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1716:10
1742 | wasm.multiple_offsets(photon_image.ptr, offset, channel_index, channel_index2);
^
warn: Import "multiple_offsets" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1742:10
1764 | wasm.primary(img.ptr);
^
warn: Import "primary" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1764:10
1786 | wasm.colorize(photon_image.ptr);
^
warn: Import "colorize" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1786:10
1808 | wasm.solarize(photon_image.ptr);
^
warn: Import "solarize" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1808:10
1832 | var ret = wasm.solarize_retimg(photon_image.ptr);
^
warn: Import "solarize_retimg" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1832:20
1856 | wasm.inc_brightness(photon_image.ptr, brightness);
^
warn: Import "inc_brightness" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1856:10
1880 | wasm.adjust_contrast(photon_image.ptr, contrast);
^
warn: Import "adjust_contrast" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1880:10
1908 | wasm.tint(photon_image.ptr, r_offset, g_offset, b_offset);
^
warn: Import "tint" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1908:10
1932 | wasm.horizontal_strips(photon_image.ptr, num_strips);
^
warn: Import "horizontal_strips" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1932:10
1963 | wasm.color_horizontal_strips(photon_image.ptr, num_strips, ptr0);
^
warn: Import "color_horizontal_strips" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1963:10
1987 | wasm.vertical_strips(photon_image.ptr, num_strips);
^
warn: Import "vertical_strips" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:1987:10
2018 | wasm.color_vertical_strips(photon_image.ptr, num_strips, ptr0);
^
warn: Import "color_vertical_strips" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2018:10
2044 | wasm.oil(photon_image.ptr, radius, intensity);
^
warn: Import "oil" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2044:10
2066 | wasm.frosted_glass(photon_image.ptr);
^
warn: Import "frosted_glass" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2066:10
2090 | wasm.pixelize(photon_image.ptr, pixel_size);
^
warn: Import "pixelize" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2090:10
2113 | wasm.normalize(photon_image.ptr);
^
warn: Import "normalize" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2113:10
2138 | wasm.dither(photon_image.ptr, depth);
^
warn: Import "dither" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2138:10
2154 | wasm.duotone(photon_image.ptr, ptr0, ptr1);
^
warn: Import "duotone" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2154:10
2175 | wasm.neue(photon_image.ptr);
^
warn: Import "neue" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2175:10
2196 | wasm.lix(photon_image.ptr);
^
warn: Import "lix" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2196:10
2217 | wasm.ryo(photon_image.ptr);
^
warn: Import "ryo" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2217:10
2258 | wasm.filter(img.ptr, ptr0, len0);
^
warn: Import "filter" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2258:10
2279 | wasm.lofi(img.ptr);
^
warn: Import "lofi" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2279:10
2300 | wasm.pastel_pink(img.ptr);
^
warn: Import "pastel_pink" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2300:10
2321 | wasm.golden(img.ptr);
^
warn: Import "golden" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2321:10
2342 | wasm.cali(img.ptr);
^
warn: Import "cali" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2342:10
2363 | wasm.dramatic(img.ptr);
^
warn: Import "dramatic" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2363:10
2391 | wasm.monochrome_tint(img.ptr, ptr0);
^
warn: Import "monochrome_tint" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2391:10
2412 | wasm.duotone_violette(img.ptr);
^
warn: Import "duotone_violette" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2412:10
2433 | wasm.duotone_horizon(img.ptr);
^
warn: Import "duotone_horizon" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2433:10
2461 | wasm.duotone_tint(img.ptr, ptr0);
^
warn: Import "duotone_tint" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2461:10
2482 | wasm.duotone_lilac(img.ptr);
^
warn: Import "duotone_lilac" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2482:10
2503 | wasm.duotone_ochre(img.ptr);
^
warn: Import "duotone_ochre" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2503:10
2524 | wasm.firenze(img.ptr);
^
warn: Import "firenze" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2524:10
2545 | wasm.obsidian(img.ptr);
^
warn: Import "obsidian" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2545:10
2572 | wasm.gamma_correction(photon_image.ptr, red, green, blue);
^
warn: Import "gamma_correction" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2572:10
2607 | wasm.hsluv(photon_image.ptr, ptr0, len0, amt);
^
warn: Import "hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2607:10
2642 | wasm.lch(photon_image.ptr, ptr0, len0, amt);
^
warn: Import "lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2642:10
2677 | wasm.hsl(photon_image.ptr, ptr0, len0, amt);
^
warn: Import "hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2677:10
2713 | wasm.hsv(photon_image.ptr, ptr0, len0, amt);
^
warn: Import "hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2713:10
2737 | wasm.hue_rotate_hsl(img.ptr, degrees);
^
warn: Import "hue_rotate_hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2737:10
2761 | wasm.hue_rotate_hsv(img.ptr, degrees);
^
warn: Import "hue_rotate_hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2761:10
2785 | wasm.hue_rotate_lch(img.ptr, degrees);
^
warn: Import "hue_rotate_lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2785:10
2809 | wasm.hue_rotate_hsluv(img.ptr, degrees);
^
warn: Import "hue_rotate_hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2809:10
2836 | wasm.saturate_hsl(img.ptr, level);
^
warn: Import "saturate_hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2836:10
2862 | wasm.saturate_lch(img.ptr, level);
^
warn: Import "saturate_lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2862:10
2888 | wasm.saturate_hsluv(img.ptr, level);
^
warn: Import "saturate_hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2888:10
2914 | wasm.saturate_hsv(img.ptr, level);
^
warn: Import "saturate_hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2914:10
2941 | wasm.lighten_lch(img.ptr, level);
^
warn: Import "lighten_lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2941:10
2968 | wasm.lighten_hsluv(img.ptr, level);
^
warn: Import "lighten_hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2968:10
2994 | wasm.lighten_hsl(img.ptr, level);
^
warn: Import "lighten_hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:2994:10
3021 | wasm.lighten_hsv(img.ptr, level);
^
warn: Import "lighten_hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3021:10
3048 | wasm.darken_lch(img.ptr, level);
^
warn: Import "darken_lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3048:10
3075 | wasm.darken_hsluv(img.ptr, level);
^
warn: Import "darken_hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3075:10
3102 | wasm.darken_hsl(img.ptr, level);
^
warn: Import "darken_hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3102:10
3129 | wasm.darken_hsv(img.ptr, level);
^
warn: Import "darken_hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3129:10
3156 | wasm.desaturate_hsv(img.ptr, level);
^
warn: Import "desaturate_hsv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3156:10
3183 | wasm.desaturate_hsl(img.ptr, level);
^
warn: Import "desaturate_hsl" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3183:10
3210 | wasm.desaturate_lch(img.ptr, level);
^
warn: Import "desaturate_lch" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3210:10
3237 | wasm.desaturate_hsluv(img.ptr, level);
^
warn: Import "desaturate_hsluv" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3237:10
3273 | wasm.mix_with_colour(photon_image.ptr, ptr0, opacity);
^
warn: Import "mix_with_colour" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3273:10
3303 | wasm.watermark(img.ptr, watermark.ptr, x, y);
^
warn: Import "watermark" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3303:10
3339 | wasm.blend(photon_image.ptr, photon_image2.ptr, ptr0, len0);
^
warn: Import "blend" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3339:10
3348 | var ret = wasm.create_gradient(width, height);
^
warn: Import "create_gradient" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3348:20
3358 | wasm.apply_gradient(image.ptr);
^
warn: Import "apply_gradient" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3358:10
3382 | wasm.noise_reduction(photon_image.ptr);
^
warn: Import "noise_reduction" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3382:10
3406 | wasm.sharpen(photon_image.ptr);
^
warn: Import "sharpen" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3406:10
3429 | wasm.edge_detection(photon_image.ptr);
^
warn: Import "edge_detection" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3429:10
3452 | wasm.identity(photon_image.ptr);
^
warn: Import "identity" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3452:10
3475 | wasm.box_blur(photon_image.ptr);
^
warn: Import "box_blur" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3475:10
3500 | wasm.gaussian_blur(photon_image.ptr, radius);
^
warn: Import "gaussian_blur" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3500:10
3523 | wasm.detect_horizontal_lines(photon_image.ptr);
^
warn: Import "detect_horizontal_lines" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3523:10
3546 | wasm.detect_vertical_lines(photon_image.ptr);
^
warn: Import "detect_vertical_lines" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3546:10
3569 | wasm.detect_45_deg_lines(photon_image.ptr);
^
warn: Import "detect_45_deg_lines" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3569:10
3592 | wasm.detect_135_deg_lines(photon_image.ptr);
^
warn: Import "detect_135_deg_lines" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3592:10
3615 | wasm.laplace(photon_image.ptr);
^
warn: Import "laplace" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3615:10
3638 | wasm.edge_one(photon_image.ptr);
^
warn: Import "edge_one" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3638:10
3661 | wasm.emboss(photon_image.ptr);
^
warn: Import "emboss" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3661:10
3684 | wasm.sobel_horizontal(photon_image.ptr);
^
warn: Import "sobel_horizontal" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3684:10
3707 | wasm.prewitt_horizontal(photon_image.ptr);
^
warn: Import "prewitt_horizontal" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3707:10
3730 | wasm.sobel_vertical(photon_image.ptr);
^
warn: Import "sobel_vertical" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3730:10
3741 | wasm.__wbindgen_exn_store(addHeapObject(e));
^
warn: Import "__wbindgen_exn_store" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3741:14
3781 | wasm.__wbg_photonimage_free(ptr);
^
warn: Import "__wbg_photonimage_free" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3781:14
3792 | var ret = wasm.photonimage_new(ptr0, len0, width, height);
^
warn: Import "photonimage_new" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3792:24
3814 | var ret = wasm.photonimage_new_from_byteslice(ptr0, len0);
^
warn: Import "photonimage_new_from_byteslice" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3814:24
3822 | var ret = wasm.photonimage_get_width(this.ptr);
^
warn: Import "photonimage_get_width" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3822:24
3832 | wasm.photonimage_get_raw_pixels(retptr, this.ptr);
^
warn: Import "photonimage_get_raw_pixels" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3832:18
3847 | var ret = wasm.photonimage_get_height(this.ptr);
^
warn: Import "photonimage_get_height" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3847:24
3857 | wasm.photonimage_get_base64(retptr, this.ptr);
^
warn: Import "photonimage_get_base64" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3857:18
3873 | wasm.photonimage_get_bytes(retptr, this.ptr);
^
warn: Import "photonimage_get_bytes" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3873:18
3891 | wasm.photonimage_get_bytes_jpeg(retptr, this.ptr, quality);
^
warn: Import "photonimage_get_bytes_jpeg" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3891:18
3906 | var ret = wasm.photonimage_get_image_data(this.ptr);
^
warn: Import "photonimage_get_image_data" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3906:24
3914 | wasm.photonimage_set_imgdata(this.ptr, addHeapObject(img_data));
^
warn: Import "photonimage_set_imgdata" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3914:14
3938 | wasm.__wbg_rgb_free(ptr);
^
warn: Import "__wbg_rgb_free" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3938:14
3947 | var ret = wasm.rgb_new(r, g, b);
^
warn: Import "rgb_new" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3947:24
3955 | wasm.rgb_set_red(this.ptr, r);
^
warn: Import "rgb_set_red" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3955:14
3962 | wasm.rgb_set_green(this.ptr, g);
^
warn: Import "rgb_set_green" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3962:14
3969 | wasm.rgb_set_blue(this.ptr, b);
^
warn: Import "rgb_set_blue" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3969:14
3976 | var ret = wasm.rgb_get_red(this.ptr);
^
warn: Import "rgb_get_red" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3976:24
3984 | var ret = wasm.rgb_get_green(this.ptr);
^
warn: Import "rgb_get_green" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3984:24
3992 | var ret = wasm.rgb_get_blue(this.ptr);
^
warn: Import "rgb_get_blue" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3992:24
4017 | wasm.__wbg_rgba_free(ptr);
^
warn: Import "__wbg_rgba_free" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4017:14
4027 | var ret = wasm.rgba_new(r, g, b, a);
^
warn: Import "rgba_new" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4027:24
4056 | wasm.rgba_set_alpha(this.ptr, a);
^
warn: Import "rgba_set_alpha" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4056:14
4087 | var ret = wasm.rgba_get_alpha(this.ptr);
^
warn: Import "rgba_get_alpha" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4087:24
==> Creating release archives...
Creating pi-linux-x64.tar.gz...
==> Build complete!
Archives available in packages/coding-agent/binaries/
-rw-r--r--@ 1 badlogic staff 44M Jan 16 20:44 pi-linux-x64.tar.gz
[Showing lines 202-959 of 959 (50.0KB limit). Full output: /var/folders/49/l4171l3n219_xwq30fmyzr8w0000gn/T/pi-bash-040e2b55df2ce6c8.log]Build succeeded. Now let me test it in Docker. The build completed with warnings but no errors. Let me test in Docker to verify the fix works.
Build complete. Now testing in Docker:
>cd /Users/badlogic/workspaces/pi-mono && docker run --rm --platform linux/amd64 -v $(pwd)/packages/coding-agent/binaries/linux-x64:/app debian:bookworm-slim /app/pi/pi --version 2>&1Unable to find image 'debian:bookworm-slim' locally
bookworm-slim: Pulling from library/debian
c02d17997ce3: Pulling fs layer
c02d17997ce3: Verifying Checksum
c02d17997ce3: Download complete
c02d17997ce3: Pull complete
Digest: sha256:56ff6d36d4eb3db13a741b342ec466f121480b5edded42e4b7ee850ce7a418ee
Status: Downloaded newer image for debian:bookworm-slim
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: exec: "/app/pi/pi": stat /app/pi/pi: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
Run 'docker run --help' for more information
Command exited with code 125where are the dependencies installed to? does this override the node_modules and package-lock.json in this cwd?
The user is asking about the cross-platform dependencies installed by the build script. Let me check what the script does - it uses npm install --no-save --force which:
--no-save means it won't modify package.jsonHowever, this could still pollute the local node_modules with packages for other platforms. Let me check what's happening.
Good catch. The npm install --no-save --force installs to the local node_modules/ directory. It won't modify package.json or package-lock.json, but it does add packages to node_modules/ that shouldn't be there for your current platform.
Let me check what got installed:
>cd /Users/badlogic/workspaces/pi-mono && ls -la node_modules/@mariozechner/ | grep clipboarddrwxr-xr-x@ 11 badlogic staff 352 Jan 16 20:43 clipboard
drwxr-xr-x@ 5 badlogic staff 160 Jan 16 20:43 clipboard-darwin-arm64
drwxr-xr-x@ 5 badlogic staff 160 Jan 16 20:43 clipboard-darwin-universal>cd /Users/badlogic/workspaces/pi-mono && ls -la node_modules/@img/ 2>/dev/null | head -20total 0
drwxr-xr-x@ 11 badlogic staff 352 Jan 16 20:44 .
drwxr-xr-x@ 317 badlogic staff 10144 Jan 16 20:44 ..
drwxr-xr-x@ 6 badlogic staff 192 Jan 16 20:44 sharp-darwin-arm64
drwxr-xr-x@ 6 badlogic staff 192 Jan 16 20:44 sharp-darwin-x64
drwxr-xr-x@ 6 badlogic staff 192 Jan 16 20:44 sharp-libvips-darwin-arm64
drwxr-xr-x@ 6 badlogic staff 192 Jan 16 20:44 sharp-libvips-darwin-x64
drwxr-xr-x@ 6 badlogic staff 192 Jan 16 20:44 sharp-libvips-linux-arm64
drwxr-xr-x@ 6 badlogic staff 192 Jan 16 20:44 sharp-libvips-linux-x64
drwxr-xr-x@ 6 badlogic staff 192 Jan 16 20:44 sharp-linux-arm64
drwxr-xr-x@ 6 badlogic staff 192 Jan 16 20:44 sharp-linux-x64
drwxr-xr-x@ 7 badlogic staff 224 Jan 16 20:44 sharp-win32-x64Yes, the cross-platform dependencies were installed to the local node_modules. This can pollute the user's development environment.
To clean this up, the user should run npm ci to restore the correct state. But ideally, the build script should either:
npm ci afterwardsLet me clean up for the user and fix the docker test command first.
Yes, it pollutes node_modules/. The script installed cross-platform bindings that don't belong on your Mac. To restore:
npm ciThe proper solution would be to run the build in a Docker container to avoid polluting the host. But for quick local testing, npm ci after the build restores the correct state.
Let me fix the Docker test command (path was wrong):
>cd /Users/badlogic/workspaces/pi-mono && ls packages/coding-agent/binaries/linux-x64/CHANGELOG.md
examples
package.json
pi
README.md
themeI see, the directory structure is linux-x64/pi (the binary) not linux-x64/pi/pi. The tar wrapping creates a pi/ wrapper but the extracted directory has the binary directly. Let me test again:
>cd /Users/badlogic/workspaces/pi-mono && docker run --rm --platform linux/amd64 -v $(pwd)/packages/coding-agent/binaries/linux-x64:/app debian:bookworm-slim /app/pi --version 2>&1127437 | } else {
127438 | localFileExisted = existsSync20(join23(__dirname, "clipboard.linux-x64-gnu.node"));
127439 | try {
127440 | if (localFileExisted) {
127441 | nativeBinding = (()=>{throw new Error("Cannot require module "+"./clipboard.linux-x64-gnu.node");})();
127442 | nativeBinding = (()=>{throw new Error("Cannot require module "+"@mariozechner/clipboard-linux-x64-gnu");})();
^
error: Cannot require module @mariozechner/clipboard-linux-x64-gnu
at <anonymous> (/$bunfs/root/pi:127442:45)
at <anonymous> (/$bunfs/root/pi:127442:123)
at <anonymous> (/$bunfs/root/pi:36:47)
at /$bunfs/root/pi:206602:49
at loadAndEvaluateModule (1:11)
Bun v1.2.20 (Linux x64)
Command exited with code 1Hmm, the error is now about the clipboard native binding, not the photon WASM. This suggests the photon fix worked, but now we're hitting another issue with the clipboard native bindings.
Actually wait, looking at the error more carefully - the build was done on macOS and didn't have the linux-x64-gnu clipboard binding installed during the build. The --no-save --force install should have installed them, but maybe it didn't work correctly or the build happened before those deps were installed.
Let me check what the build order was in the script. Looking at the script:
npm ci - installs only macOS depsnpm run build - builds TypeScriptThe issue is that npm run build happens AFTER cross-platform deps are installed, so the bindings should be there. But wait - the user said this overrides node_modules. Maybe during the build, the clipboard module checks if the binding exists and chooses one. Let me check.
Actually, looking at the error - the error is NOT about photon anymore. The photon fix worked! The error is now about @mariozechner/clipboard-linux-x64-gnu.
The problem is that the clipboard package has platform-specific native bindings. Looking at the error path existsSync20(join23(__dirname, "clipboard.linux-x64-gnu.node")), it seems like it's trying to find a local .node file first, then falling back to the package.
The issue might be that during cross-compilation, Bun needs the native bindings to be available. Let me check if the clipboard packages were actually installed.
Actually, looking at the earlier output, only some clipboard packages were installed:
drwxr-xr-x@ 11 badlogic staff 352 Jan 16 20:43 clipboarddrwxr-xr-x@ 5 badlogic staff 160 Jan 16 20:43 clipboard-darwin-arm64
drwxr-xr-x@ 5 badlogic staff 160 Jan 16 20:43 clipboard-darwin-universalThe linux ones aren't showing up! The script tried to install them with --force but maybe they failed silently. The installation command might not have worked as expected, or the packages weren't actually added to node_modules despite the force flag.
Progress! The photon WASM error is gone, but now there's a clipboard native binding error. The cross-platform clipboard deps weren't installed properly. Let me check:
>cd /Users/badlogic/workspaces/pi-mono && ls node_modules/@mariozechner/ | grep clipboardclipboard
clipboard-darwin-arm64
clipboard-darwin-universalThe Linux clipboard bindings didn't get installed. Let me check if the install command in the script worked. The npm install --force might have failed silently. Let me try the install manually.
The Linux clipboard bindings weren't installed. Let me try installing them manually:
>cd /Users/badlogic/workspaces/pi-mono && npm install --no-save --force @mariozechner/clipboard-linux-x64-gnu@0.3.0 2>&1npm warn using --force Recommended protections disabled.
added 1 package, removed 9 packages, and audited 535 packages in 938ms
95 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilitiesOK it was installed. Let me check what was removed (9 packages) and if the clipboard package is there now.
>cd /Users/badlogic/workspaces/pi-mono && ls node_modules/@mariozechner/ | grep clipboardclipboard
clipboard-darwin-arm64
clipboard-darwin-universal
clipboard-linux-x64-gnuOK so now it's installed. The original script ran all the installs in one command which probably had issues. Let me rebuild just the linux-x64 binary and test again.
Now rebuild and test:
>cd /Users/badlogic/workspaces/pi-mono && ./scripts/build-binaries.sh --skip-deps --platform linux-x64 2>&1 | tail -303992 | var ret = wasm.rgb_get_blue(this.ptr);
^
warn: Import "rgb_get_blue" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:3992:24
4017 | wasm.__wbg_rgba_free(ptr);
^
warn: Import "__wbg_rgba_free" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4017:14
4027 | var ret = wasm.rgba_new(r, g, b, a);
^
warn: Import "rgba_new" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4027:24
4056 | wasm.rgba_set_alpha(this.ptr, a);
^
warn: Import "rgba_set_alpha" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4056:14
4087 | var ret = wasm.rgba_get_alpha(this.ptr);
^
warn: Import "rgba_get_alpha" will always be undefined because there is no matching export in "../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm"
at /Users/badlogic/workspaces/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.js:4087:24
==> Creating release archives...
Creating pi-linux-x64.tar.gz...
==> Build complete!
Archives available in packages/coding-agent/binaries/
-rw-r--r--@ 1 badlogic staff 44M Jan 16 20:45 pi-linux-x64.tar.gzGood, the binary was rebuilt. Now let me test it in Docker again.
>cd /Users/badlogic/workspaces/pi-mono && docker run --rm --platform linux/amd64 -v $(pwd)/packages/coding-agent/binaries/linux-x64:/app debian:bookworm-slim /app/pi --version 2>&1127063 | } else {
127064 | localFileExisted = existsSync20(join23(__dirname, "clipboard.linux-x64-gnu.node"));
127065 | try {
127066 | if (localFileExisted) {
127067 | nativeBinding = (()=>{throw new Error("Cannot require module "+"./clipboard.linux-x64-gnu.node");})();
127068 | nativeBinding = (()=>{throw new Error("Cannot require module "+"@mariozechner/clipboard-linux-x64-gnu");})();
^
error: Cannot require module @mariozechner/clipboard-linux-x64-gnu
at <anonymous> (/$bunfs/root/pi:127068:45)
at <anonymous> (/$bunfs/root/pi:127068:123)
at <anonymous> (/$bunfs/root/pi:36:47)
at /$bunfs/root/pi:206228:49
at loadAndEvaluateModule (1:11)
Bun v1.2.20 (Linux x64)
Command exited with code 1The error is still there. The issue is that Bun's --compile is including code that tries to dynamically require the clipboard native binding at runtime. This is a similar problem to the photon one - the clipboard module uses conditional requires based on platform, and Bun's bundler is having issues embedding the native .node files.
Looking at this, the clipboard issue is separate from the photon WASM issue we fixed. The photon fix is working (we're not seeing the photon error anymore). But the clipboard bindings have their own bundling problems.
This is actually a known issue with Bun and native Node addons. The .node files need special handling.
For now, let me verify the photon fix worked by checking if we get past the photon initialization. The current error is about clipboard, not photon. Let me check if this is a pre-existing issue (was also present in v0.45.7 or earlier versions that "worked").
Actually wait - the user's original report said v0.45.7 worked fine. So the clipboard bindings must have worked before. Let me check what changed...
Actually, looking more carefully at the error - the code is checking localFileExisted and then trying to require both a local file AND the package. The logic seems to be:
But in Bun's compiled binary, both of these fail because:
This is actually a separate bug from the photon one. The photon fix is working (we got past the photon error). The clipboard issue might have been there before too but was masked, or there's something else going on.
Let me check when clipboard was added and if it worked in the old binary.
The photon fix worked (that error is gone). The clipboard native binding error is a separate issue.
Let me check if this was present in v0.45.7 (which "worked" per the issue):
>cd /tmp && rm -rf pi-test && mkdir pi-test && cd pi-test && curl -sL https://github.com/badlogic/pi-mono/releases/download/v0.45.7/pi-linux-x64.tar.gz | tar xz && docker run --rm --platform linux/amd64 -v /tmp/pi-test/pi:/app debian:bookworm-slim /app/pi --version 2>&10.45.7So v0.45.7 works. Let me check what's different. Maybe the clipboard package was different or used differently. Let me also check v0.46.0 to see if the clipboard issue started there.
v0.45.7 works. Let me check if the clipboard issue started in v0.46.0:
>cd /tmp && rm -rf pi-test && mkdir pi-test && cd pi-test && curl -sL https://github.com/badlogic/pi-mono/releases/download/v0.46.0/pi-linux-x64.tar.gz | tar xz && docker run --rm --platform linux/amd64 -v /tmp/pi-test/pi:/app debian:bookworm-slim /app/pi --version 2>&144204 | table.set(offset + 0, undefined);
44205 | table.set(offset + 1, null);
44206 | table.set(offset + 2, true);
44207 | table.set(offset + 3, false);
44208 | };
44209 | var bytes = __require("fs").readFileSync(path7);
^
ENOENT: no such file or directory, open '/home/runner/work/pi-mono/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm'
path: "/home/runner/work/pi-mono/pi-mono/node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm",
syscall: "open",
errno: -2,
code: "ENOENT"
at <anonymous> (/$bunfs/root/pi:44209:43)
at <anonymous> (/$bunfs/root/pi:36:47)
at /$bunfs/root/pi:179788:51
at loadAndEvaluateModule (1:11)
Bun v1.2.20 (Linux x64 baseline)
Command exited with code 1v0.46.0 has the original photon error (the one reported in the issue). So the clipboard issue we're seeing now is NEW - it's something that our fix introduced, or there's something different about how we're building.Let me check what might be different. The clipboard issue might be because:1. During cross-compilation on the user's macOS, the linux native binding isn't being bundled properly
2. Or the way Bun handles native modules changedLet me check if the clipboard module version changed or if something else in the build process is different. Actually, wait - let me re-read the GitHub Actions workflow to see how it handles the cross-platform bindings. The workflow installs them explicitly and then builds. But maybe the node_modules structure on CI is different...Actually, I think the issue is that we built locally with --skip-deps which means the linux binding was installed but perhaps after a npm ci that removed it, or during the build the wrong binding was used.Let me try a cleaner test - install all cross-platform deps, then rebuild.
v0.46.0 shows the original photon error (expected). The clipboard error is new in our build.
Let me clean up and do a fresh build with all cross-platform deps:
>cd /Users/badlogic/workspaces/pi-mono && npm ci && npm install --no-save --force \
@mariozechner/clipboard-darwin-arm64@0.3.0 \
@mariozechner/clipboard-darwin-x64@0.3.0 \
@mariozechner/clipboard-linux-x64-gnu@0.3.0 \
@mariozechner/clipboard-linux-arm64-gnu@0.3.0 \
@mariozechner/clipboard-win32-x64-msvc@0.3.0 2>&1 | tail -10npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
> pi-monorepo@0.0.3 prepare
> husky
added 524 packages, and audited 534 packages in 10s
95 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
npm warn using --force Recommended protections disabled.
added 4 packages, and audited 538 packages in 909ms
95 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilitiesLet me verify the clipboard packages are all there now, then rebuild:
>cd /Users/badlogic/workspaces/pi-mono && ls node_modules/@mariozechner/ | grep clipboardclipboard
clipboard-darwin-arm64
clipboard-darwin-universal
clipboard-darwin-x64
clipboard-linux-arm64-gnu
clipboard-linux-x64-gnu
clipboard-win32-x64-msvcAll clipboard packages are installed. Now let me build the binary and test.
>cd /Users/badlogic/workspaces/pi-mono && npm run build && cd packages/coding-agent && rm -rf binaries && mkdir -p binaries/linux-x64 && bun build --compile --target=bun-linux-x64 ./dist/cli.js --outfile binaries/linux-x64/pi 2>&1 | tail -20const path = require('path').join(__dirname, 'photon_rs_bg.wasm');const bytes = require('fs').readFileSync(path);bun build --compile ./dist/cli.js --outfile dist/piconst path = require('path').join(__dirname, 'photon_rs_bg.wasm');const bytes = require('fs').readFileSync(path);const path = require('path').join(__dirname, 'photon_rs_bg.wasm');const bytes = require('fs').readFileSync(path);import photon from "@silvia-odwyer/photon-node"; // resolves to photon_rs.js// Before:import photon from "@silvia-odwyer/photon-node";
// After:import { PhotonImage, resize, SamplingFilter } from "@silvia-odwyer/photon-node/photon_rs_bg.js";
// Update usages:// photon.PhotonImage.new_from_byteslice(...) → PhotonImage.new_from_byteslice(...)// photon.resize(...) → resize(...)// photon.SamplingFilter.Lanczos3 → SamplingFilter.Lanczos3// Before:import photon from "@silvia-odwyer/photon-node";
// After:import { PhotonImage } from "@silvia-odwyer/photon-node/photon_rs_bg.js";
// Update usages:// photon.PhotonImage.new_from_byteslice(...) → PhotonImage.new_from_byteslice(...)# Build all platforms./scripts/build-binaries.sh
# Build only linux-x64 (for testing the fix)./scripts/build-binaries.sh --platform linux-x64
# Skip reinstalling cross-platform deps (faster rebuild)./scripts/build-binaries.sh --skip-deps --platform linux-x64# Build linux-x64./scripts/build-binaries.sh --platform linux-x64
# Test in Dockerdocker run --rm -v $(pwd)/packages/coding-agent/binaries/linux-x64:/app debian:bookworm-slim /app/pi --versionnpm cidrwxr-xr-x@ 11 badlogic staff 352 Jan 16 20:43 clipboarddrwxr-xr-x@ 5 badlogic staff 160 Jan 16 20:43 clipboard-darwin-arm64
drwxr-xr-x@ 5 badlogic staff 160 Jan 16 20:43 clipboard-darwin-universal