Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imageChanged event stops dispatching #387

Open
zimag opened this issue Jun 13, 2017 · 4 comments
Open

imageChanged event stops dispatching #387

zimag opened this issue Jun 13, 2017 · 4 comments

Comments

@zimag
Copy link

zimag commented Jun 13, 2017

I was desperate when imageChanged events stopped arriving ( looked like ) randomly. The only cure was to save the document which turned on the events again. Finally I realized that the Timeline Panel's animation frame chages causing this. The solution was to watch CSEvents containing 'animationFrameClass' and instantly save the doc. Which is a workaround but obviously not a perfect solution.

I am using generator-core ( unofficially ) from a HTML panel.

Is it a PS bug or solvable via JS or appearing only on my unsupported setup?

PHXS 18.1.1 Windows 7 64-bit, "generator-core": "3.8.3"

@mcilroyc
Copy link
Contributor

@zimag I don't immediately know what is causing the behavior you are seeing. But we are planning to phase out reliance on the imageChanged event in our generator-assets plugin, and recommend other generator plugin developers do the same. You can still listen for the event, but we'll begin logging a warning when you do. The issue is that the event is extremely non-performant and can effect photoshop responsiveness. If you would like to discuss alternate approaches, please comment with some details of how you are currently using this event.

@zimag
Copy link
Author

zimag commented Jul 25, 2017

@mcilroyc I am usin this event to determine when do I need to fetch the full docInfo. Later by comapring the old and the new docInfos I can decide which image assets must regenerate.

My dream is a pixelsChanged event, which would eliminate thousands of difference recognition lines from my source code. This simple and comprehensive event would tell us if any color or alpha value changed in any pixel of the layer.

I don't want to know the change in a shape layer's path's anchor's forward handle. I need to know olny is there any visible difference.

:)

@zimag
Copy link
Author

zimag commented Jul 25, 2017

I have found another case when the event isn't firing.

Tranform_Glasses_NoEvent_728x90_ADWORDS.zip

glassesBlack_NotFiringImageChanged is the layer which is non casting the event on transform.

Best Regards

@rpensek
Copy link

rpensek commented Aug 12, 2019

@mcilroyc I can confirm this same issue persist when any sort of actions is done as a part of redo
process in PS CC 2019. Simple reproduction steps:

  1. Create new document in PS
  2. Create new layer and fill it's content (or draw)
  3. Remove the layer (imageChanged is fired)
  4. Undo using shortcut - CTRL (CMD) + Z // imageChanged is fired
  5. Redo using shortcut - CTRL (CMD)+ Z // imageChanged is NOT fired

After opening History panel in PS and playing around with history - it seems to work fine and it also fixes history shortcuts undo/redo for that session.

Since you're planning on removing "imageChanged" event, is there any other that we can hook onto? I'm having the same dream as zimag above - something like pixelsChanged event would be awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants