alessandrofrancesconi / gimp-plugin-bimp

BIMP. Batch Image Manipulation Plugin for GIMP.
http://www.alessandrofrancesconi.it/projects/bimp
Other
894 stars 93 forks source link

Select none instead of all before calling user specified plugin #313

Closed bbbbbr closed 2 years ago

bbbbbr commented 2 years ago

This PR originates with a ticket opened for my GIMP plugin Pixel Art Scalers: https://github.com/bbbbbr/gimp-plugin-pixel-art-scalers/issues/15

Currently apply_userdef() calls gimp_selection_all() shortly before running the user specified plugin call.

In most cases this is ok, however with my plugin which resizes the image and drawable layer, but does not rescale the image using libgimp calls. My plugin honors selection regions since there are cases where they might want to resize just a subset of the source image.

What this means is that the Select All area selection doesn't grow when the image gets resized, so the upscaled output gets cropped to the original image dimensions. When no selection area is specified then the resized drawable is able to update it's full area.

It's unclear whether there is a specific need for gimp_selection_all() or if gimp_selection_none() would be an acceptable alternative

alessandrofrancesconi commented 2 years ago

The purpose of the call to gimp_selection_all() was to "override" any selection made by previous manipulation steps and force it to operate in the full image. However, I agree in this case it has the same effect of gimp_selection_none(), moreover this last method seems to give wider compatibility between third-party plugins, as you reported.

Ok to merge, then! Thank you.

bbbbbr commented 2 years ago

Thank you!