### ImageMagick version

7.1.1-7

### Operating system

Linux

### Operating system, version and so on

nixos unstable

### Description

The following steps lead to a 
```
convert: negative or zero image size `test.pnm' @ error/resize.c/ResizeImage/3743.
```
error, despite
```
$ identify test.pnm
test.pnm PBM 1125x100 1125x100+0+0 1-bit Bilevel Gray 14112B 0.000u 0:00.000
```


### Steps to Reproduce

In an empty directory, run:
```
convert +matte -depth 1 -border 2x2 -bordercolor black -family 'DejaVu Sans' -pointsize 12 -density 300 label:"The quick brown fox" 1.pnm
convert +matte -depth 1 -border 2x2 -bordercolor black -family 'DejaVu Sans' -pointsize 12 -density 300 label:'The slower lazy dog' 2.pnm
convert -size 100x100 xc:black black.pnm
convert 1.pnm black.pnm 2.pnm +append test.pnm
convert test.pnm -depth 1 -resize 1x1 txt:-

```

This is a test case of the gscan2pdf program, where upgrading imagemagick made the test suite fail: https://sourceforge.net/p/gscan2pdf/bugs/418/

### Images

_No response_
negative or zero image size
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : negative or zero image size
Issue date:

--- start body ---
### ImageMagick version

7.1.1-7

### Operating system

Linux

### Operating system, version and so on

nixos unstable

### Description

The following steps lead to a 
```
convert: negative or zero image size `test.pnm' @ error/resize.c/ResizeImage/3743.
```
error, despite
```
$ identify test.pnm
test.pnm PBM 1125x100 1125x100+0+0 1-bit Bilevel Gray 14112B 0.000u 0:00.000
```


### Steps to Reproduce

In an empty directory, run:
```
convert +matte -depth 1 -border 2x2 -bordercolor black -family 'DejaVu Sans' -pointsize 12 -density 300 label:"The quick brown fox" 1.pnm
convert +matte -depth 1 -border 2x2 -bordercolor black -family 'DejaVu Sans' -pointsize 12 -density 300 label:'The slower lazy dog' 2.pnm
convert -size 100x100 xc:black black.pnm
convert 1.pnm black.pnm 2.pnm +append test.pnm
convert test.pnm -depth 1 -resize 1x1 txt:-

```

This is a test case of the gscan2pdf program, where upgrading imagemagick made the test suite fail: https://sourceforge.net/p/gscan2pdf/bugs/418/

### Images

_No response_
--- end body ---
