Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Gimp 2.99.14 #54

Open
wants to merge 1 commit into
base: GIMP3-ML
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gimpml/plugins/canny/canny.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def canny(
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("Canny Edge")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -235,11 +235,11 @@ class Canny(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["canny"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "canny":
Expand Down
10 changes: 5 additions & 5 deletions gimpml/plugins/coloring/coloring.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def coloring(procedure, image, n_drawables, drawables, force_cpu, progress_bar,
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("Coloring")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -222,7 +222,7 @@ def run(procedure, run_mode, image, n_drawables, layer, args, data):
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(image_paths["colorpalette"]),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image_new)
copy.set_name("Color Palette")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -250,11 +250,11 @@ class Coloring(Gimp.PlugIn):

# GimpPlugIn virtual methods #
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["coloring"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "coloring":
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/colorpalette/colorpalette.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def colorpalette(procedure, run_mode, image, n_drawables, drawable, args, data):
)
),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image_new)
copy.set_name("Color Palette")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand All @@ -44,11 +44,11 @@ class ColorPalette(Gimp.PlugIn):
__gproperties__ = {}

def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["colorpalette"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = Gimp.ImageProcedure.new(
self, name, Gimp.PDBProcType.PLUGIN, colorpalette, None
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/deblur/deblur.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def deblur(procedure, image, drawable, force_cpu, progress_bar, config_path_outp
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("Deblur")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -202,11 +202,11 @@ class Deblur(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["deblur"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "deblur":
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/dehaze/dehaze.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def dehaze(procedure, image, drawable, force_cpu, progress_bar, config_path_outp
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("Dehaze")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -201,11 +201,11 @@ class Dehaze(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["dehaze"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "dehaze":
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/denoise/denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def denoise(procedure, image, drawable, force_cpu, progress_bar, config_path_out
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("Denoise")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -199,11 +199,11 @@ class Denoise(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["denoise"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "denoise":
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/detectobjects/detectobjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def detectobjects(procedure, image, drawable, force_cpu, progress_bar, config_pa
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("Objects detected.")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -193,11 +193,11 @@ class DetectObjects(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["detectobjects"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "detectobjects":
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/enlighten/enlighten.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def enlighten(procedure, image, drawable, force_cpu, progress_bar, config_path_o
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("Enlightened")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -200,11 +200,11 @@ class Enlighten(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["enlighten"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "enlighten":
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/faceparse/faceparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def faceparse(procedure, image, drawable, force_cpu, progress_bar, config_path_o
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("Face Parse")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -201,11 +201,11 @@ class FaceParse(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["faceparse"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "faceparse":
Expand Down
6 changes: 3 additions & 3 deletions gimpml/plugins/filterfolder/filterfolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ def run_mode(self, runmode):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["filterfolder"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "filterfolder":
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/inpainting/inpainting.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def inpainting(
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("In Painting")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -305,11 +305,11 @@ class InPainting(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["inpainting"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "inpainting":
Expand Down
6 changes: 3 additions & 3 deletions gimpml/plugins/interpolation/interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@ class Interpolation(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["interpolation"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "interpolation":
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/kmeans/kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def k_means(
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("K Means")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -232,11 +232,11 @@ class Kmeans(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["kmeans"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "kmeans":
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/matting/matting.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def matting(
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("Matting")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -220,11 +220,11 @@ class Matting(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["matting"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "matting":
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/monodepth/monodepth.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def monodepth(procedure, image, drawable, force_cpu, progress_bar, config_path_o
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("Mono Depth")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -201,11 +201,11 @@ class MonoDepth(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["monodepth"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "monodepth":
Expand Down
8 changes: 4 additions & 4 deletions gimpml/plugins/semseg/semseg.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def semseg(procedure, image, drawable, force_cpu, progress_bar, config_path_outp
Gimp.RunMode.NONINTERACTIVE,
Gio.file_new_for_path(os.path.join(weight_path, "..", "cache.png")),
)
result_layer = result.get_active_layer()
result_layer = result.list_layers()[0]
copy = Gimp.Layer.new_from_drawable(result_layer, image)
copy.set_name("Semantic Segmentation")
copy.set_mode(Gimp.LayerMode.NORMAL_LEGACY) # DIFFERENCE_LEGACY
Expand Down Expand Up @@ -200,11 +200,11 @@ class SemSeg(Gimp.PlugIn):

## GimpPlugIn virtual methods ##
def do_query_procedures(self):
self.set_translation_domain(
"gimp30-python", Gio.file_new_for_path(Gimp.locale_directory())
)
return ["semseg"]

def do_set_i18n(self, procname):
return True, "gimp30-python", None

def do_create_procedure(self, name):
procedure = None
if name == "semseg":
Expand Down
Loading