-
Notifications
You must be signed in to change notification settings - Fork 163
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
update resynthesizer heal selection plugin to work with recent 2.99 release #136
base: deprecations
Are you sure you want to change the base?
Conversation
This probably wont work with 3.0 RC as is; Im still trying to figure out why the gobject code is failing to compile. |
13ab76a
to
4eab981
Compare
I've managed to get the plugin working with the latest 3.0 build on my machine, could anybody try compiling it to verify? |
I'll probably use this PR as a springboard to fix up the rest of the python plugins as well. |
I can't build it with gimp 3.0.0-RC1+git:
|
I did encounter something similar before. Can you check the values of the gimp major and minor versions? I added a few checks that section off the ui and gimp 2 related code but maybe I missed some parts. |
Oh, oops. I didn't commit certain changes. Fastforward and try again please! |
It compiles, but the installation seems wrong. GIMP 3 says plugins should be put in subdirectories inside the plugin-ins directory. It turns out the subdirectory name needs to match the filename too. And then, a lot of The "heal selection" plugin loads, but when I run it on a selection near the right border, an error complaining that There are also error messages that look like memory correuption, e.g.
|
Yeah, the cropping code isnt fully fixed yet. Also, I've only updated the heal selection script at the moment which is why youre seeing the gimpfu errors. Im still not sure whats causing the weird property bug though, thatll take a little time to debug |
I am following along. Ping me more directly (somehow?) if needed. Thanks |
If you need help debugging the plugin, see the gimp dev website https://developer.gimp.org/resource/debug-plug-ins/ which is a work in progress, might be wrong or hard to follow. Also, if you
it should crash at that CRITICAL message, and might give you a stack trace. If you have started the plugin in gdb per the website, it should stop in gdb and then >bt gives you the backtrace. Need a backtrace. It could be that the engine plugin has a bug that corrupts memory. |
sounds like the way to go. I think the property problem is likely because I forgot to specify the procedure API correctly. The engine is working exactly as intended, I just need to fix the frontend. Also, note that the current version of the plugin does not in any way attempt to retain the behaviour of the v2 plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also:
- the indentations are all over the place.
- function/method names both have and don't have a space before the opening parenthesis.
frisketLowerLeftX = frisketBounds[0] | ||
frisketLowerLeftY = frisketBounds[1] | ||
frisketUpperRightX = frisketBounds[2] | ||
frisketUpperRightY = frisketBounds[3] | ||
|
||
targetLowerLeftX = target_bounds[0] | ||
targetLowerLeftY = target_bounds[1] | ||
targetUpperRightX = target_bounds[2] | ||
targetUpperRightY = target_bounds[3] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frisketLowerLeftX = frisketBounds[0] | |
frisketLowerLeftY = frisketBounds[1] | |
frisketUpperRightX = frisketBounds[2] | |
frisketUpperRightY = frisketBounds[3] | |
targetLowerLeftX = target_bounds[0] | |
targetLowerLeftY = target_bounds[1] | |
targetUpperRightX = target_bounds[2] | |
targetUpperRightY = target_bounds[3] | |
frisketLowerLeftX, frisketLowerLeftY, frisketUpperRightX, frisketUpperRightY = frisketBounds | |
targetLowerLeftX, targetLowerLeftY, targetUpperRightX, targetUpperRightY = target_bounds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used a different method to extract the coords now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nothing sticks out as wrong, but that ain't a guarantee.
@lilydjwg can you try using the heal selection plugin with the new changes? You'll need to recompile. |
I see no issues except an error message saying |
??? Is that correct? Just reading the code, it seems that it retains most of the behaviour, except regarding which selected layers are healed. Re multi-layer select. Since that feature was added to GIMP 3, most plugins need to choose a strategy. I think that indeed the heal plugin should only heal one layer. I think it should warn if more layers are passed, saying something like "Will only heal the first selected layer." But also, if many layers are passed, maybe the heal plugin should use as corpus: the flattened set of passed layers, in a copy. Because the user may expect to heal as it is visible, and the multiple layers may have a different visual appearance, due to transparency, and even compositing modes? Some plugins might choose a strategy: iteratively operate on all passed layers. I haven't given this enough thought, what would it mean to iteratively heal many layers, from which corpuses? While you are at it, could you please change the attribution of the plugin, from James Henstridge to Paul Harrison? |
Also, I see you have touched resynthesizer-gui.c. That is fine, if just to get it to compile. But I think it needs a major rewrite OR replace with a Python or ScriptFu plugin. The C is in Gtk2 and probably needs much work to get to Gtk 3 (and then to Gtk 4 eventually.) But it is really just a GUI front end to the engine, and could be replaced by a plugin in a higher level language. (Possibly with minor loss of user-friendliness.) Which is the plan, see the roadmap. I can't remember whether I already have a prototype in Python or Scheme. |
Ah, not any more, I think. But I'm still not sure what being considered "active" entails. Maybe I should include a switch for "merge all visible layers before healing".
This was just to add in version guards, simce all that code is meant to work only with gimp 2.
Will do. Its just waht happens when you copy paste plugin code, I guess. |
sooo, awesome! But how do i try it out? Would love to finally abandon gimp 2.10 |
It'll take a bit of work (and time), especially on windows. I can try making a windows build at some point, but I have been a bit busy, so it's difficult to say when I can truly do it. If you'd like to try compilimg it yourself, I believe ypu will need to use mingw and something like git bash to do so. |
Reminding just in case: as of Win10 you don't need to buy (or even crack) the OS anymore if you'll just use it for app dev, as the only restrictions will be the personalization options such as the wallpaper. |
I have win10 ready on a vm, I just haven't set up the dev env. |
This PR updates the resynthesizer plugin to work with recent gimp 2.99 versions.