View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000304 | file | General | public | 2021-12-06 06:32 | 2022-10-09 19:04 |
Reporter | zachs18 | Assigned To | christos | ||
Priority | low | Severity | tweak | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 5.41 | ||||
Fixed in Version | 5.44 | ||||
Summary | 0000304: Netpbm format does not correctly parse size for some images | ||||
Description | The Netpbm image formats allow any amount of any whitespace between the width, height, and (if given) maxval fields in the header (it is only after the last field that exactly one whitespace character is allowed). The format specification in magic/Magdir/images, however, assumes that there is exactly one space character (\ ) between width and height. This leads file to not correctly parse the width and height in files where the width and height are separated by other whitespace, e.g. a newline, two spaces, or a tab. | ||||
Steps To Reproduce | Place the below into a file (not including quotes): "P2 2 2 255 0 1 2 3" `file` will report the file as `Netpbm image data, size = 0 x 1, greymap, ASCII text`, instead of `Netpbm image data, size = 2 x 2, greymap, ASCII text` | ||||
Additional Information | I believe this can be fixed by changing the regular expression on line 182 of magic/Magdir/images from "[0-9]{1,50}\ [0-9]{1,50}" to "[0-9]{1,50}[\040\t\f\r\n]+[0-9]{1,50}" Attached files are reported as: test1.pgm: `Netpbm image data, size = 0 x 0, greymap, ASCII text` test2.pgm: `, rawbits, greymap` but should be reported as: test1.pgm: `Netpbm image data, size = 2 x 2, greymap, ASCII text` test2.pgm: `Netpbm image data, size = 2 x 2, rawbits, greymap` | ||||
Tags | magic | ||||
|
|
|
Fixed as suggested, thanks! |
|
Fix Breaks: P3 # CREATOR: GIMP PNM Filter Version 1.1 10 20 255 255 (...) |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-12-06 06:32 | zachs18 | New Issue | |
2021-12-06 06:32 | zachs18 | File Added: test2.pgm | |
2021-12-06 06:32 | zachs18 | File Added: test1.pgm | |
2021-12-06 06:32 | zachs18 | Tag Attached: magic | |
2021-12-17 14:42 | christos | Assigned To | => christos |
2021-12-17 14:42 | christos | Status | new => assigned |
2021-12-17 14:43 | christos | Status | assigned => resolved |
2021-12-17 14:43 | christos | Resolution | open => fixed |
2021-12-17 14:43 | christos | Fixed in Version | => 5.42 |
2021-12-17 14:43 | christos | Note Added: 0003684 | |
2022-10-02 22:42 | christos | Status | resolved => acknowledged |
2022-10-02 22:42 | christos | Note Added: 0003822 | |
2022-10-09 19:04 | christos | Status | acknowledged => resolved |
2022-10-09 19:04 | christos | Fixed in Version | 5.42 => 5.44 |