ag-psd 14.3.10 → 14.3.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## v14.3.13
4
+ - Fixed handling files with incorrect channel image data length
5
+
6
+ ## v14.3.11
7
+ - Fixed corrupted file when passing non-integer values to `layer.left`, `.top`, `.right`, `.bottom`
8
+
9
+ ## v14.3.9
10
+ - Fixed reading some corrupted files
11
+
12
+ ## v14.3.8
13
+ - Fixed handling files with incorrect section sizes
14
+
15
+ ## v14.3.6
16
+ - Fixed incorrect writing of `vogk` section in some cases resulting in a broken file
17
+
3
18
  ## v14.3.6
4
19
  - Fixed incorrect writing of `vogk` section in some cases resulting in a broken file
5
20
 
package/README.md CHANGED
@@ -34,6 +34,8 @@ npm install ag-psd
34
34
 
35
35
  ## Usage
36
36
 
37
+ Description of the structure of Psd object used by `readPsd` and `writePsd` functions can be found in our [PSD Readme document](/README_PSD.md)
38
+
37
39
  ### Functions
38
40
 
39
41
  ```ts
@@ -380,9 +382,11 @@ Below is a simple example of document structure returned from `readPsd`. You can
380
382
  }
381
383
  ```
382
384
 
383
- ### Updating document without corrupting image data
385
+ ## Modifying documents
386
+
387
+ General approach with `ag-psd` to modifying documents is to read the document, apply the updates and write the document back.
384
388
 
385
- If you read and write the same document, image data can get corrupted by automatic alpha channel pre-multiplication that happens when you load data into the canvas element. To avoid that use raw image data, set `useImageData` option to `true` in `ReadOptions`. You can also use `useRawThumbnail` option to preserve original thumbnail data.
389
+ If you read and write the same document, image data can get corrupted by automatic alpha channel pre-multiplication that happens when you load data into the canvas element. To avoid that, use raw image data, set `useImageData` option to `true` in `ReadOptions`. You can also use `useRawThumbnail` option to avoid any changes to thumbnail image.
386
390
 
387
391
  ```js
388
392
  const psd = readPsd(inputBuffer, { useImageData: true });
@@ -392,6 +396,12 @@ const psd = readPsd(inputBuffer, { useImageData: true });
392
396
  const outuptBuffer = writePsd(psd);
393
397
  ```
394
398
 
399
+ Updating general properties that don't have visual impact on the canvas, like printing info or layer name will work correctly without any extra work.
400
+
401
+ This library does NOT generate new composite canvas based on the layer data, so changing layer order, adding or removing layers or changing layer canvas data, or blending mode, or any other property that has visual impact on the canvas will cause the composite image and thumbnail to not be valid anymore. If you need composite image or thumbnail to be correct you need to update them yourself by updating `psd.canvas` or `psd.imageData` and `psd.imageResources.thumbnail` or `psd.imageResources.thumbnailRaw` fields. Composite image data is not required for PSD file to be readble in Photoshop so leaving old version or removing it completely may be good option. Thumbnail is only necessary for file preview in programs like Adobe Bridge or File Explorer, if you don't need to support that you can skip thumbnail as well.
402
+
403
+ This library also does NOT generate new layer canvas based on layer settings, so if you're changing any layer properties, that impact layer bitmap, you also need to update `layer.canvas` or `layer.imageData`. This includes: text layer properties, vector layer properties, smart object, etc. (this does not include layer blending options)
404
+
395
405
  ### Writing text layers
396
406
 
397
407
  ```js