@blazediff/bin 0.5.0 → 0.6.0
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/cli.js +11 -9
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
package/dist/cli.js
CHANGED
|
@@ -49,6 +49,16 @@ async function blazeDiffBin(image1Path, image2Path, options) {
|
|
|
49
49
|
options.coreOptions
|
|
50
50
|
);
|
|
51
51
|
const duration = performance.now() - startTime;
|
|
52
|
+
if (diffCount > 0 && options.outputPath && outputData) {
|
|
53
|
+
await options.transformer.write(
|
|
54
|
+
{
|
|
55
|
+
data: outputData,
|
|
56
|
+
width: image1.width,
|
|
57
|
+
height: image1.height
|
|
58
|
+
},
|
|
59
|
+
options.outputPath
|
|
60
|
+
);
|
|
61
|
+
}
|
|
52
62
|
return {
|
|
53
63
|
diffCount,
|
|
54
64
|
width: image1.width,
|
|
@@ -224,15 +234,7 @@ async function main() {
|
|
|
224
234
|
console.log(
|
|
225
235
|
`error: ${(result.diffCount / (result.width * result.height) * 100).toFixed(2)}%`
|
|
226
236
|
);
|
|
227
|
-
if (
|
|
228
|
-
await transformer.write(
|
|
229
|
-
{
|
|
230
|
-
data: result.outputData,
|
|
231
|
-
width: result.width,
|
|
232
|
-
height: result.height
|
|
233
|
-
},
|
|
234
|
-
options.outputPath
|
|
235
|
-
);
|
|
237
|
+
if (result.diffCount > 0 && result.outputData) {
|
|
236
238
|
console.log(`diff image: ${options.outputPath}`);
|
|
237
239
|
}
|
|
238
240
|
if (result.diffCount > 0) {
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var m=require('@blazediff/core');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var m__default=/*#__PURE__*/_interopDefault(m);async function u(n,f,i){let[t,e]=await Promise.all([i.transformer.transform(n),i.transformer.transform(f)]);if(t.width!==e.width||t.height!==e.height)throw new Error(`Image dimensions do not match: ${t.width}x${t.height} vs ${e.width}x${e.height}`);let r;i.outputPath&&(r=new Uint8Array(t.data.length));let h=performance.now(),a=m__default.default(t.data,e.data,r,t.width,t.height,i.coreOptions),o=performance.now()-h;return a>0&&i.outputPath&&r&&await i.transformer.write({data:r,width:t.width,height:t.height},i.outputPath),{diffCount:a,width:t.width,height:t.height,outputData:r,duration:o}}module.exports=u;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import m from'@blazediff/core';async function u(n,f,i){let[t,e]=await Promise.all([i.transformer.transform(n),i.transformer.transform(f)]);if(t.width!==e.width||t.height!==e.height)throw new Error(`Image dimensions do not match: ${t.width}x${t.height} vs ${e.width}x${e.height}`);let r;i.outputPath&&(r=new Uint8Array(t.data.length));let h=performance.now(),a=m(t.data,e.data,r,t.width,t.height,i.coreOptions),o=performance.now()-h;return a>0&&i.outputPath&&r&&await i.transformer.write({data:r,width:t.width,height:t.height},i.outputPath),{diffCount:a,width:t.width,height:t.height,outputData:r,duration:o}}export{u as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blazediff/bin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Command-line interface for the blazediff image comparison library",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"homepage": "https://github.com/teimurjan/blazediff",
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@blazediff/core": "0.
|
|
41
|
-
"@blazediff/pngjs-transformer": "0.
|
|
42
|
-
"@blazediff/sharp-transformer": "0.
|
|
40
|
+
"@blazediff/core": "0.6.0",
|
|
41
|
+
"@blazediff/pngjs-transformer": "0.6.0",
|
|
42
|
+
"@blazediff/sharp-transformer": "0.6.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^24.3.0",
|
|
46
46
|
"tsup": "8.5.0",
|
|
47
47
|
"typescript": "5.9.2",
|
|
48
|
-
"@blazediff/types": "0.
|
|
48
|
+
"@blazediff/types": "0.6.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsup",
|