Devesprit.ImageProcessor & Devesprit.ImageServer
Security.Config

This file contains security settings of the system and specifies how images should be loaded.

Devesprit.ImageServer is able to load images from different sources. You can create a new source specific to your needs implementing IImageService interface and specify the settings of your source in this file.

Available Image Services:

LocalFileImageService A service for loading images from the File system.
CloudImageService A generic cloud image for retrieving images where the remote location has been rewritten as a virtual path. Commonly seen in content management systems like Umbraco.
BarcodeImageService A Service for generating different types of Barcodes (For more information, Click here!)
RemoteImageService* A service for loading images from the Internet. It can download images from an external Host and send them to the user after processing them.

*To load images remotely and out of your server, you must enable RemoteImageService and add the list of authorized Hosts to the whitelist.

 

Security.Config File Path:

%Your Website Root Folder%\config\imageprocessor\Security.Config

The Contents of Security.Config:

Security.Config
Copy Code
<?xml version="1.0" encoding="utf-8"?>
<security>
  <cors>
    <whitelist>
      <!--
      Demo: Adding a Url will send cors headers to that requesting Url.
            "*" acts as a universal selector.
      -->
      <add url="http://devesprit.com"/>
    </whitelist>
  </cors>
  <services>
    <service name="LocalFileImageService" type="Devesprit.ImageServer.Services.LocalFileImageService,
            Devesprit.ImageServer"/>
    <!--Disable the LocalFileImageService and enable this one when using virtual paths. -->
    <!--<service name="CloudImageService" type="Devesprit.ImageServer.Services.CloudImageService,
            Devesprit.ImageServer">
      <settings>
        <setting key="MaxBytes" value="8194304"/>
        <setting key="Timeout" value="30000"/>
        <setting key="Host" value="http://yourhost.com/"/>
      </settings>
    </service>-->
    <service prefix="remote.axd" name="RemoteImageService"
            type="Devesprit.ImageServer.Services.RemoteImageService, Devesprit.ImageServer">
       <!-- The timeout for a request in milliseconds and the maximum
            allowable download in bytes. -->
      <settings>
        <setting key="MaxBytes" value="4194304"/>
        <setting key="Timeout" value="3000"/>
        <setting key="Protocol" value="http"/>
        <!-- Sets a user agent value for the request. Useful for social networks.
             See http://www.useragentstring.com/ for available values. -->
        <setting key="Useragent" value=""/>
      </settings>
      <!-- Sets allowable domains to process images from. -->
      <whitelist>
        <add url="http://images.mymovies.net"/>
        <add url="http://maps.googleapis.com" extensionLess="true" imageFormat=".png"/>
      </whitelist>
    </service>
    <!--<service prefix="barcode.axd" name="BarcodeImageService"
            type="Devesprit.ImageServer.Services.BarcodeImageService, Devesprit.ImageProcessor.Barcode">
      <settings>
        <setting key="Default.ShowCode" value="true" />
        <setting key="Default.FontFamily" value="Tahoma" />
        <setting key="Default.FontStyle" value="Regular" />
        <setting key="Default.FontSize" value="10" />
        <setting key="Default.BackgroundColor" value="fff" />
        <setting key="Default.ForegroundColor" value="000" />
        <setting key="Default.Opacity" value="100" />
        <setting key="Default.BarWidth" value="0" />
        <setting key="Default.BarHeight" value="0" />
        <setting key="Default.CaptionBelow" value="" />
        <setting key="Default.CaptionAbove" value="" />
        <setting key="Default.RotationAngle" value="0" />
        <setting key="Default.Position" value="0,0" />
        <setting key="Default.Margins" value="1,1,1,1" />
      </settings>
      <whitelist>
      </whitelist>
    </service>-->
    <!-- Add other service implemtations here. -->
  </services>
</security>