Python Forum
Super Urgent, work related. Gimp Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Super Urgent, work related. Gimp Python
#1
Hello to all,
I wrote a little script some years ago.
it was beginning like this.



import gimp
import gimpfu
import os, glob
Today,
I add to use it.

And gimp library was not recognized.
As gimpfu.

I checked then
https://ibb.co/7470fNQ

pgimp 1.0.0a22

is the new gimp, may be???

It was crashing with elegance.

https://ibb.co/WpPSVy0

Then,

I have a work to do.

What ever solution you have, other program, other plug in...

Here is the program itself.

I am not a programmer, this is may be horrible to read, but the thing was working perfectly.
import gimp
import gimpfu
import os, glob
brightness = 20
contrast = 20

path = "C:\\test"
outdir = os.path.join(path, "output")
if not os.path.exists(outdir):
    os.mkdir(outdir)
	#de -127 a 127


for jpg in glob.glob(os.path.join(path, "*.HEIC")): #HEIC
	img = pdb.gimp_file_load(jpg, "")
	disp = pdb.gimp_display_new(img)
	
	drawable = pdb.gimp_image_get_active_layer(img)
	pdb.gimp_brightness_contrast(drawable,brightness,contrast)
	jpg=jpg[:-4]+"jpg"
	newjpg = os.path.join(outdir, os.path.basename(jpg))
	pdb.file_jpeg_save(img, img.active_layer, newjpg,".jpg", 1.0, 0.0, 0, 0, "", 2, 1, 0, 2)
	pdb.gimp_display_delete(disp)
Gribouillis write Oct-19-2020, 06:06 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

I fixed for you this time. Please use code tags on future posts.
Reply


Messages In This Thread
Super Urgent, work related. Gimp Python - by tsurubaso - Oct-19-2020, 04:45 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with super() Hoespilaar 2 324 Apr-10-2024, 10:10 AM
Last Post: Hoespilaar
  super() in class akbarza 1 503 Dec-19-2023, 12:55 PM
Last Post: menator01
  Strange problem related to "python service" Pavel_47 1 1,431 Dec-07-2021, 12:52 PM
Last Post: Pavel_47
  Understanding Python super() for classes OmegaRed94 1 1,874 Jun-09-2021, 09:02 AM
Last Post: buran
  I have an problem related to ujson in python dixitaditya248 2 2,708 Apr-12-2021, 08:11 AM
Last Post: bowlofred
  Although this is a talib related Q it's mostly related to python module installing.. Evalias123 4 5,775 Jan-10-2021, 11:39 PM
Last Post: Evalias123
  Super flexibility in python, examples Kakha 10 3,922 Jan-08-2021, 12:40 AM
Last Post: Skaperen
  Need urgent help OneTwo 9 2,984 Nov-24-2020, 08:40 AM
Last Post: OneTwo
  superclass and super() grkiran2011 1 1,771 Jun-20-2020, 04:37 AM
Last Post: deanhystad
  R-PYTHON INTEGRATION RELATED PROBLEM arnab93 0 1,467 Jun-05-2020, 02:07 PM
Last Post: arnab93

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020