You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Repo file: /src/pages/ps_reference/media/imaging.md Live page link (and page section):https://developer.adobe.com/photoshop/uxp/2022/ps_reference/media/imaging/#dispose Issue description:
"Playing around with Imaging API, I found this dispose() method which frees memory after using the .getData() method. However here’s the issue I found:
const pixelData = await imageObj.imageData.getData();
pixelData.dispose();
// This will return an error: "pixelData.dispose is not a function"
Which is obvious as the getData() method returns an array of numbers (image pixel data) and not an object, so the object is the imageObj.ImageData and this can call the dispose() function indeed to free the memory from the imageObj.imageData.getData();
How I know this?
I tried to do the imageObj.imageData.dispose() method after storing the data obtained with the imageObj.imageData.getData() it into a constant and it worked.
So I think this should be changed to
imageObj.imageData.dispose();
Instead of
pixelData.dispose();
So this is something that can be confusing for future developers reading the documentation.
Hope it gets clear enough.
Correct if I’m wrong, please."
The text was updated successfully, but these errors were encountered:
Repo file: /src/pages/ps_reference/media/imaging.md
Live page link (and page section): https://developer.adobe.com/photoshop/uxp/2022/ps_reference/media/imaging/#dispose
Issue description:
"Playing around with Imaging API, I found this dispose() method which frees memory after using the .getData() method. However here’s the issue I found:
Here’s the link to the documentation error:
https://developer.adobe.com/photoshop/uxp/2022/ps_reference/media/imaging/#dispose 1
If you try to run the same code in the example:
How I know this?
I tried to do the imageObj.imageData.dispose() method after storing the data obtained with the imageObj.imageData.getData() it into a constant and it worked.
So I think this should be changed to
imageObj.imageData.dispose();
Instead of
pixelData.dispose();
So this is something that can be confusing for future developers reading the documentation.
Hope it gets clear enough.
Correct if I’m wrong, please."
The text was updated successfully, but these errors were encountered: