--- Comment #7 from Michael Dale <> 2011-03-04 18:59:54 UTC ---
 (In reply to comment #6)
> Why path info instead of substr?

Its documented in PHP as a consist fast way to get a file extension without any
regular expression or searching for the last period. Its coverage goes back to
php4. Feel free to use substr with strrpos if you want but I think path info is
less verbose.

> Also, I'd rather have this based on mime type instead of extension. I can
> imagine for example that .ogg vorbis files are much less expensive to purge
> than .ogg theora files.

First I don´t think ogg audio is very different from the rational mentioned
above. ( ie we would want to explicit purge it ) In this version we don't even
transcode audio, and with ogg audio files that /we/ gennerate /we/ would always
use the .oga extension ( so there would be no ambiguity ) ... but assuming we
want more explicit control than "extension based file types" over what we purge
and do not purge ::

Mime type parsing would require some more complexity. If we just use the php
mime_content_type call I believe its also file extension based per the systems
magic.mime file. ( extensions are suposed to communicate mime type )

Alternatively we actually parse the file ( resource intensive since we do this
in php for all our files and with ogg parsing I believe we do a linear read of
the entire file to catch any concatenated streams which we would have to work
around or just accept some computational delay anytime you want to purge video
thumbnails )  

Or we have some lookup table per filename{transcodeKey}.ext....

Maybe the easiest change would be to rename this variable to
$wgExcludePostfixKeyFromThumbnailPurge and then let it check anything after the
base file name. So things like {myfile.ogg.AUDIO_64K.oga can be represented in
the settings array as "AUDIO_64K.oga" ?

For version 2, its best to give every transcode its own db entry where we store
the version of the encoder and all the settings used. This way we have fine
grain indexed select purging capabilities for the extension maintenance
scripts. And maybe we put “derivatives” in a sperate folder from “thumbnails”
if we want to handle them very diffrently.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
Wikibugs-l mailing list

Reply via email to