It is currently Thu Jul 04, 2024 3:29 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Error: ( : 1) atom->string: needs 1 argument(s) [solved]
PostPosted: Wed May 09, 2018 4:13 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Sep 27, 2016
Posts: 345
Location: Germany, BW
I'm trying to make a calendar script work in GIMP 2.10
Have already replaced occurence of NORMAL-MODE with LAYER-MODE_NORMAL-LEGACY
and BACKGROUND-FILL with FILL-BACKGROUND

Now when I run Filters/Render/Calendar... it gives me following error:
Error: ( : 1) atom->string: needs 1 argument(s)

I have no idea what it wants to tell me by that ... what to change where.
Is there anyone around who can help?

I attach the original script [sg-calendar.scm] ( working in GIMP 2.8.x) and my trial to make it work in 2.10
as far as I have it now [sg-calendar210.scm].

Any help very appreciated
nelo


Last edited by nelo on Mon May 21, 2018 9:08 am, edited 1 time in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Wed May 09, 2018 4:41 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Tried both versions.

I don't get that error, but a different one:

Error: Procedure execution of gimp-image-lower-layer failed: Layer cannot be lowered more.

This only when trying to create a full year.
When trying to create one single month, it runs.

_________________
"Where am I ?"


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Wed May 09, 2018 5:59 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Nov 04, 2015
Posts: 1365
This is the same error I get when running 'Wills Animation Merge' script in Gimp 2.10. The script works in Gimp 2.88.
Maybe there are other scripts throwing this error message?
I would be very interested in a solution.
Obviously Gimp 2.10 is processing scheme differently :seeya


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Wed May 09, 2018 12:28 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Sep 27, 2016
Posts: 345
Location: Germany, BW
It seems to work on a Windows 7 32 bit version but it produces above mentioned error on my Linux 64 bit system. If only I knew how to find the position in the script that causes this.

_________________
Regards
nelo

(Gimp 2.10 on Linux Mint MATE 20.1)


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Wed May 09, 2018 3:12 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
nelo wrote:
It seems to work on a Windows 7 32 bit version but it produces above mentioned error on my Linux 64 bit system. If only I knew how to find the position in the script that causes this.


Sprinkle the code with calls to gimp-message and see which one prints last, then by dichotomy you'll quickly find out.

_________________
Image


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Wed May 09, 2018 4:04 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Dec 26, 2014
Posts: 199
These scripts wouldn't work for me using gimp 2.8.22 on windows 10 64bit until I replaced the text shown below with numbers

I replaced
LAYER-MODE-NORMAL-LEGACY with the number 0
FILL-BACKGROUND with the number 1
FILL-TRANSPARENT with the number 3

edit there are two FILL-BACKGROUND to replace


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Thu May 10, 2018 12:32 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Sep 27, 2016
Posts: 345
Location: Germany, BW
Hello Steve,
thanks for your reply.
Tried that version, too. But didn't make a difference

Hello Ofnuts,
Thanks for pointing me to the gim-message stuff which I didn#t know before. I'm sure it'll help me locate errors.

_________________
Regards
nelo

(Gimp 2.10 on Linux Mint MATE 20.1)


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Sat May 12, 2018 4:46 am  (#8) 
Offline
GimpChat Member

Joined: Jan 03, 2014
Posts: 97
nelo wrote:
It seems to work on a Windows 7 32 bit version but it produces above mentioned error on my Linux 64 bit system. If only I knew how to find the position in the script that causes this.

If you write it in Python, and you start Gimp from the Terminal, you get row numbers where the error occurs via stderr (probably); at least in the Gimp version I use (2.6-ish). That doesn't happen with the Scheme interpreter?
(Personally, I refuse to have anything to do with Scheme code, so I wouldn't know.)
Example (I temporarily destroyed my working code):
qruqs@maytay ~/Downloads $ gimp
  File "/home/qruqs/.gimp-2.6/plug-ins/qjpgArtifacts.py", line 59
    pdb.gimp_selection_layer_alpha(grid lyr)
                                          ^
SyntaxError: invalid syntax


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Sun May 13, 2018 4:18 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Sep 27, 2016
Posts: 345
Location: Germany, BW
Thanks for your reply.
No the Scheme interpreter doesn't do this. There is a message window in GIMP if errors occur.
Normally if you have for example NORMAL-MODE instead of LAYER-MODE-NORMAL-LEGACY (which is to be used in GIMP 2.10) it tells you about NORMAL-MODE ... so I can check the code, search which procedure goes with it, check the procedure-browser how to do it and so on. But with mentioned error message ? There's no "atom", no "string" in the code and I don't know enough SCHEME to see the error.
I might have found the place where things go wrong ( using gimp-message to narrow it down). Now I have to learn why and how to correct.

_________________
Regards
nelo

(Gimp 2.10 on Linux Mint MATE 20.1)


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Sun May 13, 2018 5:31 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Aug 08, 2016
Posts: 2062
Location: East Midlands of England
I encountered this error from within a python script a good while ago - I cannot really remember what on earth it was - but it was a pain to track down. And yes I used gimp_message to narrow down the possibilities. Best of luck.

_________________
Image

"Let no one steal your dreams."
Paul Cookson


Latest plug-in update: Paragrapher v.1.4
Custom Font Links
Tools
Character Paths
White Bases


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Sun May 13, 2018 7:13 am  (#11) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
Qruqs wrote:
nelo wrote:
It seems to work on a Windows 7 32 bit version but it produces above mentioned error on my Linux 64 bit system. If only I knew how to find the position in the script that causes this.

If you write it in Python, and you start Gimp from the Terminal, you get row numbers where the error occurs via stderr (probably); at least in the Gimp version I use (2.6-ish). That doesn't happen with the Scheme interpreter?
(Personally, I refuse to have anything to do with Scheme code, so I wouldn't know.)
Example (I temporarily destroyed my working code):
qruqs@maytay ~/Downloads $ gimp
  File "/home/qruqs/.gimp-2.6/plug-ins/qjpgArtifacts.py", line 59
    pdb.gimp_selection_layer_alpha(grid lyr)
                                          ^
SyntaxError: invalid syntax


When I find buggy scheme scripts I find it faster to rewrite them in Python :)

_________________
Image


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Sun May 13, 2018 7:16 am  (#12) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
nelo wrote:
There's no "atom", no "string" in the code and I don't know enough SCHEME to see the error.


About everything is an atom in Scheme (except lists). Here the error would be some implicit conversion of an atom to a string, but since it's implicit it will be hard to find (especially since the atom isn't a string... :evilgrin )

_________________
Image


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Mon May 14, 2018 6:02 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: Nov 04, 2015
Posts: 1365
Here are 3 steps to troubleshoot old scripts in Gimp 2.10.

Open Gimp 2.10 Edit > Preferences > Debugging > change debug policy to 'debug warnings, critical errors and crashes > click OK.
Close Gimp.

open command prompt.
gimp --pdb-compat-mode=off --verbose
(Windows needs the full path to Gimp)

If your script works on layers then open a mutilayer test image(s) and change the little box in 'Layers -Patterns' to the right of 'mode'. Change to 'Legacy'.
Hopefully you will get more info on whats failing.
Image


Last edited by Tas_mania on Thu May 24, 2018 6:07 pm, edited 1 time in total.

Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Mon May 14, 2018 8:36 am  (#14) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
nelo wrote:
There's no "atom", no "string" in the code and I don't know enough SCHEME to see the error.
I might have found the place where things go wrong ( using gimp-message to narrow it down). Now I have to learn why and how to correct.


I find 5 instances of the function number->string in your modified version of the code.

In the file GIMP 2.10\share\gimp\2.0\scripts\script-fu.init you will find the definition of number->string, which uses atom->string:
(define (number->string n . base)
    (atom->string n (if (null? base) 10 (car base))))


I am very puzzled how you can manage to get the error reported because I don't see a way for the script to have called atom->string without anything as an argument.


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Mon May 14, 2018 9:14 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: Sep 27, 2016
Posts: 345
Location: Germany, BW
@Tas_mania
Thanks fo the tip on debugging. I'll try that out.

@paynekj
I don't know what's missing there, what it's complaining about. Why it reports to me and not to others. Also I don't understand why the original code works on a windows 7 install of GIMP 2.10 and not on my Linux flatpak installation. Hopefully I'll find out. Otherwise I'll have to keep GIMP 2.8 just do make next year's calendar towards the end of the year.

Just to be sure I didn't break anything I'll start modifying from the beginning ... with all that debug stuff enabled. I'll see how far I get, what errors occur.

_________________
Regards
nelo

(Gimp 2.10 on Linux Mint MATE 20.1)


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Mon May 14, 2018 11:21 am  (#16) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Here's something else to try to check the building-blocks are in place.

Start the Script-fu console Filters>>Script-Fu>>Console

In the command line:
(tracing TRUE)
(number->string 5)

I get this, do you?
> (tracing TRUE)

Gives: 0
> (number->string 5)

Eval: (number->string 5)
Eval: number->string
Eval: 5
Apply to: (5)
Eval: (atom->string n (if (null? base) 10 (car base)))
Eval: atom->string
Eval: n
Eval: (if (null? base) 10 (car base))
Eval: (null? base)
Eval: null?
Eval: base
Apply to: (())
Eval: 10
Apply to: (5 10)
Gives: "5"


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Mon May 14, 2018 12:24 pm  (#17) 
Offline
GimpChat Member

Joined: Jan 03, 2014
Posts: 97
nelo wrote:
No the Scheme interpreter doesn't do this.

Pity. Perhaps use diff?
I get this:
$ diff -ytiw --width=120 --suppress-common-lines sg-calendar.scm sg-calendar210.scm > sg.res.txt


                                             100 NORMAL-MO |                                               100 LAYER-MOD
      (gimp-drawable-fill frame-layer TRANSPARENT-FILL)    |        (gimp-drawable-fill frame-layer FILL-TRANSPARENT)
      (gimp-edit-fill frame-layer BACKGROUND-FILL)         |        (gimp-edit-fill frame-layer FILL-BACKGROUND)
      (gimp-edit-fill  frame-layer BACKGROUND-FILL)        |        (gimp-edit-fill  frame-layer FILL-BACKGROUND)
  SF-ADJUSTMENT "Year" '( 2018 1753 2050 1 10 0 1 )        |    SF-ADJUSTMENT "Year" '( 2019 1753 2050 1 10 0 1 )
  SF-ADJUSTMENT "Year" '( 2017 1753 2050 1 10 0 1 )        |    SF-ADJUSTMENT "Year" '( 2019 1753 2050 1 10 0 1 )

Unless diff hides a character, or it should be like it is typed, MO is not equal to MOD, correct?


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Mon May 14, 2018 2:27 pm  (#18) 
Offline
GimpChat Member
User avatar

Joined: Sep 27, 2016
Posts: 345
Location: Germany, BW
So I guess this one is one of the culprits:
(date-str (number->string date))

comparing the script-fu.init files of both GIMP versions I find.
GIMP 2.8:
(define (number->string n) (anyatom->string n number?))
GIMP 2.10:
(define (number->string n . base)

so far so good.
How would I have to change that line? Please help ... :cry

and here is the output of script-fu TRACE:
Willkommen bei TinyScheme
Copyright (c) Dimitrios Souflis
Skript-Fu-Konsole - Interaktive Scheme-Entwicklung

> (tracing TRUE)

Gives: 0
> (number->string 5)

Eval: (number->string 5)
Eval: number->string
Eval: 5
Apply to: (5)
Eval: (atom->string n (if (null? base) 10 (car base)))
Eval: atom->string
Eval: n
Eval: (if (null? base) 10 (car base))
Eval: (null? base)
Eval: null?
Eval: base
Apply to: (())
Eval: 10
Apply to: (5 10)
Eval: (#<CLOSURE> "( : 1) atom->string: needs 1 argument(s)")
Eval: #<CLOSURE>
Eval: "( : 1) atom->string: needs 1 argument(s)"
Apply to: ("( : 1) atom->string: needs 1 argument(s)")
Eval: (if (more-handlers?) (apply (pop-handler)) (apply error x))
Eval: (more-handlers?)
Eval: more-handlers?
Apply to: ()
Eval: (pair? *handlers*)
Eval: pair?
Eval: *handlers*
Apply to: (())
Eval: (apply error x)
Eval: apply
Eval: error
Eval: x
Apply to: (#<error PROCEDURE 134> ("( : 1) atom->string: needs 1 argument(s)"))
Apply to: ("( : 1) atom->string: needs 1 argument(s)")Error: ( : 1) atom->string: needs 1 argument(s)

_________________
Regards
nelo

(Gimp 2.10 on Linux Mint MATE 20.1)


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Mon May 14, 2018 4:13 pm  (#19) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Something else to try in the script-fu console
> (atom->string 5)
"5"
> (atom->string 5 2)
"101"

If it doesn't work with the 2nd test, then it looks like your version of GIMP has been built differently and it's time to start questioning the developers.

Full disclaimer. I'm trying this with GIMP-2.10-RC1 as I haven't been brave enough to install full 2.10 yet (too much trouble to keep the older versions intact)

It would be helpful if others could try the same test, stating which GIMP version and operating system.


Top
 Post subject: Re: Error: ( : 1) atom->string: needs 1 argument(s)
PostPosted: Mon May 14, 2018 5:23 pm  (#20) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
paynekj wrote:
Something else to try in the script-fu console
> (atom->string 5)
"5"
> (atom->string 5 2)
"101"

If it doesn't work with the 2nd test, then it looks like your version of GIMP has been built differently and it's time to start questioning the developers.

Full disclaimer. I'm trying this with GIMP-2.10-RC1 as I haven't been brave enough to install full 2.10 yet (too much trouble to keep the older versions intact)

It would be helpful if others could try the same test, stating which GIMP version and operating system.


Same as yours in my 2.10 flatpak on 'buntu 16.04.

_________________
Image


Top
Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Columbine String Art.

6

No new posts Attachment(s) String Art Plug-in

26

No new posts Attachment(s) String Trussed Dalia

5

No new posts Attachment(s) Free – Selection Tool – Stopping the String

4

No new posts Attachment(s) GEGL calls GMIC, REMBG, AIs or any bash string with our bash plugin

87



* Login  



Powered by phpBB3 © phpBB Group