[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: [Bug 154698] Won't open some TIFF files
From:       Thiago Macieira <thiago () kde ! org>
Date:       2007-12-28 12:23:22
Message-ID: 200712281023.22993.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Pino Toscano wrote:
>> I wouldn't worry about the extra disk read because hardware is getting
>> faster as we speak.  It occurs to me that Okular calls some method in
>> KMimeType and it returns the MIME type.  Now, if there was a method
>> that did *not* consider the extension to determine the MIME type and
>> Okular used this method, the issue should be solved.
>
>Why should I workaround some "problems" of KMimeType?
>This means that any other application would need to workaround KMimeType
>misdetections in own code -- so instead of fix those problems in *one*
> place, we workaround them all around in KDE applications?
>Is your engineering attitude in flavour of this?

There is a specification that we follow that dictates how a MIME type 
should be determined.

For some files (given the file name or currently guessed type), the result 
is inconclusive and the specification asks that magic be used. Only in 
those cases will the file be opened and an attempt at reading some bytes 
off it will be done.

In most other cases, a MIME type can be correctly guessed from the file 
name.

According to that spec 
(http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html#id2447161) 
the globbing should be preferred for magics with priority below 80. Both 
image/jpeg and image/tiff are at level 50 in the latest database I have.

Therefore a JPEG file called *.tiff will be identified as image/tiff.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

["signature.asc" (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic