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
#2
When you tried to install pgimp, it looks like the pip in your PATH is from an installation of python2, but pgimp requires python3.

You would need to be using pip from a python3 installation to install pgimp.
Reply
#3
(Oct-19-2020, 05:57 AM)bowlofred Wrote: When you tried to install pgimp, it looks like the pip in your PATH is from an installation of python2, but pgimp requires python3.

You would need to be using pip from a python3 installation to install pgimp.

Hello,
thanks for your answer,
Also thanks for Gribouillis.

https://ibb.co/R7PJPCL

I have Python 3.

mmmm...

I don't understand.
buran write Oct-19-2020, 07:04 AM:
Please, don't post images of code, error, output, etc. Copy/paste as text and use proper tags.
Reply
#4
You can test. Run pip -V and see what the output is. It should show you the full path of the location it's running from.

If you have both 2 and 3 installed, try running instead pip3 -V. If that shows a version installed, you can use it to install your package.
Reply
#5
(Oct-19-2020, 06:50 AM)bowlofred Wrote: You can test. Run pip -V and see what the output is. It should show you the full path of the location it's running from.

If you have both 2 and 3 installed, try running instead pip3 -V. If that shows a version installed, you can use it to install your package.

Hello bowlofred, I just upgraded pip.

I will do that and report pictures.

I will Edit.

Edit: Why on earth my computer go search my pip on my Blender installation.

https://ibb.co/QrYnynz

ahhhhh!! I erase Blender, this Python with it.

User has been warned for this post. Reason: posting images of code
Reply
#6
Understood,
No more pictures of code.

I was so panicking.

Sorry for the Admin.

Ok, problem solved.

Shame on me.

Gimp Have its own python included, like blender.

My IDE was sending error message because it have no connection with this Python version.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Understanding Python super() for classes OmegaRed94 1 393 Jun-09-2021, 09:02 AM
Last Post: buran
  I have an problem related to ujson in python dixitaditya248 2 647 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 1,763 Jan-10-2021, 11:39 PM
Last Post: Evalias123
  Super flexibility in python, examples Kakha 10 1,155 Jan-08-2021, 12:40 AM
Last Post: Skaperen
  Need urgent help OneTwo 9 851 Nov-24-2020, 08:40 AM
Last Post: OneTwo
  superclass and super() grkiran2011 1 661 Jun-20-2020, 04:37 AM
Last Post: deanhystad
  R-PYTHON INTEGRATION RELATED PROBLEM arnab93 0 599 Jun-05-2020, 02:07 PM
Last Post: arnab93
  Annualised returns in python. Urgent request shivamdang 2 872 Apr-12-2020, 07:37 AM
Last Post: shivamdang
  MRO About super() catlessness 1 877 Jan-12-2020, 07:54 AM
Last Post: Gribouillis
  Need help urgent fireablade 1 640 Oct-01-2019, 05:30 PM
Last Post: buran

Forum Jump:

User Panel Messages

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