-
Notifications
You must be signed in to change notification settings - Fork 97
API Changes
A note about versioning and private properties: The Generator library uses the convention that underscore-prefixed properties (e.g., PhotoshopClient.prototype._hostname
) are considered private and subject to change without prior notification. We strive to maintain reliable semver-compatible version numbers for the public API presented by Generator-core, but explicitly do not promise to maintain compatibility for private properties. If your plugin requires functionality that is only exposed via a private property that you think should be made public and stable, please file an issue!
- Minor bug fixes, updated
ws
dependency, switched to package-lock.json file fornpm
- Use shared Photoshop scripting engine for most ExtendScript execution (Performance improvement)
- Blacklist device preview plugin
- Several Bug Fixes
- New optional settings for
getPixmap()
:settings.ClipBounds
- Requires version v17.0 of Photoshop
- Change to scaling logic in
getPixmap()
- Several Bug Fixes
- Suppress logs to stdout unless "-v" argument supplied to generator
- New optional setting for
savePixmap()
:settings.useJPGEncoding
Supported only for FLITE transcoding to JPEGs, possible values are "optimal" and "precomputed".
- New optional setting for
getPixmap()
.settings.getICCProfileData
: If true then the final ICC profile for the image is included along with the returned pixmap. If using FLITE to convert to a supported output format, the color profile will be embedded.
-
Addition -
Generator.prototype.startWebsocketServer
has a new optional parameterdomain
. If a node Module is provided, it will be used to register aDomain
on the server after it is started. Seelib/rpc/DomainManager.loadDomainModule()
for more information. Previously, domains were registered by the client which would provide a full local file path to the domain specification. Now it is possible for plugins to register domains at start-up.
To ship sometime after Photoshop 15.2.2 / 2014.2.2
-
Addition -
Generator.prototype.getPixmap
has a new optional property on thesettings
parameter:maxDimension
. This property allows the caller to configure the max dimension that a pixmap is allowed to have (in either width or height). If a requested pixmap would have either a width or height larger than the maximum allowed, the pixmap is scaled (by Photoshop) to the max dimension before it is sent to Generator. Previously, the max dimension was hardcoded to 10,000 pixels. Contributed by @marekhrabe. -
Addition -
Generator.prototype.streamPixmap
is just likesavePixmap
, but allows the caller to provide an output stream rather than a file path. The final converted image is streamed to the output stream. This method returns a Promise which resolves when the output stream is successfully closed. Contributed by @mvujovic.
Shipped with Photoshop 15.2.2 / 2014.2.2
-
Addition - Added a new method
Generator.prototype.copyToClipboard
that allows a string to be copied to the system clipboard. Contributed by @marekhrabe. -
Addition - The method
Generator.prototype.getDocumentInfo
now has an additional optional flag:getPathData
. This defaults tofalse
. If set totrue
, adds extended path data for all shape layers that would otherwise be included in the returned document info. This is the same data that can be retrieved by callingGenerator.prototype.getLayerShape
Shipped with Photoshop 15.2.0 and 15.2.1
-
Addition - The settings parameter on
Generator.prototype.savePixmap
now respects an optionallossless
property that indicates whether or not WebP files should be compressed losslessly. As before, WebP files are not losslessly compressed by default. Contributed by @marekhrabe. -
Addition - A new method
Generator.prototype.getDocumentPixmap
was added that creates a pixmap of the entire document, exclusive of hidden layers. Contributed by @marekhrabe. -
Addition - The settings parameter on
Generator.prototype.getPixmap
now respects an optional setting namedconvertToWorkingRGBProfile
. If true, performs a color conversion on the pixels before they are sent to generator. The color is converted to the working RGB profile (specified for the document in PS). By default (when this setting is false), the "raw" RGB data is sent, which is what is usually desired. (Default: false) -
Addition - The settings parameter on
Generator.prototype.getPixmap
now respects two new optional settings,settings.compId
andsettings.compIndex
, either of which can be used to indicate which of the document's layer comps' settings should be used for pixmap generation. -
Addition - Starting with of Photoshop 15.2,
Generator.prototype.savePixmap
respects a new optional setting,settings.usePngquant
, which causes 8-bit PNGs to be processed with pngquant instead of ImageMagick. Contributed by @pornel. -
Addition -
Generator.prototype.getLayerSettingsForPlugin
andGenerator.prototype.setLayerSettingsForPlugin
were added to read and write layer-level metadata. To read, a document ID must be specified. Writing is only possible on the current active document. -
Addition -
Generator.prototype.get/setCustomOptions
andGenerator.prototype.update/deleteCustomOption
- Asynchronously reads/stores a dictionary per-plugin, or updates/deletes a key in that dictionary in the Photoshop memory space. Accessible via ExtendScript and CEP panels. -
Addition -
Generator.prototype.start/stopWebsocketServer
- Starts and stops a Websocket server per-plugin. The port can either be specified or dyamically assigned. Examples of how to use this Websocket server (including sample code) can be found in PR #233.
Shipped with Photoshop 15.1.
-
Addition -
Generator.prototype.getGuides
was added. Given a document ID, it returns a promise that resolves with sets of horizontal and vertical guide positions for that document. See the JSDoc here for details. Contributed by @marekhrabe. -
Addition -
Generator.prototype.getPixmap
now allows the user to specify a range of layers to composite together. The oldlayerId
parameter is renamed tolayerSpec
. If it is passed a single number (as before) it works exactly as before (i.e. it is treated as a layer ID). Alternatively, the caller can specify an object of the format{firstLayerIndex: number, lastLayerIndex: number, =hidden: Array.<number>}
. The first two properties specify the starting and ending indices (inclusive) to composite. The optionalhidden
parameter specifies an array of layer indices to hide in the composite. To read more about layer IDs and layer indices, see Understanding Layer IDs and Layer Indices -
Addition - In PS <= 15.0, PSD smart objects were always scaled in pixel space, which led to fuzzy vectors. In PS >= 15.1, PSD smart objects will now be scaled in a vector-preserving way.
Generator.prototype.getPixmap
now supports an optional parametersettings.forceSmartPSDPixelScaling
that, when set totrue
, will force the old behavior. This parameter defaults tofalse
.
Shipped with Photoshop 15.0.
-
Change - The parameter list for
Generator.prototype.getSVG
changed. The signature is nowdocumentId, layerId, settings
, andsettings
is an object that takes optional parameters. At this time, the only optional parameter is a single float:scale
, which specifies a factor by which to scale the SVG relatively (1.0 for 100%). The old signature waslayerId, scale
, wherescale
was an optional float (equivalent in functionality tosettings.scale
). -
Addition - A
version
property was added toGenerator.prototype
, which can be used to retrieve the version of generator-core (as a semver string). -
Addition -
Generator.prototype.getPhotoshopExecutableLocation
was added. See documentation in the source code for differences between this method andGenerator.prototype.getPhotoshopPath
. -
Addition -
Generator.prototype.getOpenDocumentIDs
was added. It returns a promise that resolves to an array of all open document IDs. -
Addition -
Generator.prototype.getLayerShape
was added. It returns a promise that resolves to an object detailing path data on the specified layer. -
Addition - Generator now passes a
Logger
object in theinit
call to plugins. (The signature forinit
in plugins is nowinit(generator, config, logger)
). The logger object has the standarddebug
,info
,warn/warning
, anderror
logging methods that do string formatting exactly like theirconsole
counterparts. In addition, log messages will be printed to stdout prefixed by the plugin they came from and the code location of the log call. Log level can be configured through the LoggerManger object, which is created in generator.js, and which can be accessed through themanager
property on anyLogger
object. See logging.js for more information.
-
Change -
Generator.prototype.saveLayerToSVGFile
was removed, andGenerator.prototype.getSVG
was added in its place (with slightly different API -- it no longer saves the SVG file to disk)