View Issue Details

IDProjectCategoryView StatusLast Update
0000407fileGeneralpublic2022-12-02 17:26
Reportermanfredsc Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version5.44 
Summary0000407: mime-type and extension not emitted for lzma
Description# file test.txt.lzma
test.txt.lzma: LZMA compressed data, non-streamed, size 5

# file --mime-type test.txt.lzma
test.txt.lzma: application/octet-stream

# file --extension test.txt.lzma
test.txt.lzma: ???


The magic entry is as follows [magic/Magdir/compress]:
# Type: LZMA
0 lelong&0xffffff =0x5d
>12 leshort 0xff LZMA compressed data,
!:mime application/x-lzma
!:ext lzma
>>5 lequad =0xffffffffffffffff streamed
>>5 lequad !0xffffffffffffffff non-streamed, size %lld
>12 leshort 0 LZMA compressed data,
>>5 lequad =0xffffffffffffffff streamed
>>5 lequad !0xffffffffffffffff non-streamed, size %lld


If the mime entry is moved to the end of the block, the mime description is
given just fine. So I suggest moving the "!:mime" and "!:ext" lines to the end.

# Type: LZMA
0 lelong&0xffffff =0x5d
>12 leshort 0xff LZMA compressed data,
>>5 lequad =0xffffffffffffffff streamed
>>5 lequad !0xffffffffffffffff non-streamed, size %lld
>12 leshort 0 LZMA compressed data,
>>5 lequad =0xffffffffffffffff streamed
>>5 lequad !0xffffffffffffffff non-streamed, size %lld
!:mime application/x-lzma
!:ext lzma


With this, I get
# file --mime-type test.txt.lzma
test.txt.lzma: application/x-lzma
# file --extension test.txt.lzma
test.txt.lzma: lzma
TagsNo tags attached.

Activities

manfredsc

2022-11-28 15:06

reporter  

test.txt.lzma (23 bytes)

manfredsc

2022-11-28 15:23

reporter   ~0003866

Or, other possibility would be to duplicate the mime and ext entries, I'm not
familiar enough with the magic format to decide which is better:

# Type: LZMA
0 lelong&0xffffff =0x5d
>12 leshort 0xff LZMA compressed data,
!:mime application/x-lzma
!:ext lzma
>>5 lequad =0xffffffffffffffff streamed
>>5 lequad !0xffffffffffffffff non-streamed, size %lld
>12 leshort 0 LZMA compressed data,
!:mime application/x-lzma
!:ext lzma
>>5 lequad =0xffffffffffffffff streamed
>>5 lequad !0xffffffffffffffff non-streamed, size %lld

christos

2022-12-02 17:26

manager   ~0003867

Fixed, thanks

Issue History

Date Modified Username Field Change
2022-11-28 15:06 manfredsc New Issue
2022-11-28 15:06 manfredsc File Added: test.txt.lzma
2022-11-28 15:23 manfredsc Note Added: 0003866
2022-12-02 17:26 christos Assigned To => christos
2022-12-02 17:26 christos Status new => resolved
2022-12-02 17:26 christos Resolution open => fixed
2022-12-02 17:26 christos Fixed in Version => 5.44
2022-12-02 17:26 christos Note Added: 0003867