W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2010

Re: [widgets] P&C simplifying some rules (editorial)

From: Cyril Concolato <cyril.concolato@enst.fr>
Date: Wed, 06 Jan 2010 13:09:42 +0100
Message-ID: <4B447D86.2080803@enst.fr>
To: Scott Wilson <scott.bradley.wilson@gmail.com>
CC: Marcos Caceres <marcosc@opera.com>, public-webapps <public-webapps@w3.org>
Le 06/01/2010 11:22, Scott Wilson a écrit :
> On 6 Jan 2010, at 08:56, Cyril Concolato wrote:
>
>> [snip] 1 fails because we don't implement SNIFF. I don't know if we
>> will. [snip]
>
> Actually you don't need to implement SNIFF to pass that particular test,
> as it only requires you do the extension-processing part of the algorithm.
Thanks for the info, but I'm not sure I understand. If you take the algorithm:
1. nothing to do
2. content-type = empty
3. extension = empty
4. name = 'fail'
5. Not applicable (not starting with a full stop)
6. Not applicable (no full stop in the name)
7. Not applicable (no full stop in the name)
8. extension is empty so you go to 10.
10. Process the file according to SNIFF.

Am I wrong?

>
> See, e.g.:
>
> https://svn.apache.org/repos/asf/incubator/wookie/trunk/src/org/apache/wookie/util/ContentTypeUtils.java
>
>
> As you can see we've put a TODO for SNIFF but the code as it stands
> passes the test fine.
Your algorithm returns null even if the file is of a supported media type. In this case, it's fine, it gives the right result but if the 'fail' file did not contain garbage data but say real PNG data, your algorithm would give the wrong result.

Anyway, thanks. I did not want to give the impression that I passed this test since SNIFF was not implemented but I will probably do something similar to you because I can actually give the right result for this test, which is what's needed for the report. However, the test suite should include one test really checking SNIFF support to see how many implementations do implement it.

Cyril

PS: In your code I noticed that line:
"if (filename.startsWith(",") && filename.lastIndexOf(".")==0) return null;"
Are you sure the "," shouldn't be a "." ?

-- 
Cyril Concolato
Maître de Conférences/Associate Professor
Groupe Mutimedia/Multimedia Group
Telecom ParisTech
46 rue Barrault
75 013 Paris, France
http://concolato.blog.telecom-paristech.fr/
Received on Wednesday, 6 January 2010 12:10:08 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:36 GMT