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

Image Resizing Javascript no longer working in Photoshop 26.1.0

New Here ,
Dec 05, 2024 Dec 05, 2024

Copy link to clipboard

Copied

I have been using the attached script from our website vendor to resize and rename batches of images for our website.  It worked fine until the most recent update of Photoshop.  Now the script creates all blank images and the large image created is huge (175mb or more, even when starting with a small file and is very slow..  Any suggestions on what could be causing this?

TOPICS
Actions and scripting , Windows

Views

127

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
Adobe
Community Expert ,
Dec 05, 2024 Dec 05, 2024

Copy link to clipboard

Copied

@Lynne309947120rx2 

 

I'll give it a look, do the files use artboards?

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
New Here ,
Dec 06, 2024 Dec 06, 2024

Copy link to clipboard

Copied

The original files I use the script on are sized to a square at least as
large as 700 px by 700px. Some are larger, but I have only had to change
it to a square image for the last 10+ years I have been using the script.





Lynne-Peterson

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 ,
Dec 05, 2024 Dec 05, 2024

Copy link to clipboard

Copied

@Lynne309947120rx2 

 

The large image that should be 700px is creating a 50400 × 50400px image!

The problem is the canvas size step after the trim and image size, it's sizing to 700 inches or whatever the current application ruler units are, not px!

Change this bit from (no units specified):
 
// even out the dimentions to a square Large x Large
doc.resizeCanvas(large, large, AnchorPosition.MIDDLECENTER);

 

To (px specified):

 

// even out the dimentions to a square Large x Large
doc.resizeCanvas(UnitValue(large, "px"), UnitValue(large, "px"), AnchorPosition.MIDDLECENTER);

 

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
New Here ,
Dec 06, 2024 Dec 06, 2024

Copy link to clipboard

Copied

LATEST
Thank you. That fixed the issue.





Lynne-Peterson

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