emf-converter 4.8.15 → 4.8.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -20651,10 +20651,10 @@ function resampleImage(rgba, width, height, spec, surface) {
20651
20651
  wu.length = 0;
20652
20652
  wv.length = 0;
20653
20653
  for (let t = iu0; t <= iu1; t++) {
20654
- wu.push(fu.weight(t, cu));
20654
+ wu.push(integerBicubic ? Math.round(fu.weight(t, cu) * 65536) / 65536 : fu.weight(t, cu));
20655
20655
  }
20656
20656
  for (let t = iv0; t <= iv1; t++) {
20657
- wv.push(fv.weight(t, cv));
20657
+ wv.push(integerBicubic ? Math.round(fv.weight(t, cv) * 65536) / 65536 : fv.weight(t, cv));
20658
20658
  }
20659
20659
  return blendSeparable(rgba, width, box, iu0, wu, iv0, wv, kernel === "bicubic", edge, integerBicubic);
20660
20660
  };
@@ -22182,10 +22182,10 @@ var SvgContext = class {
22182
22182
  const parent = this.state.clipId;
22183
22183
  const id = this.id("c");
22184
22184
  const attrs = { id };
22185
+ const pathAttrs = { d: pathData(this.path, null) || "M0 0" };
22185
22186
  if (parent) {
22186
- attrs["clip-path"] = `url(#${parent})`;
22187
+ pathAttrs["clip-path"] = `url(#${parent})`;
22187
22188
  }
22188
- const pathAttrs = { d: pathData(this.path, null) || "M0 0" };
22189
22189
  if (fillRule === "evenodd") {
22190
22190
  pathAttrs["clip-rule"] = "evenodd";
22191
22191
  }
package/dist/browser.mjs CHANGED
@@ -20649,10 +20649,10 @@ function resampleImage(rgba, width, height, spec, surface) {
20649
20649
  wu.length = 0;
20650
20650
  wv.length = 0;
20651
20651
  for (let t = iu0; t <= iu1; t++) {
20652
- wu.push(fu.weight(t, cu));
20652
+ wu.push(integerBicubic ? Math.round(fu.weight(t, cu) * 65536) / 65536 : fu.weight(t, cu));
20653
20653
  }
20654
20654
  for (let t = iv0; t <= iv1; t++) {
20655
- wv.push(fv.weight(t, cv));
20655
+ wv.push(integerBicubic ? Math.round(fv.weight(t, cv) * 65536) / 65536 : fv.weight(t, cv));
20656
20656
  }
20657
20657
  return blendSeparable(rgba, width, box, iu0, wu, iv0, wv, kernel === "bicubic", edge, integerBicubic);
20658
20658
  };
@@ -22180,10 +22180,10 @@ var SvgContext = class {
22180
22180
  const parent = this.state.clipId;
22181
22181
  const id = this.id("c");
22182
22182
  const attrs = { id };
22183
+ const pathAttrs = { d: pathData(this.path, null) || "M0 0" };
22183
22184
  if (parent) {
22184
- attrs["clip-path"] = `url(#${parent})`;
22185
+ pathAttrs["clip-path"] = `url(#${parent})`;
22185
22186
  }
22186
- const pathAttrs = { d: pathData(this.path, null) || "M0 0" };
22187
22187
  if (fillRule === "evenodd") {
22188
22188
  pathAttrs["clip-rule"] = "evenodd";
22189
22189
  }
package/dist/index.d.mts CHANGED
@@ -222,9 +222,10 @@ interface SvgConvertOptions extends EmfConvertOptions {
222
222
  * PNG output's `InterpolationMode`/`PixelOffsetMode` model), so the SVG
223
223
  * shows what GDI+ painted pixel for pixel at its nominal size. PNG and
224
224
  * BMP images are decoded in pure JavaScript; JPEG, GIF and other formats
225
- * need a canvas backend to decode and otherwise keep `'renderer'`
226
- * scaling, as do draws GDI+ scales with a filter the resampler does not
227
- * model (bicubic, high-quality).
225
+ * use the available image decoder and otherwise keep `'renderer'`
226
+ * scaling. The resampler covers nearest-neighbour, bilinear, bicubic
227
+ * and high-quality modes; its remaining native differences also apply
228
+ * to the baked SVG pixels.
228
229
  */
229
230
  imageResampling?: 'renderer' | 'exact';
230
231
  /**
package/dist/index.d.ts CHANGED
@@ -222,9 +222,10 @@ interface SvgConvertOptions extends EmfConvertOptions {
222
222
  * PNG output's `InterpolationMode`/`PixelOffsetMode` model), so the SVG
223
223
  * shows what GDI+ painted pixel for pixel at its nominal size. PNG and
224
224
  * BMP images are decoded in pure JavaScript; JPEG, GIF and other formats
225
- * need a canvas backend to decode and otherwise keep `'renderer'`
226
- * scaling, as do draws GDI+ scales with a filter the resampler does not
227
- * model (bicubic, high-quality).
225
+ * use the available image decoder and otherwise keep `'renderer'`
226
+ * scaling. The resampler covers nearest-neighbour, bilinear, bicubic
227
+ * and high-quality modes; its remaining native differences also apply
228
+ * to the baked SVG pixels.
228
229
  */
229
230
  imageResampling?: 'renderer' | 'exact';
230
231
  /**
package/dist/index.js CHANGED
@@ -20652,10 +20652,10 @@ function resampleImage(rgba, width, height, spec, surface) {
20652
20652
  wu.length = 0;
20653
20653
  wv.length = 0;
20654
20654
  for (let t = iu0; t <= iu1; t++) {
20655
- wu.push(fu.weight(t, cu));
20655
+ wu.push(integerBicubic ? Math.round(fu.weight(t, cu) * 65536) / 65536 : fu.weight(t, cu));
20656
20656
  }
20657
20657
  for (let t = iv0; t <= iv1; t++) {
20658
- wv.push(fv.weight(t, cv));
20658
+ wv.push(integerBicubic ? Math.round(fv.weight(t, cv) * 65536) / 65536 : fv.weight(t, cv));
20659
20659
  }
20660
20660
  return blendSeparable(rgba, width, box, iu0, wu, iv0, wv, kernel === "bicubic", edge, integerBicubic);
20661
20661
  };
@@ -22183,10 +22183,10 @@ var SvgContext = class {
22183
22183
  const parent = this.state.clipId;
22184
22184
  const id = this.id("c");
22185
22185
  const attrs = { id };
22186
+ const pathAttrs = { d: pathData(this.path, null) || "M0 0" };
22186
22187
  if (parent) {
22187
- attrs["clip-path"] = `url(#${parent})`;
22188
+ pathAttrs["clip-path"] = `url(#${parent})`;
22188
22189
  }
22189
- const pathAttrs = { d: pathData(this.path, null) || "M0 0" };
22190
22190
  if (fillRule === "evenodd") {
22191
22191
  pathAttrs["clip-rule"] = "evenodd";
22192
22192
  }
package/dist/index.mjs CHANGED
@@ -20650,10 +20650,10 @@ function resampleImage(rgba, width, height, spec, surface) {
20650
20650
  wu.length = 0;
20651
20651
  wv.length = 0;
20652
20652
  for (let t = iu0; t <= iu1; t++) {
20653
- wu.push(fu.weight(t, cu));
20653
+ wu.push(integerBicubic ? Math.round(fu.weight(t, cu) * 65536) / 65536 : fu.weight(t, cu));
20654
20654
  }
20655
20655
  for (let t = iv0; t <= iv1; t++) {
20656
- wv.push(fv.weight(t, cv));
20656
+ wv.push(integerBicubic ? Math.round(fv.weight(t, cv) * 65536) / 65536 : fv.weight(t, cv));
20657
20657
  }
20658
20658
  return blendSeparable(rgba, width, box, iu0, wu, iv0, wv, kernel === "bicubic", edge, integerBicubic);
20659
20659
  };
@@ -22181,10 +22181,10 @@ var SvgContext = class {
22181
22181
  const parent = this.state.clipId;
22182
22182
  const id = this.id("c");
22183
22183
  const attrs = { id };
22184
+ const pathAttrs = { d: pathData(this.path, null) || "M0 0" };
22184
22185
  if (parent) {
22185
- attrs["clip-path"] = `url(#${parent})`;
22186
+ pathAttrs["clip-path"] = `url(#${parent})`;
22186
22187
  }
22187
- const pathAttrs = { d: pathData(this.path, null) || "M0 0" };
22188
22188
  if (fillRule === "evenodd") {
22189
22189
  pathAttrs["clip-rule"] = "evenodd";
22190
22190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emf-converter",
3
- "version": "4.8.15",
3
+ "version": "4.8.17",
4
4
  "description": "Convert EMF/WMF metafile binaries to PNG data URLs or SVG (markup, data URL, React/JSX)",
5
5
  "keywords": [
6
6
  "canvas",