Sunday, April 4, 2010

Photohop plugin do's and don'ts

Hi,



I'm new to the Photoshop plugin scene so please bear with me. I'm trying to determine if a plugin is the right way to go for the work I want to do. I can't seem to find a straight answer in the documentation so I'm turning to the forums.



The plugin I'd like to write would have to do the following things :

- Parse all the layers of a document and extract data be it image or text

- Save that data in individual files



It seems quite close to what an export plugin can do but I have several questions :

1) Is this doable in an export plugin ? In any plugin type ?

2) Is it ok to use new and delete freely in a plugin ?

3) Is it ok to freely open/write/close any files in a plugin ?



This plugin would be developped for an internal tool to extract data from a psd file.



Any help appreciated. I have found that I could probably get this done in a javascript file but I'm still evaluating the technology and wondering if it can be done better/same way in a plugin.



I'm using CS3 and the corresponding SDK, whose documentation seems quite poor to me.



Cheers,

Pascal.
Photohop plugin do's and don'ts
1) Yes, the pixel info not the text info. Unless you want the text as pixels.



2) Yes. For large memory allocations you should use the Photoshop memory suites.



3) Yes, but I would not open/write/close the currently open documents in Photoshop.



Look for ReadImageDocumentDesc *documentInfo in the ExportReocrd. Other plug-in types have a similar pointer. Filter, FileFormat that I know of. That pointer has a ReadLayerDesc *layersDescriptor which is a linked list to all the layers. The Poor Mans Type Tool filter example has some of this code as an example.



Yes, the documentation is lame. Please add some feedback here on exactly what you were looking for and did not find or other verbose feedback and maybe somebody from Adobe will finally listen.
Photohop plugin do's and don'ts
Thanks for your answer. It seems that I could probably get it working but doing this in a Javascript seems much simpler.



As for the documentation, I don't quite understand the structure. The first section should have been describing a very simple plugin with code example. Instead the first tutorial is an external pdf file. The plugin types description is good but I didn't tell me if new was supposed to be used or not or why it shouldn't be. Then I had trouble understanding what can actually be done in a plugin and what shouldn't be done in a plugin.



I won't be looking at this any further though.



Cheers,

Pascal.

As an alternative to the plugin approach (which might work), I've already written a standalone program (GPL) that does what you need: http://telegraphics.com.au/svn/psdparse/trunk



(Extracts every layer of a PSD/PSB as a PNG file. Metadata such as layer sizes and positions is optionally extracted to XML.)



Since the PSD documentation is so incomplete, incorrect, and confusing (assuming you can obtain it at all), you would need several hundred hours to duplicate this effort. A number of things are not documented and therefore not supported by this program, but it is substantially compatible with PSDs at least through CS2.

Sorry, if I late...

2Pascal Gane: I have a same task for now. and I am a new too.

could you help me with a few links for usefull information? I need to do export or autiomation plugin (now stopped on export) and get same information (layers tree). it will be great if You'll can help me.



wbr Dmitry

joblst@mail.ru

We have a third party plug-in that we install for PhotoShop CS3.

That plug-in disappears from the menu when PhotoShop is upgraded

from CS3 to CS4 or a localization patch is installed.



I tried editing tw10428.dat file to add the third party plug-in

to the menu, but it appears not to work.



How can I make the add-in to show up?



Thanks in advance.



Stephen Moon

[email deleted]

It doesn't disappear - it was never there to start with.



The .dat files have nothing to do with menus or plugins. Why are you even touching that file?



Just install the plugin in CS4, like you installed it for CS3.



And what does your problem have to do with this topic or the Photoshop Plugin SDK?

Maybe, I should start a new topic on this one.



What do you mean ''it doesn't disappear''?



When I edit the text in .dat file, it change the text displayed

on the menu? What do you mean that has nothing to do with it???



I installed a Korean localization patch and that seems to make

the plug-in disappear. I tried reinstalling it and it does not

work.



Stephen Moon

[email link deleted]

Stephen,



In these forums, all responses are posted here so that everyone can benefit. If you leave your email address, you are inviting spam. A lot of spam.



Neil

Hi Tom %26amp; Chris,



I have a problem with this issues,



as you mentioned Tom, we could use export plug-in to get each layer of a multilayer psd file, but so far as I found, when I trying to open a export plug-in when the open document is a one layer only psd file, it works well, but when I coming cross the multilayer psd file, the menu would turns into ''Gray''(it been disabled) ...



I am just using sample code ''Outbound'' to do the test. and what I am using is Adobe Photoshop CS4 SDK + Adobe Photoshop CS2.



Could you give me some advices?

Any help will be appreciated.



Jerry Yu

No comments:

Post a Comment