• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Bug in layer resize.

Community Expert ,
Nov 17, 2014 Nov 17, 2014

Copy link to clipboard

Copied

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

Cap1.jpgCap2.jpgCap3.jpg

JJMack
TOPICS
Actions and scripting

Views

810

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 18, 2014 Nov 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.

Votes

Translate

Translate
Adobe
Community Expert ,
Nov 18, 2014 Nov 18, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 18, 2014 Nov 18, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Nov 18, 2014 Nov 18, 2014

Copy link to clipboard

Copied

For the general case, you probably want to do something like this:

var channel = doc.channels.add();

selection.store(channel);

selection.deselection();

layer.resize(...);

selection.load(channel);

channel.remove();

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 18, 2014 Nov 18, 2014

Copy link to clipboard

Copied

Yes in this case I just made the rectangle selection to get the bounds to calculate the re-size percentage and also later use the selection for masking the re-size excess off. So I had the rectangle selection readily available in this case there was no need for save and delete save selection steps.

Thanks for being around and not deserting the forum

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Nov 18, 2014 Nov 18, 2014

Copy link to clipboard

Copied

BTW, I have at least 33 places in xtools I'll have to manually check to see if I have this problem.

There goes my afternoon...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Nov 18, 2014 Nov 18, 2014

Copy link to clipboard

Copied

Do you know if this bug appears prior to CS5? I'm debating on whether to version check for this bug or just always use this workaround.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 19, 2014 Nov 19, 2014

Copy link to clipboard

Copied

LATEST

Yes I tested CS5 its there.  I never install CS4 and lost my CS3 because of disk drive crashes.  Did not test CS2 for CS2 selection bounds does not work and I would need to add my work around for that bug.

I only have two machine on my I7 Windows 7 system I have perpetual CS5 and CS6 installed and on my workstation also Windows 7 I've installed my subscription versions along with CS2.  There are differences between CS6 13.0.1.3 and subscription version 13.1.2.  Adobe seems to have given up on being backwards compatible starting with CS4.   Even Bill Gate's realized Bugs were bad for business has them exterminated Adobe does not seem to accept that bug are bad for business. So now I have CS2, CS5, CS6, CS6 CC and CC 2014.  I use file system links to add plug-in and script so all installed versions us the single copy of the add-ons I install.

JJMack

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines