[Tilecache] [OpenLayers-Dev] jpeg vs jpg

Paul Spencer pspencer at dmsolutions.ca
Thu Oct 25 08:57:02 EDT 2007


No.  TileCache saves the image with a .jpg extension but uses 'jpeg'  
for the mime type of the returned content.  The underlying library,  
PIL, will do that automagically for you.

Cheers

Paul

On 25-Oct-07, at 8:53 AM, Jachym Cepicky wrote:

> Hi,
>
> no, if I understand it right, TileCache will always save the files  
> with
> extension "jpeg", while OpenLayers will always request "jpg" files.
>
> Jachym
>
>
> Paul Spencer píše v Čt 25. 10. 2007 v 08:49 -0400:
>> Jachym,
>>
>> if I understand it correctly, the image saved on disk has an
>> extension of .jpg while the mime type returned by the web server with
>> a JPEG image is image/jpeg.  So the code is fine and is doing the
>> right thing.  You just need to specify the correct extension in
>> OpenLayers (either 'jpg' or 'jpeg' will do) and in TileCache config
>> (again, probably either will do).
>>
>> Paul
>>
>> On 25-Oct-07, at 7:57 AM, Jachym Cepicky wrote:
>>
>>> Hi,
>>>
>>> in OpenLayers.Layer.Tilecache, around line 55, there is
>>>
>>> this.extension = (this.extension == 'jpeg') ? 'jpg' :  
>>> this.extension;
>>>
>>> in tilecache/TileCache/Layer.py, around line 80, there is
>>>
>>> if extension.lower() == 'jpg': extension = 'jpeg' # MIME
>>>
>>> IMHO, it does not make sense, if I understand this well, you can  
>>> never
>>> access JPEG TileCache from OpenLayers
>>>
>>> Do I understand it well?
>>>
>>> Thanks
>>>
>>> Jachym
>>> -- 
>>> Jachym Cepicky
>>> e-mail: jachym.cepicky at gmail.com
>>> URL: http://les-ejk.cz
>>> GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev at openlayers.org
>>> http://openlayers.org/mailman/listinfo/dev
>>
>> +-----------------------------------------------------------------+
>> |Paul Spencer                          pspencer at dmsolutions.ca    |
>> +-----------------------------------------------------------------+
>> |Chief Technology Officer                                         |
>> |DM Solutions Group Inc                http://www.dmsolutions.ca/ |
>> +-----------------------------------------------------------------+
>>
>>
>>
>>
>>
> -- 
> Jachym Cepicky
> e-mail: jachym.cepicky at gmail.com
> URL: http://les-ejk.cz
> GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub
>

+-----------------------------------------------------------------+
|Paul Spencer                          pspencer at dmsolutions.ca    |
+-----------------------------------------------------------------+
|Chief Technology Officer                                         |
|DM Solutions Group Inc                http://www.dmsolutions.ca/ |
+-----------------------------------------------------------------+








More information about the Tilecache mailing list