Skip to content

Commit

Permalink
webserver: support specifying the scaling algorithm in image:// trans…
Browse files Browse the repository at this point in the history
…formation URLs
  • Loading branch information
Montellese committed Jul 12, 2015
1 parent 8f9e642 commit 535a0ff
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
#include "utils/StringUtils.h"
#include "utils/URIUtils.h"

#define TRANSFORMATION_OPTION_WIDTH "width"
#define TRANSFORMATION_OPTION_HEIGHT "height"
#define TRANSFORMATION_OPTION_WIDTH "width"
#define TRANSFORMATION_OPTION_HEIGHT "height"
#define TRANSFORMATION_OPTION_SCALING_ALGORITHM "scaling_algorithm"

static const std::string ImageBasePath = "/image/";

Expand Down Expand Up @@ -141,6 +142,10 @@ int CHTTPImageTransformationHandler::HandleRequest()
if (option != options.end())
urlOptions.push_back(TRANSFORMATION_OPTION_HEIGHT "=" + option->second);

option = options.find(TRANSFORMATION_OPTION_SCALING_ALGORITHM);
if (option != options.end())
urlOptions.push_back(TRANSFORMATION_OPTION_SCALING_ALGORITHM "=" + option->second);

std::string imagePath = m_url;
if (!urlOptions.empty())
{
Expand Down

0 comments on commit 535a0ff

Please sign in to comment.