@yft-design/psd-lib 1.0.1 → 1.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yft-design/psd-lib",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "A fast PSD file parser",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -32,11 +32,8 @@
32
32
  "@types/pako": "^2.0.4",
33
33
  "typescript": "^5.4.5"
34
34
  },
35
- "optionalDependencies": {
36
- "canvas": "^2.11.2"
37
- },
38
35
  "engines": {
39
- "node": ">=16"
36
+ "node": ">=22"
40
37
  },
41
38
  "scripts": {
42
39
  "build": "tsc",
@@ -1 +0,0 @@
1
- export declare function initialize(): void;
@@ -1,21 +0,0 @@
1
- import { createCanvas } from 'canvas';
2
- import { initializeCanvas } from './index';
3
- import { decodeJpeg } from './jpeg';
4
- function createCanvasFromData(data) {
5
- const canvas = createCanvas(100, 100);
6
- try {
7
- const context = canvas.getContext('2d');
8
- const imageData = decodeJpeg(data, (w, h) => context.createImageData(w, h));
9
- canvas.width = imageData.width;
10
- canvas.height = imageData.height;
11
- context.putImageData(imageData, 0, 0);
12
- }
13
- catch (e) {
14
- console.error('JPEG decompression error', e.message);
15
- }
16
- return canvas;
17
- }
18
- initializeCanvas(createCanvas, createCanvasFromData);
19
- export function initialize() {
20
- initializeCanvas(createCanvas, createCanvasFromData);
21
- }