Skip to main content
JJMack
Community Expert
Community Expert
November 17, 2014
Answered

Bug in layer resize.

  • November 17, 2014
  • 1 reply
  • 971 views

I reported a bug today I feel could do some nasty thing to document when you use resize() to re-size a layer. Particularly if you have used suspend history.  It looks like resize for some unknown reason backs the document up one history state before doing the re-size.  I have tested this in CS5, CS6, CC and CC 2014 all fail the same way. Nasty Nasty...

I can program around that bug if history states are being recorded for the script.  However I like to suspend history state recording in scripts so that its easy to back up in history after the script is used if need be.

However that bug can destroy the document and also remove prior history states in so that its impossible to recover the document from history for prior state has been replaced with the recording of the use of the script. How many states are removed would depend on how many .resize(); the script did. Nasty Nasty.

Here are some screen of the bug in action. The fist before and after look the way the script is designed to work. However I did an extra select all before using the script. You see its no longer in history in the after.

The second before and after same as first without the extra select all note a guide line has been removed.

In the third before and after I changer the order of my of steps before the script I first drag out the guides then place in the image.  You see that the image has been removed the wrong layer has been resized and the place removed from history.  Nasty Nasty.

The script works when history is not suspended for I programmed the script to work around the bug... http://www.mouseprints.net/old/dpr/FitImageToGuides.jsx

This topic has been closed for replies.
Correct answer JJMack

Developed a work around. The bogus history backup only occurs when there is an active an active selection when the layer is re-sized.  So I updates the script to

Deselect

activeLayer.resize(

Re-Select

So the work around will always be needed for Adobe will not be fixing CS5 CS6 or CC.

1 reply

JJMack
Community Expert
JJMackCommunity ExpertAuthorCorrect answer
Community Expert
November 18, 2014

Developed a work around. The bogus history backup only occurs when there is an active an active selection when the layer is re-sized.  So I updates the script to

Deselect

activeLayer.resize(

Re-Select

So the work around will always be needed for Adobe will not be fixing CS5 CS6 or CC.

JJMack
matias.kiviniemi
Legend
November 18, 2014

Great work on tracking this down and reporting it as it's probably a pain to do!