[File] [PATCH] of Magdir/gimp for GIMP animated brush+ extensions +mime types

Jörg Jenderek joerg.jen.der.ek at gmx.net
Sun Oct 13 12:33:48 UTC 2019


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
some days ago i handled some files with pat extension. Some belongs to
graphic software gimp. When i run file command version 5.37 on GIMP
related samples with -k -m Magdir/gimp options i get an output like:

5x5squareBlur.gbr:        GIMP brush data
Android-icon-palette.gpl: GIMP palette data, ASCII text
BrushPipe.xcf:            GIMP XCF image data, version 0,
			  40 x 40, Greyscale
elsamuko-autumn:          GIMP curve file
FILSD_Brush_3.gih:        data
German_flag_smooth.ggr:   GIMP gradient data, ASCII text
gimp_platinum.txt:        GIMP curve file
walnut.pat:               GIMP pattern data, Walnut

First GIMP animated brush which have gih file name extension are not
recognised.
Second only XCF images are shown with a specific mime type when
using -i option. For text based file types text/plain is shown and
for all others application/octet-stream is displayed.
Furthermore with --extension option only ??? is displayed.

Some global information can be found on gimp online help. Info about
file format can be found on fileformats.archiveteam.org site. So i
add comment lines like:
# URL:	https://docs.gimp.org/en/gimp-using-animated-brushes.html
# http://fileformats.archiveteam.org/wiki/GIMP_Animated_Brush

According to above mentioned site and observed examples i look for
number of cells information by line:
 0	search/21/b	\040ncells:	GIMP animated brush data
Afterward user defined mime type and file name extension are shown
by lines
 !:mime	image/x-gimp-gih
 !:ext	gih

On fileformats website there information of other GIMP formats is
listed under keyword XCF. So i add listed sub pages URL and file
name extensions for the other formats like GIMP brushes and so on to
Magdir/gimp. The information about mime types are found on
reposcope.com web site.

After applying the above mentioned modifications by patch
file-5.37-gimp.diff then i get a more precise output. And with -i
option now specific mime types are shown like:

5x5squareBlur.gbr:        image/x-gimp-gbr; charset=binary
Android-icon-palette.gpl: text/x-gimp-gpl; charset=us-ascii
BrushPipe.xcf:            image/x-xcf; charset=binary
elsamuko-autumn:          text/x-gimp-curve; charset=us-ascii
FILSD_Brush_3.gih:        image/x-gimp-gih; charset=binary
German_flag_smooth.ggr:   text/x-gimp-ggr; charset=us-ascii
gimp_platinum.txt:        text/x-gimp-curve; charset=us-ascii
walnut.pat:               image/x-gimp-pat; charset=binary

I hope my diff file can be applied in future version of
file utility.
For the GIMP curves there seems to exist an other file format not
described on mentioned document sites. This is not recognised by
file command.

With best wishes
Jörg Jenderek
- --
Jörg Jenderek
















-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXaMZowAKCRCv8rHJQhrU
1mTBAKDU9KCx0WFiq1dNiOm0G96o07ClWACgijLpFalqCFKkK4/gi8lAO7eBZdc=
=U8Du
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.37/magic/Magdir/gimp.old	2019-02-22 12:06:34 +0000
+++ file-5.37/magic/Magdir/gimp	2019-10-12 18:59:12 +0000
@@ -7,2 +7,5 @@
 0       string/t        GIMP\ Gradient  GIMP gradient data
+#!:mime	text/plain
+!:mime	text/x-gimp-ggr
+!:ext	ggr
 
@@ -11,2 +14,7 @@
 0       string/t        GIMP\ Palette   GIMP palette data
+# URL:		https://docs.gimp.org/en/gimp-concepts-palettes.html
+# Reference:	http://fileformats.archiveteam.org/wiki/GIMP_Palette
+#!:mime	text/plain
+!:mime	text/x-gimp-gpl
+!:ext	gpl
 
@@ -17,4 +25,7 @@
 
+# URL:		https://en.wikipedia.org/wiki/XCF_(file_format)
+# Reference:	https://gitlab.gnome.org/GNOME/gimp/blob/master/devel-docs/xcf.txt
 0	string		gimp\ xcf	GIMP XCF image data,
 !:mime	image/x-xcf
+!:ext	xcf
 >9	string		file		version 0,
@@ -34,4 +45,7 @@
 
+# Reference:	http://fileformats.archiveteam.org/wiki/GIMP_Pattern
 20      string          GPAT            GIMP pattern data,
 >24     string          x               %s
+!:mime	image/x-gimp-pat
+!:ext	pat
 
@@ -43,2 +57,14 @@
 20      string          GIMP            GIMP brush data
+# Reference:	http://fileformats.archiveteam.org/wiki/GIMP_Brush
+!:mime	image/x-gimp-gbr
+# some sources also list gpb
+!:ext	gbr
+
+# From:		Joerg Jenderek
+# URL:		https://docs.gimp.org/en/gimp-using-animated-brushes.html
+# Reference:	http://fileformats.archiveteam.org/wiki/GIMP_Animated_Brush
+# share\gimp\2.0\brushes\Legacy\confetti.gih
+0	search/21/b	\040ncells:		GIMP animated brush data
+!:mime	image/x-gimp-gih
+!:ext	gih
 
@@ -47 +73,5 @@
 0	string	#\040GIMP\040Curves\040File	GIMP curve file
+#!:mime	text/plain
+!:mime	text/x-gimp-curve
+!:ext	/txt
+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.37-gimp.diff.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20191013/186b6c32/attachment.obj>


More information about the File mailing list