> If a properly named Targa file is not correctly loaded by GIMP, then
> another plug-in (for example faxg3) uses a file magic that fits this
> targa file. So which plug-in should load the file ? The one that has the
> correct file magic or the one that handles the correct extension ? I
> would prefer the plug-in with the correct file magic.
> Maybe the file magic of the faxg3 plug-in is too weak ?

If I understood the patch correctly, only the extensions of magicless 
file-formats would be probed before the magic header is used. That would
mean you couldn't easily load a fax g3 files named foo.tga anymore, but if
it is named foo.gif Gimp would still use the fax g3 loader. On the other 
hand it would allow you to actually load foo.tga if is is really a Targa 
file. The patch implements the following logic:

 (1) Check if the extension matches one of the file_formats we can't 
     properly identify by their magic header. If not, proceed with (2).
 (2) Check if the header matches one of the magics. If not, proceed with (3).
 (3) Check if extension matches anything we know.

I had the impression, this wasn't clear...

The only problem I see with this patch are badly written file_plug_ins 
that don't provide a magic header but a bunch of extensions since the 
patch would significantly enhance the possibility that the wrong loader
is used.

Salut, Sven

Reply via email to