Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

serve 404 images as pngs

  • Loading branch information...
commit c8a34aa33f927dc7009814dd4360993991ff8d21 1 parent 65da0e4
@evdb authored
View
BIN  app_engine/assets/404.jpg
Deleted file not rendered
View
BIN  app_engine/assets/404.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  app_engine/assets/mm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
7 app_engine/handlers/avatar.py
@@ -119,13 +119,12 @@ def serve_404_response(self):
return self.error(404)
-
def serve_mm_404_image(self):
return self.serve_asset_image( 'mm.png' )
def serve_privatar_404_image(self):
- return self.serve_asset_image( '404.jpg' )
+ return self.serve_asset_image( '404.png' )
def serve_asset_image(self, image_filename):
@@ -139,9 +138,9 @@ def serve_asset_image(self, image_filename):
if not content:
image = images.Image( open('assets/' + image_filename).read() )
image.resize( width=size, height=size )
- content = image.execute_transforms( output_encoding=images.JPEG )
+ content = image.execute_transforms( output_encoding=images.PNG )
memcache.set( memcache_key, content, time=86400 )
- self.response.headers['Content-Type'] = 'image/jpeg'
+ self.response.headers['Content-Type'] = 'image/png'
self.response.out.write(content)
return
Please sign in to comment.
Something went wrong with that request. Please try again.