ag-psd 32.0.0 → 34.0.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.
Files changed (117) hide show
  1. package/.v8-cache/v24.7.0-x64-ef5a0af0/03e19709 +0 -0
  2. package/.v8-cache/v24.7.0-x64-ef5a0af0/05135617 +0 -0
  3. package/.v8-cache/v24.7.0-x64-ef5a0af0/1130885f +0 -0
  4. package/.v8-cache/v24.7.0-x64-ef5a0af0/226e2801 +0 -0
  5. package/.v8-cache/v24.7.0-x64-ef5a0af0/2a19133e +0 -0
  6. package/.v8-cache/v24.7.0-x64-ef5a0af0/4511bacf +0 -0
  7. package/.v8-cache/v24.7.0-x64-ef5a0af0/68416cb2 +0 -0
  8. package/.v8-cache/v24.7.0-x64-ef5a0af0/71df9cb3 +0 -0
  9. package/.v8-cache/v24.7.0-x64-ef5a0af0/7ea06cea +0 -0
  10. package/.v8-cache/v24.7.0-x64-ef5a0af0/87cf2209 +0 -0
  11. package/.v8-cache/v24.7.0-x64-ef5a0af0/932f0770 +0 -0
  12. package/.v8-cache/v24.7.0-x64-ef5a0af0/acc36e66 +0 -0
  13. package/.v8-cache/v24.7.0-x64-ef5a0af0/b3c2fab7 +0 -0
  14. package/.v8-cache/v24.7.0-x64-ef5a0af0/c0b789d2 +0 -0
  15. package/.v8-cache/v24.7.0-x64-ef5a0af0/c314aece +0 -0
  16. package/.v8-cache/v24.7.0-x64-ef5a0af0/cfc49f4f +0 -0
  17. package/.v8-cache/v24.7.0-x64-ef5a0af0/cff9434a +0 -0
  18. package/.v8-cache/v24.7.0-x64-ef5a0af0/d13d7610 +0 -0
  19. package/.v8-cache/v24.7.0-x64-ef5a0af0/dc86f000 +0 -0
  20. package/.v8-cache/v24.7.0-x64-ef5a0af0/e03e2acd +0 -0
  21. package/.v8-cache/v24.7.0-x64-ef5a0af0/e6745c2b +0 -0
  22. package/.v8-cache/v24.7.0-x64-ef5a0af0/e6b99945 +0 -0
  23. package/.v8-cache/v24.7.0-x64-ef5a0af0/eeeebdfe +0 -0
  24. package/.v8-cache/v24.7.0-x64-ef5a0af0/f6fd8125 +0 -0
  25. package/CHANGELOG.md +100 -0
  26. package/LICENSE +5 -0
  27. package/README.md +4 -7
  28. package/README_PSD.md +261 -84
  29. package/TODO.md +13 -84
  30. package/dist/abr.d.ts +11 -4
  31. package/dist/abr.js +362 -230
  32. package/dist/abr.js.map +1 -1
  33. package/dist/additionalInfo.d.ts +56 -2
  34. package/dist/additionalInfo.js +828 -361
  35. package/dist/additionalInfo.js.map +1 -1
  36. package/dist/ase.d.ts +6 -1
  37. package/dist/ase.js +61 -61
  38. package/dist/ase.js.map +1 -1
  39. package/dist/bundle.js +3321 -1364
  40. package/dist/descriptor.d.ts +28 -13
  41. package/dist/descriptor.js +295 -241
  42. package/dist/descriptor.js.map +1 -1
  43. package/dist/helpers.d.ts +7 -1
  44. package/dist/helpers.js +246 -4
  45. package/dist/helpers.js.map +1 -1
  46. package/dist/imageResources.d.ts +15 -3
  47. package/dist/imageResources.js +586 -144
  48. package/dist/imageResources.js.map +1 -1
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.js +1 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/jpeg.js +8 -8
  53. package/dist/jpeg.js.map +1 -1
  54. package/dist/psd.d.ts +292 -19
  55. package/dist/psd.js.map +1 -1
  56. package/dist/psdReader.d.ts +10 -0
  57. package/dist/psdReader.js +424 -216
  58. package/dist/psdReader.js.map +1 -1
  59. package/dist/psdWriter.d.ts +2 -0
  60. package/dist/psdWriter.js +373 -113
  61. package/dist/psdWriter.js.map +1 -1
  62. package/dist/text.d.ts +32 -1
  63. package/dist/text.js +75 -6
  64. package/dist/text.js.map +1 -1
  65. package/dist/utf8.js +0 -3
  66. package/dist/utf8.js.map +1 -1
  67. package/dist-es/abr.d.ts +11 -4
  68. package/dist-es/abr.js +362 -230
  69. package/dist-es/abr.js.map +1 -1
  70. package/dist-es/additionalInfo.d.ts +56 -2
  71. package/dist-es/additionalInfo.js +828 -361
  72. package/dist-es/additionalInfo.js.map +1 -1
  73. package/dist-es/ase.d.ts +6 -1
  74. package/dist-es/ase.js +61 -61
  75. package/dist-es/ase.js.map +1 -1
  76. package/dist-es/descriptor.d.ts +28 -13
  77. package/dist-es/descriptor.js +295 -241
  78. package/dist-es/descriptor.js.map +1 -1
  79. package/dist-es/helpers.d.ts +7 -1
  80. package/dist-es/helpers.js +246 -4
  81. package/dist-es/helpers.js.map +1 -1
  82. package/dist-es/imageResources.d.ts +15 -3
  83. package/dist-es/imageResources.js +586 -144
  84. package/dist-es/imageResources.js.map +1 -1
  85. package/dist-es/index.d.ts +1 -0
  86. package/dist-es/index.js +1 -0
  87. package/dist-es/index.js.map +1 -1
  88. package/dist-es/jpeg.js +8 -8
  89. package/dist-es/jpeg.js.map +1 -1
  90. package/dist-es/psd.d.ts +292 -19
  91. package/dist-es/psd.js.map +1 -1
  92. package/dist-es/psdReader.d.ts +10 -0
  93. package/dist-es/psdReader.js +424 -216
  94. package/dist-es/psdReader.js.map +1 -1
  95. package/dist-es/psdWriter.d.ts +2 -0
  96. package/dist-es/psdWriter.js +373 -113
  97. package/dist-es/psdWriter.js.map +1 -1
  98. package/dist-es/text.d.ts +32 -1
  99. package/dist-es/text.js +75 -6
  100. package/dist-es/text.js.map +1 -1
  101. package/dist-es/utf8.js +0 -3
  102. package/dist-es/utf8.js.map +1 -1
  103. package/package.json +2 -2
  104. package/perf.js +312 -9
  105. package/src/abr.ts +382 -235
  106. package/src/additionalInfo.ts +1071 -482
  107. package/src/ase.ts +66 -61
  108. package/src/descriptor.ts +291 -242
  109. package/src/helpers.ts +266 -3
  110. package/src/imageResources.ts +736 -169
  111. package/src/index.ts +1 -0
  112. package/src/jpeg.ts +8 -8
  113. package/src/psd.ts +271 -32
  114. package/src/psdReader.ts +440 -221
  115. package/src/psdWriter.ts +402 -110
  116. package/src/text.ts +93 -7
  117. package/src/utf8.ts +0 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,105 @@
1
1
  # Changelog
2
2
 
3
+ ## v34.0.0
4
+ - **BREAKING CHANGE:** Documents are now written in their `colorMode` and `bitsPerChannel` ("Bitmap", "Grayscale", "Indexed", "RGB" and "CMYK" color modes, 16 and 32 bits per channel for "RGB" and "Grayscale" and 16 bits for "CMYK"), previously documents were always written as 8 bit RGB documents (set `colorMode` to `ColorMode.RGB` and `bitsPerChannel` to `8` before writing to keep the previous behavior). Image data is converted from RGB data to the color mode and bit depth of the document, 16 and 32 bit layers are written in `Lr16` / `Lr32` sections using zip compression with prediction, 32 bit documents include HDR toning settings required by Photoshop
5
+ - **BREAKING CHANGE:** Book (Pantone) colors in descriptors are now read with their color values (previously they were read as black) and `book` field with name of the color book and the color
6
+ - Added `values` field to curves adjustment (curves drawn with pencil tool), previously they were read as curve points, curves are also read from extra curves section that includes channels outside of channel mask
7
+ - Added `seafoam`, `indigo`, `magenta` and `fuchsia` layer colors (previously read as `undefined` and written as `none`)
8
+ - Added `vectorMaskAsGlobalMask`, `foreignEffectId`, `framedGroup`, `animationEffects`, `patternData` and `pixelSourceData` layer fields
9
+ - Added Camera Raw smart filter (`camera raw` filter type)
10
+ - Added `quickMaskInfo`, `measurementScale`, `duotoneHalftoneScreens`, `duotoneTransferFunctions`, `duotoneImageInformation` and `alternateDuotoneColors` image resources
11
+ - Added reading of Photoshop CS3 color samplers resource (`depth` field of `colorSamplers`), previously color samplers of newer documents were lost
12
+ - Added reading of Photoshop 5 text layers (`tySh`) as `text` layer data
13
+ - Added reading of old hue/saturation (`hue `), placed layer (`plLd`), filter effects (`FELS`) and artboard (`abdd`) keys and layer generator settings from `extd` section
14
+ - Added `readAse` export to main module
15
+ - Fixed reading levels adjustment written by Clip Studio Paint
16
+ - Fixed reading layer channel with invalid length of 1 throwing an error
17
+ - Fixed corrupted image data of a single layer preventing reading of the whole file (layer is read without image data, unless `throwForMissingFeatures` option is set)
18
+ - Fixed writing files with group layers containing image data (from broken files) throwing an error
19
+ - Fixed reading out of range global layer mask opacity
20
+ - Fixed writing inverted bounds of empty layers
21
+ - Fixed reading 16 bit brush samples in ABR files with half opacity (Photoshop uses 0-32768 range for 16 bit values)
22
+ - Fixed large patterns allocating image data before checking memory limit (patterns exceeding the limit are now skipped without allocating memory)
23
+ - Fixed reading performance regression from v32, RLE compressed image data, patterns and strings are decoded faster
24
+
25
+ ## v33.0.0
26
+ - **BREAKING CHANGE:** CMYK colors stored in binary color structures (legacy `lrFX` effects, background color, filter mask, etc.) are now inverted on read and write (Photoshop stores 0 as 100% ink), matching CMYK colors read from descriptors
27
+ - **BREAKING CHANGE:** Text layers with "Windows" and "Windows LCD" anti-aliasing now read as `platform` and `platformLCD` instead of `smooth`, and writing them no longer produces `sharp` anti-aliasing
28
+ - **BREAKING CHANGE:** Hue/saturation adjustment colorize settings are now read as `colorize` and `colorization` (`hue` 0-360, `saturation`, `lightness`) fields, previously they were incorrectly read as `a`, `b`, `c`, `d` fields of `master`, which now only has `hue`, `saturation` and `lightness`
29
+ - **BREAKING CHANGE:** Removed `pathList` field (it was always empty), saved paths are now read and written as `imageResources.savedPaths`
30
+ - **BREAKING CHANGE:** Levels and curves adjustment layers now use `channels` array (index 0 is composite channel, followed by document color channels) instead of `rgb`, `red`, `green` and `blue` fields, previously black channel of CMYK documents (and other channels) was lost
31
+ - Added support for levels smart filter
32
+ - Added `savedPaths`, `workPath` and `clippingPath` image resources (paths from the Paths panel), previously they were not written back
33
+ - Added support for reading CMYK documents (8 and 16 bits per channel), image data is converted to RGB using approximation of Photoshop's default U.S. Web Coated (SWOP) v2 profile
34
+ - Added `iccProfile`, `exifData`, `iptcData`, `printStyle`, `printFlagsInfo`, `indexedColorCount`, `transparencyIndex`, `alphaChannelDisplayInfo`, `colorHalftoneScreens`, `grayscaleHalftoneScreens`, `colorTransferFunctions` and `grayscaleTransferFunctions` image resources, previously they were not written back
35
+ - Added `generatorSettings` layer field (Generator / Export As settings), and document-level `generatorSettings` (with `assets` and `crema` fields), previously it was not written back
36
+ - Added `printerProfileColorSpace` field to `printInformation`, grayscale printer profile was previously written as RGB, `printerProfile`, `blackPointCompensation` and `proofSetup` are no longer written with default values when missing
37
+ - Added `buildUp` and `group` (brush groups / folders) fields to brushes read with `readAbr`
38
+ - Added support for reading ABR version 1 and 2 files (Photoshop 6 and earlier), sampled brushes are read as brushes with `sampled` shape and sample with generated `brush-N` id
39
+ - Added pattern `linked`, `phase`, `scale` and `angle` fields to stroke effect type (they were already read and written)
40
+ - Fixed writing file read with `useRawData` option producing black composite image
41
+ - Fixed writing color palette of Indexed documents into color mode data of RGB file
42
+ - Fixed writing vector mask of layers with vector stroke as `vmsk` instead of `vsms` (and vector mask of all layers in PSB files as `vsms`), vector masks now also include path component indices like Photoshop
43
+ - Fixed writing effects of group layers in `lfx2` / `lmfx` section instead of `lfxs`
44
+ - Fixed writing Displace smart filter displacement map path without trailing null character
45
+ - Fixed writing placed layer without `width` and `height` with zero size when `warp` is provided
46
+ - Added `'Distance'` units (used by print style)
47
+ - Added `external` field to `placedLayer` for linked smart objects, they are now written as `SoLE` without `PlLd` (like Photoshop), previously they were written as embedded smart objects
48
+ - Added `gradient` and `interpolationMethod` fields to outer and inner glow effect types
49
+ - Added `throwForMissingFeatures` and `totalMemoryLimit` options to `readAbr` and `logMissingFeatures` and `throwForMissingFeatures` options to `readAse`
50
+ - Added `log` write option and `log` field to `PsdWriter`, same as for reading
51
+ - Fixed curves smart filter without preset kind removing all smart filters of the layer
52
+ - Added `shapeContour` field to bevel effect (contour used when `useShape` is enabled), previously it overwrote `contour` (gloss contour) and was lost when writing
53
+ - Added `protected.all` field for "lock all" layer protection flag
54
+ - Added `type` field to gradient color stops using foreground or background color
55
+ - Added `scale` and `angle` fields to pattern stroke and pattern fill layer content
56
+ - Added missing `angle` type on pattern overlay effect, `range` and `antialiased` on bevel effect and `technique` on outer glow effect
57
+ - Fixed writing gradient map layers with interpolation method throwing an error, and interpolation method always reading as `perceptual`
58
+ - Fixed writing layer raw data (`useRawData` option) to a file with different format (PSB to PSD or vice versa, or non-RGB color mode)
59
+ - Fixed crash reading artboard info without background color
60
+ - Fixed lost effects (other than the first) and rounded opacity of animation frames
61
+ - Fixed lost style of empty last paragraph of text layer
62
+ - Fixed reading book (Pantone) colors in descriptors throwing an error (book colors are not supported, they are read as black)
63
+ - Removed hidden properties used to write back original descriptor value types, reference classes and exact color values, values are now always written based on their current data (`GlobalObject`, `GlobalClass` and `UnitFloat` descriptor values are written as `Object`, `Class` and `UnitDouble`)
64
+ - Fixed gradient opacity stops, gradient offsets and HSB hue values changing slightly on round-trip
65
+ - Fixed changing explicit id of other layer when fixing duplicate layer ids
66
+ - Fixed writing `realMask` without `mask` producing empty user mask
67
+ - Fixed reading 16bit RLE compressed brush samples
68
+ - Fixed brushes with transfer dynamics from older Photoshop versions being skipped when reading ABR files (`transfer.wetnessDynamics` and `transfer.mixDynamics` are now optional)
69
+ - Fixed reading empty ABR file throwing `RangeError` instead of `Invalid ABR file` error
70
+ - Fixed reading legacy (non-unicode) UTF-8 alpha channel names that are not valid GBK
71
+ - Fixed empty linked file creator and type being read as `'\0\0\0\0'`
72
+ - Fixed leading BOM being stripped only from long UTF-8 strings
73
+ - Fixed JPEG thumbnails with both JFIF and Adobe markers decoding with wrong colors
74
+ - Fixed malformed patterns and brushes bypassing memory limit
75
+ - Fixed reading files with layers with negative size (now read as empty layers)
76
+ - Fixed composite image transparency marked only by `Mtrn`/`Mt16`/`Mt32` (or by "Transparency" alpha channel name in 16bit documents) being ignored
77
+ - Fixed duplicate layers in 16bit and 32bit documents with both 8bit compatibility layers and `Lr16`/`Lr32` layers
78
+ - Fixed writing `lnk3`, `lnkE`, `pths`, `extd`, `extn`, `FELS` and `artd` in PSB files with 32bit length (Photoshop uses 64bit length), files written by previous versions are still read correctly
79
+ - Fixed glow effect gradient interpolation method being lost
80
+ - Fixed gradient fill and gradient stroke scale and offset being rounded to whole percent when writing
81
+ - Fixed vector stroke without line dash set being lost
82
+ - Fixed faux bold/faux italic (synthetic) variants of the same font being merged when writing text layers
83
+ - Fixed reading photo filter version 3 colors (stored as XYZ, not Lab)
84
+ - Fixed reading pattern transparency, 16bit/32bit patterns and RLE compressed indexed patterns, unsupported or invalid patterns are now skipped instead of removing all following patterns
85
+ - Fixed invalid pattern channel bounds, brush sample sizes and section sizes in ABR files causing huge allocations or hangs
86
+ - Fixed unknown sections (for example tool presets), invalid brushes and samples failing reading of whole ABR file, they are now skipped
87
+ - Fixed ASE files with unknown blocks, unknown color modes or color types, missing color types or non-zero minor version failing to read
88
+ - Fixed frame animations (`imageResources.animations`) being lost when stored in plug-in image resource other than 4000
89
+ - Fixed reading files with 57 channels (56 channels and transparency, written by Photoshop CS3 for 53 alpha channels)
90
+ - Fixed reading files with trailing bytes in image resources section or with image resources section length larger than its data (Photoshop CS2)
91
+ - Fixed layer metadata (timestamp, animation frames, layer comps) being lost for files from Photoshop Elements (`8ELE` signature) and when one of metadata items fails to read
92
+ - Fixed reading stroke effect size stored as number (old Photoshop versions)
93
+ - Fixed display info (`alphaChannelDisplayInfo`) being lost when channel color uses unsupported color space, the color is kept in `rawColor` field
94
+ - Fixed layers with unknown blend mode failing the whole file, they are read with normal blend mode (unless `throwForMissingFeatures` is set)
95
+ - Added support for reading CMYK patterns
96
+ - Added `colorSamplers` (Photoshop 5 color samplers) and `effectsVisible` image resources, obsolete display info resource is read into `alphaChannelDisplayInfo`
97
+ - Added `color` and `id` fields to guides (`gridAndGuidesInformation.guides`)
98
+ - Added `windowsDevMode` (raw printer settings) and `outputSettings` (Save for Web output settings) image resources
99
+ - Frame info plug-in resource is written together with animations, plug-in resources are written with consecutive ids like in Photoshop
100
+ - Added reading of uncompressed (raw RGB) thumbnails
101
+ - Fixed JPEG thumbnails with number of planes other than 1 not being read
102
+
3
103
  ## v32.0.0
4
104
  - **BREAKING CHANGE:** Mask opacity (`filterMask.opacity`, `userMask.opacity` from `LMsk`, `globalLayerMaskInfo.opacity`) is now read and written using the correct 0-100 scale (Photoshop's default 50% now reads as `0.5` instead of `0.196`)
5
105
  - **BREAKING CHANGE:** HSB, CMYK, Lab and Grayscale colors in descriptors (effects, gradients, filters) are now converted to the ranges documented on the `Color` type (HSB `s`/`b` 0-1, CMYK and Gray 0-255, Lab `l` 0-1 and `a`/`b` -1..1)
package/LICENSE CHANGED
@@ -24,3 +24,8 @@ SOFTWARE.
24
24
 
25
25
  Any image or brush files included in this repository are not covered by this
26
26
  license and belong to their copyright holders.
27
+
28
+ CMYK to RGB conversion coefficients in src/psdReader.ts are taken from pdf.js
29
+ (https://github.com/mozilla/pdf.js), Copyright 2012 Mozilla Foundation,
30
+ licensed under the Apache License, Version 2.0
31
+ (http://www.apache.org/licenses/LICENSE-2.0).
package/README.md CHANGED
@@ -9,13 +9,10 @@ Implemented according to [official documentation](https://www.adobe.com/devnet-a
9
9
 
10
10
  ## Limitations
11
11
 
12
- * Does not support reading Indexed, CMYK, Multichannel, Duotone and LAB color modes (all supported color modes are converted to RGB mode when reading)
13
- * Does not support writing any color modes other than RGB
14
- * Does not support 16 bits per channel
15
- * Does not support The Large Document Format (8BPB/PSB)
16
- * Does not support color palettes
17
- * Does not support animations
18
- * Limited pattern support: reads and writes document-level pattern blocks (`Patt`/`Pat2`/`Pat3`) for raw/RLE-compressed, RGB/Grayscale patterns. Does not support zip-compressed patterns (used by most real Photoshop files), Indexed or 16-bit patterns, or the "Pattern Overlay" layer effect (only its name/id reference is read/written)
12
+ * Does not support reading Multichannel, Duotone and LAB color modes (image data of all supported color modes - Bitmap, Grayscale, Indexed, RGB and CMYK - is converted to RGB when reading, CMYK colors are converted using approximation of U.S. Web Coated (SWOP) v2 profile, embedded color profile is not used)
13
+ * Does not support writing Multichannel, Duotone and LAB color modes (Bitmap, Grayscale, Indexed, RGB and CMYK documents are written in their color mode and bit depth, image data is converted from RGB)
14
+ * Does not support writing 16 or 32 bits per channel (reading is supported)
15
+ * Limited pattern support: reads and writes document-level pattern blocks (`Patt`/`Pat2`/`Pat3`) for raw/RLE-compressed RGB/Grayscale patterns and raw Indexed patterns (patterns are always written as RGB). Does not support zip-compressed patterns (used by most real Photoshop files), RLE-compressed Indexed patterns or 16-bit patterns. Pattern references in layer effects and vector fills (such as "Pattern Overlay") only carry pattern name/id and are not linked to pattern data
19
16
  * Does not support some metadata fields
20
17
  * Does not support 3d effects
21
18
  * Does not support some new features from latest versions of Photoshop