diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 8bc4b729a05..3bbb47daa4f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -337,6 +337,10 @@ changes (where available). - Fixed a crash on using tag floating window after editing metadata. +- Fixed rotate and perspective sometimes not applying its automatic + crop when the rotation was changed (e.g. with a shortcut) before the + module had been enabled, leaving empty corners in the image. + ## Lua ### API Version diff --git a/src/iop/ashift.c b/src/iop/ashift.c index b366762055a..bb7526398c6 100644 --- a/src/iop/ashift.c +++ b/src/iop/ashift.c @@ -5561,6 +5561,17 @@ static void _event_process_after_preview_callback(gpointer instance, dt_iop_modu switch(jobcode) { case ASHIFT_JOBCODE_DO_CROP: + // the signal can come from a preview run that started before the + // module was enabled and so never filled g->buf; do_crop() would + // return without cropping, so keep the request for the next run + dt_iop_gui_enter_critical_section(self); + const gboolean buf_empty = g->buf_width == 0 || g->buf_height == 0; + dt_iop_gui_leave_critical_section(self); + if(buf_empty) + { + g->jobcode = ASHIFT_JOBCODE_DO_CROP; + break; + } do_crop(self, p); _commit_crop_box(p, g); // save all that