View Issue Details

IDProjectCategoryView StatusLast Update
0000185file[All Projects] Generalpublic2020-08-22 18:46
Reportermarius851000Assigned Tochristos 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version5.39 
Target VersionFixed in Version5.40 
Summary0000185: file doesn't know the extension of GIF/TIFF/PSD file
Descriptionrunning ``file --extension`` on either a gif, a tiff or a pdf file result to giving the extension ??? (unknown)
Steps To Reproducedownload a GIF file (for example, https://i.imgur.com/DfQqM.gif), a TIFF file (for example, https://www.fileformat.info/format/tiff/sample/3794038f08df403bb446a97f897c578d/download , from https://www.fileformat.info/format/tiff/sample/index.htm) and a PSD file (for example, here: https://www.deviantart.com/edowaado/art/Doctor-Whooves-Epilogue-Pt-2-410825994 (click on download)).
Then run ``file --extension`` on the downloaded file, and it should result in ``<filename> : ???`` rather than ``<filename> : gif/tiff/psd``
Additional InformationHere is a patch to solve this, based on the github mirror.
TagsNo tags attached.

Activities

marius851000

2020-08-20 16:08

reporter  

add_extension_gif_psd_tiff.diff (819 bytes)
diff --git a/magic/Magdir/images b/magic/Magdir/images
index f0b3bb02..177c1d2b 100644
--- a/magic/Magdir/images
+++ b/magic/Magdir/images
@@ -297,10 +297,12 @@
 0	string		MM\x00\x2a	TIFF image data, big-endian
 !:strength +70
 !:mime	image/tiff
+!:ext	tiff
 >(4.L)	use		\^tiff_ifd
 0	string		II\x2a\x00	TIFF image data, little-endian
 !:mime	image/tiff
 !:strength +70
+!:ext	tiff
 >(4.l)	use		tiff_ifd
 
 0	name		tiff_ifd
@@ -513,6 +515,7 @@
 !:strength +80
 !:mime	image/gif
 !:apple	8BIMGIFf
+!:ext	gif
 >4	string		7a		\b, version 8%s,
 >4	string		9a		\b, version 8%s,
 >6	leshort		>0		%d x
@@ -1129,6 +1132,7 @@
 # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
 0	string		8BPS Adobe Photoshop Image
 !:mime	image/vnd.adobe.photoshop
+!:ext	psd
 >4   beshort 2 (PSB)
 >18  belong  x \b, %d x
 >14  belong  x %d,

christos

2020-08-22 18:46

manager   ~0003454

Fixed, thanks!

Issue History

Date Modified Username Field Change
2020-08-20 16:08 marius851000 New Issue
2020-08-20 16:08 marius851000 File Added: add_extension_gif_psd_tiff.diff
2020-08-22 18:46 christos Assigned To => christos
2020-08-22 18:46 christos Status new => assigned
2020-08-22 18:46 christos Status assigned => resolved
2020-08-22 18:46 christos Resolution open => fixed
2020-08-22 18:46 christos Fixed in Version => 5.40
2020-08-22 18:46 christos Note Added: 0003454