Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • iNETZO 134 posts 497 karma points c-trib
    Jul 10, 2020 @ 13:45
    iNETZO
    0

    Exclude folder from ImageProcessor

    Hi,

    I have a folder "~/Resources/Images" where i put in all image that are used for the site to work, like loader gifs and icons.

    I also wanted to add favicon png's to this folder and added versioning to these files to prevent the caching of new versions:

    <link rel="icon" type="image/png" sizes="16x16" href="/Resources/Images/Favicon/favicon-16x16.png?version=1">
    <link rel="icon" type="image/png" sizes="32x32" href="/Resources/Images/Favicon/favicon-32x32.png?version=1">
    <link rel="icon" type="image/png" sizes="48x48" href="/Resources/Images/Favicon/favicon-48x48.png?version=1">
    

    I found out that the questionmark in the url in combination with these parameters raises an error for imageprocessor. By intercepting the ValidatingRequest event, i found out that all images files, with or without a questionmark in the url, are being processed by ImageProcessor.

    What i want, also for performance reasons, is to exclude the complete "Resources" folder from being processed by ImageProcessor. Is the a way or a setting to achieve this? Or is it possible to let ImageProcessor only process files in the "~/Media" folder? I couldn't find it in the imageprocessor documentation. In the imageprocressor "processing.config" file the setting "interceptAllRequests" is set to false but still all images are getting processed at the moment.

    Bestregards,

    iNETZO

  • Christopher Dent 5 posts 96 karma points
    Feb 12, 2021 @ 09:01
    Christopher Dent
    0

    I have the same issue. Getting hundreds of exceptions such as the below:

    ImageProcessor.Common.Exceptions.ImageProcessingException: ProcessImageAsync 610 : No image exists at https://<container>.blob.core.windows.net/media-prod/favicon-32x32.png
    

    Can anyone provide any information about how to exclude certain files or folders from image processor?

    For info, the site is hosted on Azure with a single web app and using Azure blob storage for the media. The security config is as follows:

    <?xml version="1.0" encoding="utf-8"?>
    <security>
      <services>
        <!--<service name="LocalFileImageService" type="ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web" />-->
        <!--Disable the LocalFileImageService and enable this one when using virtual paths. -->
        <service name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
          <settings>
            <setting key="Container" value="media-prod"/>
            <setting key="MaxBytes" value="8194304"/>
            <setting key="Timeout" value="30000"/>
            <setting key="Host" value="https://<container>.blob.core.windows.net/"/>
          </settings>
        </service>
        <service prefix="remote.axd" name="RemoteImageService" type="ImageProcessor.Web.Services.RemoteImageService, ImageProcessor.Web">
          <settings>
            <setting key="MaxBytes" value="4194304" />
            <setting key="Timeout" value="3000" />
            <setting key="Protocol" value="http" />
          </settings>
          <whitelist>
            <URLs including the site domain where the issue is occurring and the blob storage container domain (both https)>
          </whitelist>
        </service>
      </services>
    </security>
    

    Any help would be appreciated.

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft