kotti.views.image

Views for image content objects.

kotti.views.image.image_scales = {'span11': [1060, 2120], 'span10': [960, 1920], 'span12': [1160, 2320], 'span5': [460, 920], 'span4': [360, 720], 'span7': [660, 1320], 'span6': [560, 1120], 'span1': [60, 120], 'span3': [260, 520], 'span2': [160, 320], 'span9': [860, 1720], 'span8': [760, 1520]}

Default image scales

class kotti.views.image.ImageView(context, request)[source]

Bases: object

The ImageView class is registered for the IImage context.

view()[source]
Result:Empty dictionary to be handed to the image.pt template for rendering.
Return type:dict
image(subpath=None)[source]

Return the image in a specific scale, either inline (default) or as attachment.

Parameters:subpath (str) – [<image_scale>]/download] (optional). When ‘download’ is the last element in subpath, the image is served with a ‘Content-Disposition: attachment’ header. <image_scale> has to be one of the predefined image_scales - either from the defaults in this module or one set with a kotti.image_scales.<scale_name> in your app config ini file.
Result:complete response object
Return type:pyramid.response.Response