6 Replies Latest reply on Oct 31, 2016 1:26 PM by JaysonDMG

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

    JaysonDMG Level 1

      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_FirstLaunch.png

       

      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-2.png

       

      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.

        • 1. Re: selection.fill bug in photoshop CC 2015 version 16.1.2 (2015.1.2)?
          JJMack Most Valuable Participant

          All I can say is its good to keep a working copy of Photoshop in reserve.  CC 2015 has been a rocky road only after its fourth update,  have I started using it.

          • 2. Re: selection.fill bug in photoshop CC 2015 version 16.1.2 (2015.1.2)?
            tiront Level 1

            Glad to see I'm not the only one running into this bug! CC 2015 is surprisingly buggy so far, and not ready for production use, in my opinion.

            • 3. Re: selection.fill bug in photoshop CC 2015 version 16.1.2 (2015.1.2)?
              Tom Ruark Adobe Employee

              Does this fail when running from the ESTK and not when dropping the script on Photoshop or using File -> Scripts?

               

              The problem is the default colors for the alpha channel. If you have changed those and are running from the ESTK then the fill is picking up the tool bar colors and not the colors from your script. And this is the alpha color swatches and not the RGB color swatches.

               

              To state it again:

              Reset preferences.

              ESTK and File -> Scripts should be fine now.

              If you change the alpha channel default swatches from white/black to something else then you will get those colors when running via the ESTK and not the black/white from your script.

               

              Let me know if you are seeing something different and the details.

              • 4. Re: selection.fill bug in photoshop CC 2015 version 16.1.2 (2015.1.2)?
                JaysonDMG Level 1

                Hi Tom. Just wanted to revisit this for completeness as the bug appears to have been resolved in the most recent version of Photoshop-Adobe Photoshop CC (2015.5.1 Release | 20160722.r.156 x 64). Again the bug only appears in Adobe Photoshop CC (2015.1.2 Release | 20160113.r.355 x64).

                 

                Below are screenshots of the behavior in the last 3 versions of Photoshop when launching the script from ESTK with preferences reset. I added ruler preference code to accommodate the preference reset.

                 

                // Set the ruler units to pixels

                var originalRulerUnits = app.preferences.rulerUnits

                app.preferences.rulerUnits = Units.PIXELS

                 

                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();

                 

                // restore unit settings

                app.preferences.rulerUnits = originalRulerUnits

                 

                Adobe Photoshop CC (Version 14.2.1 x64)

                PS-14-2-1.png

                 

                Adobe Photoshop CC (2015.1.2 Release | 20160113.r.355 x64)

                PS-2015-1-2.png

                 

                Adobe Photoshop CC (2015.5.1 Release | 20160722.r.156 x 64)

                PS-2015-5-1.png

                • 5. Re: selection.fill bug in photoshop CC 2015 version 16.1.2 (2015.1.2)?
                  JJMack Most Valuable Participant

                  Adobe does not fix old version of their Applications. Photoshop  CC 2015  is no longer the current version of Photoshop  Photoshop CC 2015.5 is current and Adobe is working on some of the reported issues in CC 2015.5.

                  • 6. Re: selection.fill bug in photoshop CC 2015 version 16.1.2 (2015.1.2)?
                    JaysonDMG Level 1

                    Sure. I was just showing for completeness and anyone who stumbles upon this thread in that they should most definitely update to CC 2015.5.