heic-to 1.3.0 → 1.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heic-to",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Converting HEIF/HEIF image formats to PNG/JPEG in the browser",
5
5
  "main": "dist/heic-to.js",
6
6
  "exports": {
package/src/next/index.js CHANGED
@@ -87,12 +87,7 @@ const heicTo = async ({blob, type, quality, options}) => {
87
87
  let canvas;
88
88
  try {
89
89
  canvas = await encodeByCanvas(imageBuffer);
90
- return await new Promise((resolve, reject) => canvas.toBlob(blob => {
91
- if (blob != null)
92
- resolve(blob);
93
- else
94
- reject(`Can't convert canvas to blob.`);
95
- }, type, quality));
90
+ return await canvas.convertToBlob({ type, quality });
96
91
  } finally {
97
92
  if (canvas) releaseCanvas(canvas);
98
93
  }