On 4/11/2009, at 9:13 PM, Pavel Sanda wrote:
<snip>
        string const format = filename.guessFormatFromContents();
        if (!format.empty())
                return format;

        // try to find a format from the file extension.
        string const ext = getExtension(filename.absFilename());
<snip>
}

you snip it too early... looking on the code i see:
// this is ambigous if two formats have the same extension,
// but better than nothing

so now one can understand the order of conditions.
i still see the benefits from your change, but it start to look
more complicated...

OK. How about I work up a patch that checks only one format has this extension, otherwise guesses based on content, or failing that does the current "better than nothing" ambiguous search? That way, it'll only have a different behavior for file extensions that correspond to exactly one format, anything with ambiguous extensions will continue with the old behavior.

Hugo

Reply via email to