[Zope-CMF] Re: FSImage not recognising .bmp format

Tres Seaver tseaver at zope.com
Thu May 27 08:27:50 EDT 2004


David Convent wrote:
> Hello cmf developpers,
> 
> I am currently adapting one of the products i used to use with zope only 
> to make it integrated to the CMF (to Plone precisely)
> 
> This product uses the PIL module to generate maps on the fly.
> Maps are made with caches that are .bmp images objects.
> 
> While adapting the product to the CMF, i need those images to be stored 
> in a FS Directory View in the protal skins.
> Doing so i realised that .bmp images are not storable as FSImages, 
> unless i add a line to CMFCore/FSImage.py to register this format:
> 
> registerFileExtension('bmp', FSImage)
> 
> it works then very well.
> 
> My problem is that my company's system administrator does not like me 
> patching the official products from Zope Corp.

Here is a workaround that doesn't require the patch:  Create your own, 
"custom" product, e.g. (untested)::

$ cd /path/to/my/instance_home/Products
$ mkdir LocalCustomizations
$ cat > LocalCustomizations/__init__.py
""" Local customziations product.
"""
def initialize( context ):

     # XXX: drop this after CMF registers 'bmp' for us.
     from Products.CMFCore.FSImage import FSImage
     from Products.CMFCore.DirectoryView import registerFileExtension
     registerFileExtension( 'bmp', FSImage )


> Would it be possible to add this format to FSImage in the next release 
> of the CMF ?

Please create a collector issue for it (adding a 'diff -u' style patch 
will make it most likely to land):

   http://zope.org/Collectors/CMF

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com




More information about the Zope-CMF mailing list