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

Photoshop UXP Plugin — Images Place on Frames but Not Fitting Correctly

New Here ,
Nov 10, 2025 Nov 10, 2025

Hi everyone,

 

I’m building a Photoshop UXP plugin using React that automatically places selected photos into selected PSD frame layers.

 

Here’s what’s happening right now:

 

When I select 1 or more frame layers and then select photos,

 

The plugin places the images on top of the selected frames (so layer targeting works),

 

But they aren’t fitting inside the frame bounds properly — they appear too large or off-center.

 

 

I think the clipping mask and transform logic is not being applied correctly after placement.

 

Here’s what I want:

Each selected photo should fit exactly inside the corresponding frame’s bounding box — similar to how “Place Embedded” with “Clipping Mask” behaves in Photoshop manually.

 

I’m using batchPlay for placement and transformation.

If anyone can share a working snippet or guide me on the correct sequence of actions (create smart object → transform → set clipping mask), that would be super helpful.

 

Thanks in advance! 🙏

— Vijay

47
Translate
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 ,
Nov 23, 2025 Nov 23, 2025
LATEST

Hi Vijay, sounds like you’re on the right track. When images land on the correct layer but don’t line up with the frame, that usually means the transform step is firing before Photoshop has fully registered the placed layer geometry.

 

Photoshop’s manual Place command does a few things in a very strict order. If your batchPlay sequence deviates even slightly, you get the oversize or off centre behaviour you’re seeing.

 

The usual reliable sequence looks like this:

  1. Place the file and convert it to a smart object straight away
  2. Wait for Photoshop to finish the placement event
  3. Read the frame layer’s bounds
  4. Transform the smart object to match those bounds
  5. Apply the clipping mask last

 

A lot of plugins get tripped up by step 2. batchPlay fires instantly, but Photoshop is still calculating the smart object’s natural size. If you transform before the metadata is ready, you get nonsense scale values.

 

A minimal pattern that works is something like:

  • batchPlay place event
  • batchPlay convert to smart object
  • await a small artificial pause using executeAsModal and an async wrapper
  • batchPlay transform using frame.bounds
  • batchPlay set clipping mask

 

No need for huge delays, even a micro task is enough to let PS settle before the transform.

 

If you want a working example to study, the UXP Samples repo on Github has a clipping mask example that shows the correct event order. It’s not plug and play for your case, but the structure is the bit that matters.

 

Once you follow that exact order you should get the same behaviour as manual Place Embedded every time.

Good luck with the plugin, you’re very close.

 
Translate
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