gbranden pushed a commit to branch master in repository groff. commit 5697e5c805ccab05beb4721eb410a75854e73ccf Author: G. Branden Robinson <g.branden.robin...@gmail.com> AuthorDate: Sat Jun 14 10:36:50 2025 -0500
[gropdf]: Trivially refactor. * src/devices/gropdf/gropdf.pl (do_x): Trivially refactor. Rename scalar `FDnm` to `fileName`. --- ChangeLog | 5 +++++ src/devices/gropdf/gropdf.pl | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 251c70d89..de39db4e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-07-04 G. Branden Robinson <g.branden.robin...@gmail.com> + + * src/devices/gropdf/gropdf.pl (do_x): Trivially refactor. + Rename scalar `FDnm` to `fileName`. + 2025-07-04 G. Branden Robinson <g.branden.robin...@gmail.com> * src/devices/gropdf/gropdf.pl (LoadDownload): Drop scalar `f`; diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl index 7b5017ecb..eff27bfff 100644 --- a/src/devices/gropdf/gropdf.pl +++ b/src/devices/gropdf/gropdf.pl @@ -1712,23 +1712,23 @@ sub do_x my $info; my $image; - my ($FD,$FDnm)=OpenInc($fil); + my ($FD,$fileName)=OpenInc($fil); if (!defined($FD)) { - Warn("failed to open image file '$FDnm'"); + Warn("failed to open image file '$fileName'"); return; } if (!exists($incfil{$fil})) { - if ($gotexif and $FDnm!~m/\.pdf$/i) + if ($gotexif and $fileName!~m/\.pdf$/i) { binmode $FD; $image = Image::Magick->new; my $x = $image->Read(file => $FD); - Warn("Image '$FDnm': $x"), return if "$x"; + Warn("Image '$fileName': $x"), return if "$x"; $imgtype=$image->Get('magick'); $info->{ImageWidth}=$image->Get('width'); $info->{ImageHeight}=$image->Get('height'); @@ -1737,7 +1737,7 @@ sub do_x } else { - my $dim=`( identify $FDnm 2>/dev/null || file $FDnm )`; + my $dim=`( identify $fileName 2>/dev/null || file $fileName )`; if ($dim=~m/(?:[,=A-Z]|JP2) (\d+)\s*x\s*(\d+)/) { $info->{ImageWidth}=$1; @@ -1767,19 +1767,19 @@ sub do_x if ($imgtype eq 'PDF') { - $incfil{$fil}=LoadPDF($FD,$FDnm,$mat,$wid,$hgt,"pdfpic"); + $incfil{$fil}=LoadPDF($FD,$fileName,$mat,$wid,$hgt,"pdfpic"); } elsif ($imgtype eq 'JPEG') { - $incfil{$fil}=LoadJPEG($FD,$FDnm,$info); + $incfil{$fil}=LoadJPEG($FD,$fileName,$info); } elsif ($imgtype eq 'JP2') { - $incfil{$fil}=LoadJP2($FD,$FDnm,$info); + $incfil{$fil}=LoadJP2($FD,$fileName,$info); } else { - $incfil{$fil}=LoadMagick($image,$FDnm,$info); + $incfil{$fil}=LoadMagick($image,$fileName,$info); } return if !defined($incfil{$fil}); @@ -1791,7 +1791,7 @@ sub do_x IsGraphic(); my $bbox=$incfil{$fil}->[1]; $imgtype=$incfil{$fil}->[2]; - Warn("Failed to extract width x height for '$FDnm'"),return if !defined($bbox->[2]) or !defined($bbox->[3]); + Warn("Failed to extract width x height for '$fileName'"),return if !defined($bbox->[2]) or !defined($bbox->[3]); $wid=($bbox->[2]-$bbox->[0]) if $wid <= 0 and $hgt <= 0; my $xscale=d3($wid/($bbox->[2]-$bbox->[0])); my $yscale=d3(($hgt<=0)?$xscale:($hgt/($bbox->[3]-$bbox->[1]))); _______________________________________________ groff-commit mailing list groff-commit@gnu.org https://lists.gnu.org/mailman/listinfo/groff-commit