Re: [Gimp-developer] XCF spec

2006-09-02 Thread Michael Schumacher
Simon Budig wrote:

> Writing a plugin to change the comment probably is easier than doing
> this with script fu or even binary-patching the XCF, the functions in
> the PDB allow to do this and this is the route I'd suggest.

Using an existing plug-in is probably even better:
http://registry.gimp.org/plugin?id=3064

Can be found by searching for "comment" on http://registry.gimp.org


HTH,
Michael

-- 
GIMP > http://www.gimp.org  | IRC: irc://irc.gimp.org/gimp
Wiki > http://wiki.gimp.org | .de: http://gimpforum.de
Plug-ins > http://registry.gimp.org |
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] XCF spec

2006-09-02 Thread Simon Budig
Florent Monnier ([EMAIL PROTECTED]) wrote:
> Some months ago someone on a mailing-list asked how he could change 
> the comment of xcf files in order to add licencing informations (such as GPL 
> or creative-commons), so as it seems it's not possible from the GUI (maybe we 
> all failed on this mailing-list to find it) I tryed to write a script to 
> change the comment. I noticed that the byte just before the comment (which 
> resides at the begining of the xcf) was the length of this comment, so I 
> tryed to make a script for that guy which changed the comment, and changed 
> the length byte of it too. But It didn't work.
> http://www.linux-nantes.org/~fmonnier/tmp/comlen.ml.html
> 
> From the specs draft I guess that's because there are offsets before the 
> comment, is it right ?
> (I haven't found for the xcf comment in this draft, perhaps I have missed it?)

The comment is stored as a so-called "parasite", in this case a parasite
of the image (you can also attach parasites to the individual
layers/drawables). The comments parasite name is "gimp-comment".

You can use script-fu to access the content of said parasites, the
problem is, that the format of the data is not very convenient to
process with script fu.

Try this:
- start the gimp
- create a new image, optionally changing the comment
- open the script-fu-console and enter the following command:

=> (gimp-image-parasite-list 1)
(1 ("gimp-comment"))

This tells us that there is one parasite for image no. 1, and it is called
"gimp-comment".

=> (gimp-image-parasite-find 1 "gimp-comment")
(("gimp-comment" 1 #22"437265617465642077697468205468652047494d5000"))

Executing PDB commands via script-fu always returns a list, in this case
the first element of the returned list (the first return value) is the
parasite that is attached, in script-fu it is represented as a list
itself: (name, flags, value). The value is a byte array with in this
case 22 bytes, and you'll notice that the following hex values are the
bytes of the string "Created with the GIMP", which is the comment.

Writing a plugin to change the comment probably is easier than doing
this with script fu or even binary-patching the XCF, the functions in
the PDB allow to do this and this is the route I'd suggest.

I hope this helps,
Simon
-- 
  [EMAIL PROTECTED]  http://simon.budig.de/
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] XCF spec

2006-09-02 Thread Florent Monnier
> > Hi, I'm searching through the CVS web viewer for the XCF specs without
> > success http://cvs.gnome.org/viewcvs/gimp/
> > could someone tell me in which directory does it resides ?
>
> http://cvs.gnome.org/viewcvs/gimp/devel-docs/xcf.txt?rev=1.2&view=markup

Thanks, I was willing to read the last version before to ask a clueless 
question. Some months ago someone on a mailing-list asked how he could change 
the comment of xcf files in order to add licencing informations (such as GPL 
or creative-commons), so as it seems it's not possible from the GUI (maybe we 
all failed on this mailing-list to find it) I tryed to write a script to 
change the comment. I noticed that the byte just before the comment (which 
resides at the begining of the xcf) was the length of this comment, so I 
tryed to make a script for that guy which changed the comment, and changed 
the length byte of it too. But It didn't work.
http://www.linux-nantes.org/~fmonnier/tmp/comlen.ml.html

From the specs draft I guess that's because there are offsets before the 
comment, is it right ?
(I haven't found for the xcf comment in this draft, perhaps I have missed it?)

thanks in advence
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] XCF spec

2006-09-02 Thread Simon Budig
Florent Monnier ([EMAIL PROTECTED]) wrote:
> Hi, I'm searching through the CVS web viewer for the XCF specs without success
> http://cvs.gnome.org/viewcvs/gimp/
> could someone tell me in which directory does it resides ?

http://cvs.gnome.org/viewcvs/gimp/devel-docs/xcf.txt?rev=1.2&view=markup

Bye,
 Simon
-- 
  [EMAIL PROTECTED]  http://simon.budig.de/
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] XCF spec

2006-09-01 Thread Florent Monnier
> Hi,
>
> now that the spec is in CVS, someone should review it and fix the places
> where it is wrong with regard to the CVS version of GIMP. Like when it
> states that only the bottom layer may be without an alpha channel.


Hi, I'm searching through the CVS web viewer for the XCF specs without success
http://cvs.gnome.org/viewcvs/gimp/
could someone tell me in which directory does it resides ?

thanks in advance
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] XCF spec

2006-08-31 Thread Sven Neumann
Hi,

now that the spec is in CVS, someone should review it and fix the places
where it is wrong with regard to the CVS version of GIMP. Like when it
states that only the bottom layer may be without an alpha channel.


Sven




___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] XCF spec

2006-08-31 Thread David Neary

Hi,

Sven Neumann wrote:
> On Thu, 2006-08-31 at 20:56 +0200, David Neary wrote:
> 
>> Could we get Henning's XCF spec committed to CVS before any of the
>> freezes for 2.4 come into effect, please? It's a vast improvement over
>> the existing version, and has been improved since his first draft to
>> include a detailed definition of layer modes.
> 
> Didn't you already commit it? I somehow remember that you did. If not,
> please do so.

Nope - I did ask, but you asked that we wait until it was complete.

Cheers,
Dave.

-- 
Dave Neary
[EMAIL PROTECTED]
Lyon, France
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] XCF spec

2006-08-31 Thread Sven Neumann
Hi,

On Thu, 2006-08-31 at 20:56 +0200, David Neary wrote:

> Could we get Henning's XCF spec committed to CVS before any of the
> freezes for 2.4 come into effect, please? It's a vast improvement over
> the existing version, and has been improved since his first draft to
> include a detailed definition of layer modes.

Didn't you already commit it? I somehow remember that you did. If not,
please do so.


Sven


___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] XCF spec

2006-08-31 Thread David Neary

Hi,

Could we get Henning's XCF spec committed to CVS before any of the
freezes for 2.4 come into effect, please? It's a vast improvement over
the existing version, and has been improved since his first draft to
include a detailed definition of layer modes.

Cheers,
Dave.

-- 
Dave Neary
[EMAIL PROTECTED]
Lyon, France
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer