Re: [Gimp-user] Programmatically modifying text in .xcf files.
John R. Culleton ([EMAIL PROTECTED]) wrote: On Thursday 26 July 2007, mal content wrote: Is there a tool or method available to safely and reliably modify this text (replace it with other text) from the shell, or some other interface that doesn't require me to open 100 or so files in Gimp*? If you are on a Linux or similar platform something along the lines of awk or sed could be possible approaches. You would end up with invalid xcf files. Even if you could replace the text without damaging the file structure your image still would look the same, since even text layers are stored as pixels. The text you find in the xcf file is metainformation that would get used if you'd change the text in the gimp and thus would force gimp to re-render the text layer. So basically the only tool being able to effectively change the text is the Gimp itself. And - as Sven mentioned - since we unfortunately do not have a PDB API for this functionality it is impossible to create a script to let gimp do this. Bye, Simon -- [EMAIL PROTECTED] http://simon.budig.de/ ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Programmatically modifying text in .xcf files.
Hi, On Thu, 2007-07-26 at 19:11 +0100, mal content wrote: I have a large number of xcf files that have a section of text embedded in them. Is there a tool or method available to safely and reliably modify this text (replace it with other text) from the shell, or some other interface that doesn't require me to open 100 or so files in Gimp*? We are still lacking a proper PDB API for text layer and without this you can't do what you are asking for. Hopefully someone will contribute this missing part at some point. Sven ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Programmatically modifying text in .xcf files.
On Thu, 2007-07-26 at 21:03 +0100, mal content wrote: On 26/07/07, John R. Culleton [EMAIL PROTECTED] wrote: Don't know :( I thought you meant a sentence or two. Gimp is not the optimum approach for long text passages IMO. Sounds more like a job for a page layout program or even html. What kind of files are they? Are they intended for online use? Well what it basically is, is a CD cover and booklet. The cover and booklet conform to an image template so that they print the correct size and with correct margins at a given DPI. The covers are being produced for a range of CDs (the layout is the same on each disks but the images are different). The first page of every booklet lists credits and other information and these now have to be changed en masse as the text has been rewritten. I suppose I could export the covers to a page layout program but that would take a lot of work and would complicate our release process quite a bit. I'm not averse to the idea of writing a program to make these transformations in C, but I'm not aware of the existence of a 'libxcf' or equivalent to access the file format and I really don't want to have to do my own parsing! cheers, MC You should check out Swiss File Knife. It's a sed-like program that works on binaries as well as text. Just be sure to back up your original data. http://sourceforge.net/projects/swissfileknife ~B ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Programmatically modifying text in .xcf files.
On 26/07/07, John R. Culleton [EMAIL PROTECTED] wrote: If you are on a Linux or similar platform something along the lines of awk or sed could be possible approaches. I quote from an old manual: The advantages of sed are that it can apply the same editing comands to many files; it can edit a large file quickly; and it can readily be used with pipes. Yes, the thing I was worried about though is damaging the binary files. The text I wish to replace the original text with is about twice the length of the original. Is the xcf file format flexible enough to really allow editing in this way? thanks, MC ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Programmatically modifying text in .xcf files.
On Thursday 26 July 2007, mal content wrote: Hello. I have a large number of xcf files that have a section of text embedded in them. Is there a tool or method available to safely and reliably modify this text (replace it with other text) from the shell, or some other interface that doesn't require me to open 100 or so files in Gimp*? I'd ideally like to be able to do something along the lines of: $ for f in *.xcf; do xcf_text_replace $layer_num file.txt; done thanks, MC * they are huge files, I doubt my hardware could cope. ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user _ Need personalized email and website? Look no further. It's easy with Doteasy $0 Web Hosting! Learn more at www.doteasy.com If you are on a Linux or similar platform something along the lines of awk or sed could be possible approaches. I quote from an old manual: The advantages of sed are that it can apply the same editing comands to many files; it can edit a large file quickly; and it can readily be used with pipes. -- John Culleton Able Indexing and Typesetting Precision typesetting (tm) at reasonable cost. Satisfaction guaranteed. http://wexfordpress.com ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Programmatically modifying text in .xcf files.
On Thursday 26 July 2007, mal content wrote: On 26/07/07, John R. Culleton [EMAIL PROTECTED] wrote: Don't know :( I thought you meant a sentence or two. Gimp is not the optimum approach for long text passages IMO. Sounds more like a job for a page layout program or even html. What kind of files are they? Are they intended for online use? Well what it basically is, is a CD cover and booklet. The cover and booklet conform to an image template so that they print the correct size and with correct margins at a given DPI. I suggest that the cover art is a good Gimp application but the booklets aren't. An application such as TeX (e.g, Context) could prepare those pages. If art work or backgrounds etc. were needed they could be prepared via Gimp or a drawing program and incorporated as needed on the pages. But gimp would not be used to create the final image to go to the printer. That way you would have the flexibiilty to substitute text in a batch editor program like sed and have the pages adjust automatically. Margins are easily controlled in a layout program and dpi is not really a factor with text. I am afraid that you may have painted yourself into a corner by using gimp as a page layout program. That is not its strength. If you send me a sample of one of the bookets I will see what I can do with a conversion program. -- John Culleton ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Programmatically modifying text in .xcf files.
On 26/07/07, John R. Culleton [EMAIL PROTECTED] wrote: Don't know :( I thought you meant a sentence or two. Gimp is not the optimum approach for long text passages IMO. Sounds more like a job for a page layout program or even html. What kind of files are they? Are they intended for online use? Well what it basically is, is a CD cover and booklet. The cover and booklet conform to an image template so that they print the correct size and with correct margins at a given DPI. The covers are being produced for a range of CDs (the layout is the same on each disks but the images are different). The first page of every booklet lists credits and other information and these now have to be changed en masse as the text has been rewritten. I suppose I could export the covers to a page layout program but that would take a lot of work and would complicate our release process quite a bit. I'm not averse to the idea of writing a program to make these transformations in C, but I'm not aware of the existence of a 'libxcf' or equivalent to access the file format and I really don't want to have to do my own parsing! cheers, MC ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Programmatically modifying text in .xcf files.
On Thursday 26 July 2007, mal content wrote: On 26/07/07, John R. Culleton [EMAIL PROTECTED] wrote: If you are on a Linux or similar platform something along the lines of awk or sed could be possible approaches. I quote from an old manual: The advantages of sed are that it can apply the same editing comands to many files; it can edit a large file quickly; and it can readily be used with pipes. Yes, the thing I was worried about though is damaging the binary files. The text I wish to replace the original text with is about twice the length of the original. Is the xcf file format flexible enough to really allow editing in this way? thanks, MC Don't know :( I thought you meant a sentence or two. Gimp is not the optimum approach for long text passages IMO. Sounds more like a job for a page layout program or even html. What kind of files are they? Are they intended for online use? -- John Culleton ATTN Publishers/authors: If you don't read you don't succeed. Free short list of publishing/marketing books. http://wexfordpress.com/tex/shortlist.pdf ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user