Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 4,789
» Latest member: Ttrevor
» Forum threads: 7,598
» Forum posts: 41,408
Full Statistics
|
Latest Threads |
files missing after insta...
Forum: Older Gimp versions (2.8, 2.6....)
Last Post: denzjos
Yesterday, 03:58 PM
» Replies: 4
» Views: 409
|
Simplifying a path
Forum: Extending the GIMP
Last Post: Infinimitsu
Yesterday, 01:34 PM
» Replies: 39
» Views: 35,197
|
Is there any version wher...
Forum: Older Gimp versions (2.8, 2.6....)
Last Post: HavingTooMuchFun
Yesterday, 08:24 AM
» Replies: 2
» Views: 560
|
.pcd files issue?
Forum: OSX
Last Post: rich2005
Yesterday, 07:49 AM
» Replies: 1
» Views: 247
|
How do I uninstall GIMP 3...
Forum: Linux and other Unixen
Last Post: Ofnuts
09-15-2025, 07:02 AM
» Replies: 1
» Views: 389
|
AI Gimp Plugins
Forum: Watercooler
Last Post: merlilderman
09-14-2025, 04:16 PM
» Replies: 21
» Views: 69,028
|
How to make a watermark o...
Forum: General questions
Last Post: kyolim
09-13-2025, 10:05 PM
» Replies: 5
» Views: 14,530
|
Linux command that does e...
Forum: Other graphics software
Last Post: rich2005
09-13-2025, 06:06 PM
» Replies: 1
» Views: 769
|
reliable Gimp 2.10.38 dow...
Forum: Older Gimp versions (2.8, 2.6....)
Last Post: denzjos
09-13-2025, 05:20 PM
» Replies: 2
» Views: 681
|
Batch Color Saturation
Forum: Extending the GIMP
Last Post: rich2005
09-13-2025, 07:53 AM
» Replies: 15
» Views: 12,377
|
|
|
Troubleshooting Python plugin to load an XCF file |
Posted by: TimorousMe - 03-19-2021, 03:06 AM - Forum: Scripting questions
- Replies (4)
|
 |
In connection with troubleshooting my bigger project (thread here: https://www.gimp-forum.net/Thread-Gimp-P...d-question) I'm trying to create a really simple plugin to open an XCF file in the GUI. Eventually I will make this non-interactive and make it a wrapper to launch my other function, but for now I just want it to open the GUI and use pdb.gimp_xcf_load to open my XCF.
I know definitions are not completely needed, but having them seems to make it easier to call a function from the command line, so I have a definition for now.
The command line opens the Gimp UI, but doesn't open my XCF, and throws some errors. Any idea what I'm doing wrong here in this very simple plugin?
Command line argument:
Code:
gimp --batch-interpreter python-fu-eval -b '(python_fu_open_xcf "/Users/TimB/Desktop/template.xcf")'
Plugin:
Code:
#!/usr/bin/env python
#
# Script to open .XCF file
from gimpfu import *
def open_xcf(file):
try:
# Open XCF file
image = pdb.gimp_xcf_load(file, file)
layer = pdb.gimp_image_get_active_layer(image)
except Exception as err:
gimp.message("Unexpected error: " + str(err))
register(
"python_fu_open_xcf",
"Add image to layer",
"Add image to layer and flatten.",
"TCB",
"TCB",
"2021",
"<Image>/Filters/Tim/Open XCF",
"*",
[
(PF_FILE, "file", "XCF file to open", ""),
],
[],
open_xcf)
main()
Terminal output:
Code:
GIMP is started as MacOS application
2021-03-18 23:02:16.722 gimp[9241:136602] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
Cannot spawn a message bus without a machine-id: Unable to load /var/lib/dbus/machine-id or /etc/machine-id: Failed to open file “/var/lib/dbus/machine-id”: No such file or directory
/Applications/GIMP-2.10.app/Contents/MacOS/gimp: LibGimpBase-WARNING: gimp: gimp_wire_read(): error
gimp_check_updates_callback: loading of https://www.gimp.org/gimp_versions.json failed: Operation not supported
Traceback (most recent call last):
File "/Applications/GIMP-2.10.app/Contents/Resources/lib/gimp/2.0/python/gimpfu.py", line 827, in _run
return apply(func, params[1:])
File "/Applications/GIMP-2.10.app/Contents/Resources/lib/gimp/2.0/plug-ins/python-eval.py", line 25, in code_eval
exec code in globals()
File "<string>", line 1
(python_fu_open_xcf "/Users/TimB/Desktop/template.xcf")
^
SyntaxError: invalid syntax
batch command experienced an execution error
|
|
|
Gimp Python script file load question |
Posted by: TimorousMe - 03-18-2021, 04:17 AM - Forum: Scripting questions
- Replies (10)
|
 |
I have a working Gimp plugin that takes an open XCF, adds a new layer to it, positions the new layer, and then exports a JPG.
However, the plugin only works if I'm in the Gimp UI and the XCF file is already open. I want to run it from the command line and some how call pdb.gimp_xcf_load somewhere top open the XCF, but I can't get the file open or command line to work.
What is the best way to do this? Should I have a wrapper script that opens the XCF and then calls my working script? Or can I both open the XCF and the JPEG in a single plugin? Is there a best practice?
|
|
|
Removing alpha channel |
Posted by: AncientxFreako - 03-15-2021, 10:43 AM - Forum: Extending the GIMP
- Replies (3)
|
 |
I've recently had some issues with GIMP generating alpha channels after editing images when using layers. Upon exporting to .png, the alphas get left in. I'm being told by an ace programmer that this is a ridiculous thing that GIMP should not do. I really, really like GIMP, and would rather continue using it. Is there an update that deals with this without a plugin? And btw, I haven't seen a good plugin that even does decent batch alpha removal.
|
|
|
Wrapping Text Question |
Posted by: Jebby - 03-14-2021, 09:15 PM - Forum: General questions
- Replies (11)
|
 |
For some reason there is no POST THREAD button in GIMP 2.10 section. Therefore I posted here.
I can wrap text around a circle using TEXT ALONG PATH tool. I even know how to make my text taller by turning the text into a path and scaling the path. What I wanna do is take my text, make it taller, then wrap around the circle. After editing the text to make it taller, I cannot seem to figure out how to make the new later wrap around the circle as it is no longer actual text and there is no text to path option.
So how can I make the text taller then wrap on a circle?
|
|
|
|