Gets or sets a value specifying what to do if the browser does not allow creating resized copies of specified size.
public function getAutoReduceDimensions() { } public function setAutoReduceDimensions($value) { }
Type: boolean
If true
, the browser will try to produce an image of smaller size (max possible in this browser). Otherwise, it will fail and no image is uploaded.
Default value is true.
Not all browsers are memory friendly enough to generate large images. For example, Safari on iOS cannot create image larger than 5Mpix (very old iPhones - not more than 2MPix). Firefox and IE are limited by 32Mpix.
This parameter is used to define a strategy, the uploader should use to handle this situation. If you set true
, you say "give me as a large image as you are able to generate". However if it is not acceptable (for example, a user places an order for printing), you can set false
and the uploader will handle it as if it is a non-image file.
It makes sense setting it to false
only if you set the fallback option in the Mode property, for example "*=Thumbnail;SourceFile"
. This way you will receive an original file if the uploader failed to create a resized copy.