Groups > Application developers > Photoshop SDK > Re: Photohop plugin do's and don'ts




Photohop plugin do's and don'ts

Photohop plugin do's and don'ts
Mon, 28 Apr 2008 05:21:10 -070
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,
Post Reply
Re: Photohop plugin do's and don'ts
Mon, 28 Apr 2008 12:02:04 -070
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.

Post Reply
Re: Photohop plugin do's and don'ts
Tue, 29 Apr 2008 03:11:16 -070
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,
Post Reply
Re: Photohop plugin do's and don'ts
Sat, 17 May 2008 07:07:03 -070
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.)

Post Reply
about | contact