Minor bugs

Cropping should be avoided if the image is the same size also, not just if it is smaller.
I was using a minimum of 2 outputs while testing on my desktop. Revert that to 1.
Remove trailing tabs.
This commit is contained in:
John Mertz 2022-07-23 01:32:23 -04:00
parent 31fc3ceff3
commit 640dd8d2d9
Signed by: jpm
GPG Key ID: E9C5EA2D867501AB
1 changed files with 8 additions and 8 deletions

View File

@ -11,7 +11,7 @@ use AnyEvent::Sway;
our $s = AnyEvent::Sway->new();
our $o = $s->get_outputs->recv();
die "No outputs detected.\n" unless (scalar(@$o) > 1);
die "No outputs detected.\n" unless (scalar(@$o));
sub usage()
{
@ -110,7 +110,7 @@ sub crop
my ($iw, $ih) = $im->Get("columns", "rows");
# Return full size if it is smaller in either dimension then the output
if ($iw < $ow || $ih < $oh) {
if ($iw <= $ow || $ih <= $oh) {
print "Not cropping $image because it is too small\n";
$cropped =~ s#-cropped\.([^\.]+)$#\.$1#;
use File::Copy;