Imageprocessor: CloudImageService - Image larger when no querystring in set (both png and jpg)

Created on 28 Aug 2018  路  7Comments  路  Source: JimBobSquarePants/ImageProcessor

Description

Hi,

i'm facing the following issue:

Original image: 97KB
https://macroluxproduction.blob.core.windows.net/catalog/5ae70c760a902e3090234da1/images/800*800-2.jpg

Through ImageProcessingModule: 128KB
http://cdnmacrolux.flyweb.it/media/5ae70c760a902e3090234da1/images/800*800-2.jpg

From your source code i found a simple Stream.CopyTo when image has no querystring so should not be processed at all and saved to disk as is. Am I correct?

What's even more weird is that all images with original size lower than 128KB grow to exactly 128KB after being processed by the httpmodule; images bigger than 128KB grow to 1.0MB!!
Here it's an example:
https://macroluxproduction.blob.core.windows.net/catalog/5ae70c760a902e3090234da1/images/800800.jpg
http://cdnmacrolux.flyweb.it/media/5ae70c760a902e3090234da1/images/800
800.jpg

Steps to Reproduce

I can share the project GIT with you if required (on bitbucket)

System Configuration

  • ImageProcessor version: 2.6.2.25
  • ImageProcessor.Web version: 4.9.3.25
  • Other ImageProcessor packages and versions:
  • Environment (Operating system, version and so on): Windows 10 with VS 15.8.1 (debug), Windows Server 2016 1607 (release)
  • .NET Framework version: 4.7.2 in both environments
  • Additional information:

processing.config default with interceptAllRequests="true"

cache.config
```xml








security.config
```xml<?xml version="1.0" encoding="utf-8"?>
<security>
  <services>
    <!--Disable the LocalFileImageService and enable this one when using virtual paths. -->
    <!--<service name="LocalFileImageService" type="ImageProcessor.Web.Services.LocalFileImageService, ImageProcessor.Web" />-->
    <service prefix="media/" name="CloudImageService" type="ImageProcessor.Web.Services.CloudImageService, ImageProcessor.Web">
      <settings>
        <setting key="MaxBytes" value="8194304"/>
        <setting key="Timeout" value="30000"/>
        <setting key="Host" value="https://macroluxproduction.blob.core.windows.net/catalog/"/>
      </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>
      </whitelist>
    </service>-->
  </services>
</security>

Most helpful comment

Oh!
You were getting the full buffer chunk instead of picture鈥檚 bytes only. That was the problem!

Thank you man, great libraries
A.

All 7 comments

Why did you delete the issue template? How am I supposed to determine what version you are using etc?

Sorry @JimBobSquarePants, my mistake.
I've update the issue using your template.

Thank you

Thanks for adding the extra detail. I've figured out what is going wrong and will have a fix deployed in the next few days.

Cheers!

Oh!
You were getting the full buffer chunk instead of picture鈥檚 bytes only. That was the problem!

Thank you man, great libraries
A.

Thanks,

Yeah since the stream could grab a buffer of any potential length to satisfy the request.

Hi James,

any ETA for the nuget package?

Thank you,
Alessandro

When it's ready. I'm not a robot.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kristianstruct picture kristianstruct  路  4Comments

Jogai picture Jogai  路  6Comments

srdjo picture srdjo  路  6Comments

Leftyx picture Leftyx  路  5Comments

nul800sebastiaan picture nul800sebastiaan  路  7Comments