Skip to content

Commit

Permalink
Merge pull request #605 from shutter-project/zero_dimension_selection…
Browse files Browse the repository at this point in the history
…_fix2

Quick and dirty fix for #570
  • Loading branch information
Photon89 committed Jan 6, 2024
2 parents 9c2eccf + 6161838 commit 4f9072c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions bin/shutter
Original file line number Diff line number Diff line change
Expand Up @@ -6314,6 +6314,15 @@ sub STARTUP {
#start postprocessing here

#...successfully???

# $screenshot is undefined if the selection width or height is zero
# Actually this should be handled by Shutter::Screenshot::Error but fails for an area with zero width or height for some reason
unless ($screenshot) {
my $response = $sd->dlg_error_message($d->get("Error: selection width or height is zero, please retry!"), $d->get("Failed"));
fct_control_main_window('show');
return FALSE;
}

my $giofile = undef;
my $error = Shutter::Screenshot::Error->new($sc, $screenshot, $data, $extra);
if ($error->is_error) {
Expand Down Expand Up @@ -7788,13 +7797,6 @@ sub STARTUP {
print "Parsing wildcards for $screenshot_name\n"
if $sc->get_debug;

# $screenshot is undefined if the selection width or height is zero
unless ($screenshot) {
my $response = $sd->dlg_error_message($d->get("Error: selection width or height is zero, please retry!"), $d->get("Failed"));
fct_control_main_window('show');
return FALSE;
}

#parse width and height
my $swidth = $screenshot->get_width;
my $sheight = $screenshot->get_height;
Expand Down

0 comments on commit 4f9072c

Please sign in to comment.