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

placeEvent can not set image to layer correctly

Community Beginner ,
Nov 16, 2023 Nov 16, 2023

a30580003kecq_0-1700134281661.png

I try to use "placeEvent" to set image to layer, but new layer lost some pixel(not offset problem)
and I also try to paste image to layer directly, it can work correctly,  then I just need to set the right offset to make two layers matching.
although "placeEvent" can make a right size layers(512 * 512), but it looks like the pixels are overall shifted by 1px in a certain direction.
I saw an article saying this problem: Solved: place a pictures and the left=0,top=0 - Adobe Community - 10410203
I try it but I can not get the correct layer, it seems that I meet other problem
so I also try open new document and duplicate, it works properly

 

TOPICS
Actions and scripting , macOS , Windows
179
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 Beginner ,
Nov 16, 2023 Nov 16, 2023
open new document and duplicate: 
        var activeDoc = app.activeDocument
        var sourceDoc = app.open(new File('${tempFilePath}'))
        var duplicatedLayer = sourceDoc.layers[0].duplicate(activeDoc)
        sourceDoc.close(SaveOptions.DONOTSAVECHANGES)
but it will  flash even though I use app.activeDocument.
suspendHistory, so I dont want to resolve it by this way
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
Community Beginner ,
Nov 16, 2023 Nov 16, 2023

 a30580003kecq_0-1700188025672.png

a30580003kecq_1-1700188059760.png

we can see that the ear obviously move above, but there is no gap in the entire layer, the bottom pixels are filled:

a30580003kecq_4-1700188810033.png

 

a30580003kecq_3-1700188714524.png

 



 

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
Community Beginner ,
Nov 17, 2023 Nov 17, 2023
LATEST

with my allday testing, I found that the problem is caused by photoshop's current screen position like this

a30580003kecq_0-1700214137601.png

I execute the script then it will have 1px offset comparing with the origin image, so I think that it is a bug of photoshop?

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