RSS/Atom feed Twitter
Site is read-only, email is disabled

Writing values to a file from within GIMP

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

Writing values to a file from within GIMP David Feinzeig 27 Jul 21:06
  Writing values to a file from within GIMP David Gowers 28 Jul 02:11
  Writing values to a file from within GIMP saulgoode@flashingtwelve.brickfilms.com 28 Jul 09:43
  Writing values to a file from within GIMP ReginaLeo 30 Apr 19:30
  Writing values to a file from within GIMP JackSoprano 30 Apr 19:31
David Feinzeig
2007-07-27 21:06:46 UTC (over 16 years ago)

Writing values to a file from within GIMP

Hi,

I'm writing a script-fu GIMP plugin and I need to be able to write some decimal values to a file during the execution of the script. I've seen some people suggesting that use of fprintf, etc., but can't figure out how to get this to work. Can someone please provide some guidance?

Thanks! Dave

David Gowers
2007-07-28 02:11:48 UTC (over 16 years ago)

Writing values to a file from within GIMP

On 7/28/07, David Feinzeig wrote:

Hi,

I'm writing a script-fu GIMP plugin and I need to be able to write some decimal values to a file during the execution of the script. I've seen some people suggesting that use of fprintf, etc., but can't figure out how to get this to work. Can someone please provide some guidance?

Thanks! Dave

Hi,

fprintf() is a C function, and because it does I/O, it's unlikely to be exposed to Script-Fu. Script-Fu cannot, for instance, delete files, so I would expect it cannot directly create files either (only save images using gimp-file-save.). I recommend you look up a reference for the Script-Fu API. plug-ins/script-fu/tinyscheme/Manual.txt is the one you probably want. It looks like Script-fu actually does support I/O. (that file is in the SVN repository; it might also be in a distribution tarball (eg. gimp-2.3.19.tar.bz2)

saulgoode@flashingtwelve.brickfilms.com
2007-07-28 09:43:12 UTC (over 16 years ago)

Writing values to a file from within GIMP

Hi,

I'm writing a script-fu GIMP plugin and I need to be able to write some decimal values to a file during the execution of the script. I've seen some
people suggesting that use of fprintf, etc., but can't figure out how to get
this to work. Can someone please provide some guidance?

If you are using GIMP 2.3.14 or later, the following code should demonstrate how to write to a file:

(define outport (open-output-file "samplefile.txt")) (display "Hello" outport)
(newline outport)
(display "World" outport)
(close-output-port outport)

If you are using a stable version (2.2.x) of the GIMP, then you will need to use SIOD's 'fopen', 'fwrite', and 'fclose' functions.

(define outfile (fopen "samplefile.txt" "w")) (fwrite "Hello" outfile)
(fwrite "\n" outfile)
(fwrite "World" outfile)
(fclose outfile)

2021-04-30 19:30:42 UTC (almost 3 years ago)
postings
6

Writing values to a file from within GIMP

Thanks!

2021-04-30 19:31:08 UTC (almost 3 years ago)
postings
9

Writing values to a file from within GIMP

When I try to write something in a file, I get a similar error. But soon I will have to write an important student paper, so I am looking for a reliable writing service. A friend of mine recommends this one - https://supremedissertations.com/ and says that he ordered student papers from them several times. I think this is a reasonable decision in this situation.