Image Generation, Loading and Caching

Dynamic image generation, loading and caching in Thrinacia works over the API backend. This is done to ensure images are always properly generated, cached and served from closest CDN node.

There are currently two methods to get image resized dynamically, cached and then served from CDN on every subsequent request. This is done through either Static Presets or Dynamic Filters.

Static Image Presets

Examples using Static Presets

  1. Using “campaign_detail” preset found in path
    https://origin.thrinacia.com/api/image/campaign_detail/campaign/b4/51/c3/307F85D2-D997-11E4-9949-9AA4CD8206F8-image-Ginger-Bread-House-6x4.jpg
  2. Using “campaign_home” preset found in path
    https://origin.thrinacia.com/api/image/campaign_home/campaign/59/a2/91/24BBF4FA-D998-11E4-B1E8-9AA4CD8206F8-image-Banff-area-Norquay-side.jpg
  3. Using “campaign_explore” preset found in path
    https://origin.thrinacia.com/api/image/campaign_explore/campaign/59/a2/91/24BBF4FA-D998-11E4-B1E8-9AA4CD8206F8-image-Banff-area-Norquay-side.jpg

Available Static Presets

Preset Name Action
site_logo scale(width: 160, height: 36, mode:none)
campaign_home scale(width: 349, height:330, mode: fit)
campaign_explore scale(width: 249, height:230, mode: fit)
campaign_detail scale(width: 668, height: 501, mode:fit)
campaign_profile scale(width: 200, height: 200, mode:fit)
portal_setting_preview_background scale(width: 400, height: 240, mode:fit)
dashboard_thumbnail scale(width: 65, height: 65, mode:fit)
pledge_history scale(width: 630, height: 630, mode:fit)
campaign_thumbnail scale(width: 255, height: 255, mode:fit)

Dynamic Image Filters

Examples using Dynamic Image Filters

Note the “h-” and “w-” parameters used to control height and width

  1. Using height of 285 and width of 428 pixels
    https://origin.thrinacia.com/api/image/w-428-h-285/campaign/b4/51/c3/307F85D2-D997-11E4-9949-9AA4CD8206F8-image-Ginger-Bread-House-6x4.jpg
  2. Using height of 285 pixels
    https://origin.thrinacia.com/api/image/h-285/campaign/59/a2/91/24BBF4FA-D998-11E4-B1E8-9AA4CD8206F8-image-Banff-area-Norquay-side.jpg

Native Size Images

Sometimes you need to access raw images without any size changes. To do this simply change the path to remove either “Static Preset” or “Dynamic Filter” attributes, “image” and add “static/images” to the path. Example is below

https://origin.thrinacia.com/api/static/images/campaign/59/a2/91/24BBF4FA-D998-11E4-B1E8-9AA4CD8206F8-image-Banff-area-Norquay-side.jpg

Further Notes

All images are first generated either (if they don’t exist already) using “Static Preset” or “Dynamic Filters”, they are then pulled into the CDN and served to the end user from the closest node location.

Raw images are never passing through scale/crop modification filters. They are CDN cached and served to the user. Such images are always served in their native size.