[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:       James Richard Tyrer <tyrerj () acm ! org>
Date:       2007-12-28 22:41:37
Message-ID: 47757BA1.5090702 () acm ! org
[Download RAW message or body]

Thiago Macieira wrote:
> 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.

Yes, this should be the case.  OTOH, there is nothing to prevent files 
from being given the wrong extension.  The example was received with the 
wrong file extension attached.

> 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.

IIUC, an image file contains a "magic number".  This would seem to 
indicate that there would be very little chance for a misidentification 
from using magic.  So, I wonder why image/jpeg and image/tiff are at 
level 50.

> Therefore a JPEG file called *.tiff will be identified as image/tiff.
> 
IAC, in KDE3, a JPEG file called *.tif is correctly identified as JPEG 
and in KDE4 it is incorrectly identified as image/tiff.  Should we 
consider this to be a regression?

And as I said, GwenView has no problem determining the correct image type.

-- 
JRT
 
>> 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