Configures how the uploader tries to detect whether image resizing failed due to memory issues and whether to retry.
Namespace:
Aurigma.ImageUploaderFlash
Assembly:
Aurigma.ImageUploaderFlash (in Aurigma.ImageUploaderFlash.dll)
public int ThumbnailResizeFailureDetector { get; set; }
Type: System..Int32
If0
(default), it won't attempt to detect failures and do anything about it. If you set a larger value, it will be a number of attempts to create an image. Default value is 0.
Under certain circumstances, a browser may fail to process an image (e.g. resize it). For example, it may happen if the system runs out of memory. Unfortunately, JavaScript does not give any means to handle this situation gracefully. It will just silently fail and return a blank image. As a result, you will observe an empty black image.
This property gives you an opportunity to handle this situation. For example:
*=Thumbnail;SourceFile
. In this case, if the image is blank, it will notice the failure and switch to a fallback converter (SourceFile
). To speed things up, the algorithm does not check 100% of pixels. It breaks the image into a grid and selects certain pixels based on this grid. It works great with photos, but if you are uploading images with large amount of transparent pixels, it may produce false positives. Be careful!
If necessary, you may fine-tune the algorithm. To do it, instead of a number, pass the following JSON:
{ step : 10, // grid size topPadding : 0, // offset from the top in percent leftPadding : 0, // offset from the left border in percent rightPadding : 0, // offset from the right border in percent bottomPadding : 0, // offset from the bottom in percent attemptCount : 0 // the number you would pass to this param normally }