View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000515 | file | General | public | 2024-04-08 19:13 | 2024-11-10 20:45 |
Reporter | marcoribeiro | Assigned To | christos | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 5.45 | ||||
Fixed in Version | HEAD | ||||
Summary | 0000515: Magic inserts linebreaks inside TIFF descriptions, making it not possible to correcly split lines | ||||
Description | When I use the flag 'MAGIC_CONTINUE', I expect each detection to be on a separate line, but on some cases it also adds a linebreak followed by "- " inside a detection from a TIFF buffer Here is an example, using the flags MAGIC_CONTINUE | MAGIC_RAW (also happens with MAGIC_RAW is not set, but with "\n" replaced with "\012"): 'TIFF image data, little-endian, direntries=18, height=434, bps=14534, compression=none, PhotometricInterpretation=RGB, name=/home/marta/Desktop/www/file ex/files/grafa/tiff/file_example_TIFF_1MB.tiff, orientation=upper-left\n- , width=650\n- data' Note that the "width=650" should be on the previous line (or at least, it should not have the "- " before it) This (attached) TIFF image was downloaded from https://file-examples.com/index.php/sample-images-download/sample-tiff-download/ (the 1MB version) | ||||
Steps To Reproduce | Using the file-magic package for Python: ------------------------------------------------- import magic from pathlib import Path magic_desc = magic.open(magic.MAGIC_CONTINUE | magic.MAGIC_RAW) assert magic_desc.load() == 0 data = Path("file_example_TIFF_1MB").read_bytes() print(magic_desc.buffer(data)) ------------------------------------------------- Using the python-magic package: ------------------------------------------------- import magic from pathlib import Path magic_desc = magic.Magic(keep_going=True, raw=True) data = Path("file_example_TIFF_1MB").read_bytes() print(magic_desc.from_buffer(data)) ------------------------------------------------- Both cases should output: TIFF image data, little-endian, direntries=18, height=434, bps=14534, compression=none, PhotometricInterpretation=RGB, name=/home/marta/Desktop/www/file ex/files/grafa/tiff/file_example_TIFF_1MB.tiff, orientation=upper-left - , width=650 - data | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2024-04-08 19:13 | marcoribeiro | New Issue | |
2024-04-08 19:13 | marcoribeiro | File Added: file_example_TIFF_1MB.tiff | |
2024-11-10 20:44 | christos | Assigned To | => christos |
2024-11-10 20:44 | christos | Status | new => assigned |
2024-11-10 20:45 | christos | Status | assigned => resolved |
2024-11-10 20:45 | christos | Resolution | open => fixed |
2024-11-10 20:45 | christos | Fixed in Version | => HEAD |
2024-11-10 20:45 | christos | Note Added: 0004108 |