selection.fill bug in photoshop CC 2015 version 16.1.2 (2015.1.2) on mac?

  • 2
  • Problem
  • Updated 3 years ago
First off, boy do I miss ps-scripts.com

Trying to verify that there is in fact a bug in the most recent release of Photoshop (version 16.1.2). Not exhibiting this behavior in 16.0.1 or 15.2.2 on a mac.

This is the version from system info that is exhibiting the bug. 

Adobe Photoshop Version: 2015.1.2 20160113.r.355 2016/01/13:23:59:59 CL 1059143  x64

Most of our scripts do not behave properly in version 16.1.2. I believe that this is limited to a bug using the fill method. Seems intermittent (sometimes it will fill with the proper color sometimes not). I tried to strip some script logic down to the bare minimum for what would exhibit the buggy behavior.  This is script that builds a multichannel document with 2 new spot channels (one with a square in the upper left ("Box1"), one with a square in the lower right ("Box2") overlapping the other). The result of the script should finally create an alpha channel that represents the region where the "Box1" & "Box2" channels intersect, resulting in a 500 pixel centered square.

var newImage = app.documents.add(1000, 1000, 72, "bug.tif", NewDocumentMode.GRAYSCALE, DocumentFill.WHITE);

var docRef = app.activeDocument;

docRef.changeMode(ChangeMode.MULTICHANNEL);


var rgbWhite = new SolidColor ();

rgbWhite.rgb.red = 255;

rgbWhite.rgb.green = 255;

rgbWhite.rgb.blue = 255;

var rgbBlack = new SolidColor ();

rgbBlack.rgb.red = 0;

rgbBlack.rgb.green = 0;

rgbBlack.rgb.blue = 0;


var box1Channel = docRef.channels.add();

box1Channel.kind = ChannelType.SPOTCOLOR;

box1Channel.name = "Box1";

docRef.activeLayer.invert();  

var box1Region = Array(Array(0,0), Array(0, 750), Array(750, 750), Array(750, 0));

docRef.selection.select(box1Region);

docRef.selection.fill(rgbBlack);

docRef.selection.deselect();


var box2Channel = docRef.channels.add();

box2Channel.kind = ChannelType.SPOTCOLOR;

box2Channel.name = "Box2";

docRef.activeLayer.invert();  

var box2Region = Array(Array(250,250), Array(250, 1000), Array(1000, 1000), Array(1000, 250));

docRef.selection.select(box2Region);

docRef.selection.fill(rgbBlack);

docRef.selection.deselect();


var alphaChannel = docRef.channels.add();

alphaChannel.name = "WhereBoxesIntersect";


var box1Selection = docRef.channels.getByName("Box1");

docRef.selection.load(box1Selection);

docRef.selection.fill(rgbWhite);


var box2Selection = docRef.channels.getByName("Box2");

docRef.selection.load(box2Selection);

docRef.selection.invert();

docRef.selection.fill(rgbBlack);


docRef.selection.deselect();



I've noticed that when using this script upon first launch of this version of photoshop (16.1.2) the script doesn't fill any of the channels with black.  See image below. Note the lack of black region fills in the spot and alpha channels.


PS_2015-1-2_FirstLaunchpng


Any subsequent launches of the script on the other hand do seem to behave properly in version 16.1.2. Strange. In the context of most of our scripts though I can only say that the selection.fill method behavior is intermittent and inconsistent at best. Below is the expected behavior in version 15.2.2 and subsequent launches in 16.1.2. Note the black region fills in the spot and alpha channels.


PS_2014-2-2png


Hopefully this can be confirmed and remedied with a patch going forward as it impacts our workflows. Thanks in advance for your time. Let me know how I can better elaborate.

Photo of Jayson Hazelbaker

Jayson Hazelbaker

  • 1 Post
  • 0 Reply Likes

Posted 3 years ago

  • 2

Be the first to post a reply!