[File] Patch for /usr/share/misc/magic

Jim Long longj22 at wwu.edu
Wed Oct 5 22:28:59 UTC 2022


Hello!  This email address is listed as the maintainer of the UNIX "file"
utility's database "/usr/share/misc/magic" used to identify various types of
files based on an analysis of the file contents.  Please  excuse me if that
information is no longer accurate.

There is a minor typo in the section regarding TIFF image files.  The man
page for file(1) states:

	--extension
             Print a slash-separated list of valid extensions for the file
             type found.

The current (FreeBSD 13.1, Ubuntu 22.04) version of the magic file lists two
possible extensions for TIFF files, "tif" or "tiff".  Due to the typo in the
magic file, file(1) says:

$ file test/20221005/python.tiff 
test/20221005/python.tiff: TIFF image data, little-endian, direntries=17, height=16, bps=1242, compression=none, PhotometricIntepretation=RGB, name=python.tiff, orientation=upper-left, width=16
$ file --extension test/20221005/python.tiff 
test/20221005/python.tiff: tif,tiff

The attached patch corrects this typo.

Respectfully submitted,

Jim Long
Bellingham, WA

--- magic.old	2022-08-12 12:14:42.643396000 -0700
+++ magic	2022-10-05 12:14:18.488207000 -0700
@@ -18447,12 +18447,12 @@
 0	string		MM\x00\x2a	TIFF image data, big-endian
 !:strength +70
 !:mime	image/tiff
-!:ext	tif,tiff
+!:ext	tif/tiff
 >(4.L)	use		\^tiff_ifd
 0	string		II\x2a\x00	TIFF image data, little-endian
 !:mime	image/tiff
 !:strength +70
-!:ext	tif,tiff
+!:ext	tif/tiff
 >(4.l)	use		tiff_ifd
 
 0	name		tiff_ifd

-- 
email: longj22 at wwu.edu
-------------- next part --------------
--- magic.old	2022-08-12 12:14:42.643396000 -0700
+++ magic	2022-10-05 12:14:18.488207000 -0700
@@ -18447,12 +18447,12 @@
 0	string		MM\x00\x2a	TIFF image data, big-endian
 !:strength +70
 !:mime	image/tiff
-!:ext	tif,tiff
+!:ext	tif/tiff
 >(4.L)	use		\^tiff_ifd
 0	string		II\x2a\x00	TIFF image data, little-endian
 !:mime	image/tiff
 !:strength +70
-!:ext	tif,tiff
+!:ext	tif/tiff
 >(4.l)	use		tiff_ifd
 
 0	name		tiff_ifd


More information about the File mailing list