Image Upload Bug Version 3.3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Certain Images fail to upload under version 3.3 (As It used to work fine in previous version)

It is not the Image Size Issue i.e. Total File Size..

But it is related to dimensions of the image i.e. pixel size.

If I have an image which has dimension of more than 3200 pixels (No matter the image file size i.e. it can be 900 KB) but if the image dimension is more than a specific count it fails to upload. It says Upload Failed.


I would like to think that it is not a permissions issue as Images get uploaded fine.. but they fail only if images dimension is more than a specific pixel count (3200 pixels upload fine but 3300 pixels fails).

I tried changing the max image size under catalog settings/media but that doesnt seem to have any affect. (is It even used?)

Currently its set to 4200 so it should not be an issue?

Also I tried uploading the same images to demo store on nopcommerce and they upload fine and max image size is set to 1200 there so I dont think that setting is an issue..

What can be causing the application to fail uploading image files which has dimensions more than 3300?

Thanks
Amit
10 years ago
Do you experience it on our demo site? If yes, please share your picture so we can test it locally
10 years ago
images upload fine in the demo store... so that bugs me even more... on why its happening...

Images upload fine when performing clean install.

Has anybody run into this when upgrading???
10 years ago
Go to admin area > system > log and see the error text.

Also what is your picture size? More than 4Mb? In this case see the following URL - http://stackoverflow.com/questions/3853767/maximum-request-length-exceeded
10 years ago
Okay...

Log file gives following error
The dimensions of the output image (3484x2541) exceed the configured maximum dimensions of 3200x3200. You can change these limits in Web.config through the SizeLimiting plugin

The dimensions of the output image (3484x2541) exceed the configured maximum dimensions of 3200x3200. You can change these limits in Web.config through the SizeLimiting plugin.  
The details for the log entry.Full message:  ImageResizer.Plugins.Basic.SizeLimits+SizeLimitException (0x80004005): The dimensions of the output image (3484x2541) exceed the configured maximum dimensions of 3200x3200. You can change these limits in Web.config through the SizeLimiting plugin. at ImageResizer.Plugins.Basic.SizeLimits.ValidateTotalSize(Size total) at ImageResizer.Plugins.Basic.SizeLimiting.PrepareDestinationBitmap(ImageState s) at ImageResizer.Resizing.AbstractImageProcessor.PrepareDestinationBitmap(ImageState s) at ImageResizer.ImageBuilder.PrepareDestinationBitmap(ImageState s) at ImageResizer.ImageBuilder.Process(ImageState s)



How do I get access to this Size Limiting Plugin. Do NOT see it under plugins...


It is not the file size issue as file size is less than 4MB... it is rather... Pixel size..dimensions of the image issue..


********** I tried adding following parts to config file.. right after configsection but before nopconfig but it causes application to fail completely..

  <resizer>
    <sizelimits imageWidth="0" imageHeight="0" totalWidth="4200"
              totalHeight="4200" totalBehavior="throwexception" />
  </resizer>

Seems like it is something to do with image resizing package nopcommerce is using

Thanks
Amiy
10 years ago
guptaat wrote:
********** I tried adding following parts to config file.. right after configsection but before nopconfig but it causes application to fail completely..

  <resizer>
    <sizelimits imageWidth="0" imageHeight="0" totalWidth="4200"
              totalHeight="4200" totalBehavior="throwexception" />
  </resizer>

Please see this plugin page. I presume you forgot about

<section name="resizer" type="ImageResizer.ResizerSection,ImageResizer"  requirePermission="false"  />
10 years ago
Sorry to encroach, but the easiest solution is to reduce the size of the image. Almost any imaging software can do it efficiently (even default MS paint on windows). Take one extra step and reduce the image by 50%, still have great quality (unless your a gamer with 3 screens) and not have to worry about errors.

EDIT: Have to ask, why are you even trying to post an image over 3k? Very rare you find any online software will allow this, usual due to file size. As far as I know, it doesn't matter the coding used to to re-size, it still take up the same space. So 80kb for a reduce image vs 3.4mb... only makes sense to recude image size to me.
10 years ago
asilentnoize wrote:
...

Agree. Anyway it'll be resized in nopCommerce. Furthermore, "lighter" images are better for performance
9 years ago
I'm using changeset 51cf96ce8d4d from Apr 30, 1:54 AM, and noticed that even with quality set to 70% uploaded images were increasing in size.  I just went to demo site and the same thing is occurring there. Demo site is set at 80%, poduct is "uploaded images KBs increased", 1st image was 35.6kb on upload in demo size increased to 36.6kb, 2nd image 225kb and on upload in demo increased to 246.45 KB. Image optimization is a HUGE part of making a site load quickly and we need to implement compression that either reduces file size or at least maintains size, not increases it.  It looks like you are using the current version of imageResizer too, so I'm not sure what is going on. I haven't downloaded that package and tested it individually to see if it does the same outside of nop.

I use System.Drawing in other apps with very good compression results, (portions of code below) and I am wondering if I need to modify my code to use in nop instead of imageResizer or if image compression is going to be corrected in nop?

using (Graphics g = Graphics.FromImage(ret))
            {
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
...
System.Drawing.Imaging.EncoderParameters encoderParams = new System.Drawing.Imaging.EncoderParameters();
                    long[] quality = new long[1];
                    quality[0] = 65;
                    System.Drawing.Imaging.EncoderParameter encoderParam = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, quality);
                    encoderParams.Param[0] = encoderParam;
                    System.Drawing.Imaging.ImageCodecInfo[] arrayICI = System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders();
                    System.Drawing.Imaging.ImageCodecInfo jpegICI = null;
                    for (int x = 0; x < arrayICI.Length; x++)
                    {
                        if (arrayICI[x].FormatDescription.Equals("JPEG"))
                        {
                            jpegICI = arrayICI[x];
                            break;
                        }
                    }
....
9 years ago
I just created a work item for this:  https://nopcommerce.codeplex.com/workitem/12105
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.