Last modified on February 24th, 2017 by Vincy.
While displaying images for our websites, it is important to ensure that it could be set within our layout boundary. If not, we need to resize these images, accordingly. In PHP, resizing an image, it can be achieved by using a set of PHP functions to create a new image from scratch, with the given dimensions, in which the original image is expected to be resized.
So, a combination of such functions is used to obtain the following steps, which will result in successful image resize through PHP programming.
For working on the given image file to be resized, we need to get the resource identifier for reference, as we have done while after getting file resource, or like, getting directory handle to perform .
In PHP, there are various functions to get an image file resource id. These functions are used appropriately based on the type of image given for resizing. For example, imagecreatefromjpeg() , imagecreatefromgif() , imagecreatefrompng() , used to get the resource identifier for JPEG, GIF and PNG images.
In this step, first, we need to get image type by using PHP function getimagesize() , which is used for getting an entire list of image properties, including width, height and etc. After that, we can apply a suitable function to get the resource id. All these PHP functions used to get image properties and to get image file resource data expects name or path of the image file. For example,
$file = "christmas.jpg"; $source_properties = getimagesize($file); $image_type = $source_properties; if($image_type == IMAGETYPE_JPEG) { $image_resource_id = imagecreatefromjpeg($file); } elseif($image_type == IMAGETYPE_GIF) { $image_resource_id = imagecreatefromgif($file); } elseif($image_type == IMAGETYPE_PNG) { $image_resource_id = imagecreatefrompng($file); }
The used in conditional statements are predefined with appropriate integer value denotes image type. For example, IMAGETYPE_JPEG defined with value 2 which is used for indicating JPEG image.
After getting reference resource id from source image file, we need to create a new image as a target layer. This image will be created with the dimensions to what the original image is expected to be resized.
PHP built-in function, named as, imagecreatetruecolor() is used for this purpose, by accepting required dimensions, that is, the width and height of the target image. For example,
$target_width =200; $target_height =200; $target_layer=imagecreatetruecolor($target_width,$target_height);
imagecreatetruecolor() function will create empty image. Added to that, it will return resource data identifier as a reference to the newly created image with specified width and height parameter. This reference will be used in subsequent steps, for mentioning target, on top of which the resized image will be assembled.
For this step, we should provide a list of details about the source and the target image, that are used in image resize process. These are,
Using these details provided, required portion of the original image will be copied and reassembled onto the target layer. For that, PHP function, named as, imagecopyresampled() for such resizing and reassembling process. For example,
Imagecopyresampled($target_layer,$image_resource_id,0,0,0,0,$target_width,$target_height, $source_properties,$source_properties);
In this code sample, shown above, some of the arguments of this function are passed with 0 value. These arguments, actually, represents the x, y coordinates of target and source image, respectively.
These arguments will contain values for cropping some portion of the source image. Otherwise, there is no need to mention x,y points, meaning that, the entire image will be cropped to preserve its appearance as it is except its dimensions.
Note: There is an equivalent PHP function imagecopyresized() as like as imagecopyresampled() , whereas, the imagecopyresampled() function creates resized the image with more quality, comparatively.
Finally, it’s time for saving resized image to the target location. For that, we need to specify the following details.
Now, we can use the code sample shown below to save resized image layer.
Imagejpeg($target_layer,"christmas_thump.jpg");
Code sample shown in each step is applicable only for JPEG image. We can replicate the same for other image types by using appropriate PHP functions.
This example shows how to resize any type of image file uploaded from an HTML form. So, the PHP script is shown below handles the uploaded image file to be resized.
And the HTML code which includes the form container to upload image file is,
The uploaded image is stored in a directory of the server and the respective image name is inserted into the database. But if you want to upload an image without storing on the server, it can be done using MySQL database. If you’re concerned about the server space and need to free space on your server, you can insert an image file in the database without upload it to the directory. This procedure helps to optimize the server space because the image file content is stored in the database rather than the server.
In this tutorial, we will show you how to store the image file into MySQL database and retrieve image from database using PHP . It’s very easy to store and retrieve images from the database using PHP and MySQL.
MySQL has a BLOB (binary large object) data type that can hold a large amount of binary data. The BLOB data type is perfect for storing the image data. In MySQL, four BLOB types are available – TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB.
To store the image data a table needs to be created in the database. The following SQL creates images table with LONGBLOB data type field in the MySQL database.
CREATE TABLE `images ` (`id` int (11 ) NOT NULL AUTO_INCREMENT, `image` longblob NOT NULL , `created` datetime NOT NULL , PRIMARY KEY (`id` )) ENGINE= InnoDB DEFAULT CHARSET= utf8 COLLATE= utf8_unicode_ci;The following HTML form allows users to choose the image file to upload.
The upload.php file contains the following functionalities.
//DB details
In this file, we will retrieve the image content from the MySQL database based on the ID and display on the web page. To render image file in the web page, the Content-type header is used.
if(!empty($_GET [ "id" ])){Are you want to get implementation help, or modify or extend the functionality of this script?
Уважаемый Юрий, Если можете, прошу внести эти дополнения в каталог „Сирены”, составленный А.И.Железным, Есть много нового, интересного материала:1017 Марш из оп-ты „Веселая вдова” – орк. Л-Гв. Волынского полка
1018 Иду к Максиму из оп-ты „Веселая вдова” – орк. Л-Гв. Волынского полка
1049 Боже Царя храни – дух. орк. п/у Герпина
1050 За Царя и отечество - дух. орк. п/у Герпина
1124 Ты танцуешь словно из оп-ты „Разведенная жена” – духовой оркестр
1251 Моя радость – духовой оркестр
1253 О! Сусанна – орк. Л-Г полка короля Франца Иосифа в Берлине
1272 Лесныя звуки – орк. Л-Г полка короля Франца Иосифа в Берлине
1290 Вальс из оп-ты „Веселая вдова” – орк. т-ва „Сирена Рекорд”
2303 Спи, моя желанная – П.И.Батори с акк. гитары
3227 Максис – орк. венгерских цыган п/у К.Дулеско
3228 Фургана – орк. венгерских цыган п/у К.Дулеско
3241 Мирелла – орк. венгерских цыган п/у К.Дулеско
3242 Танго – орк. венгерских цыган п/у К.Дулеско
3244 Эль Чокло – орк. венгерских цыган п/у К.Дулеско
3248 Амана – орк. венгерских цыган п/у К.Дулеско
3249 Танго любви – орк. венгерских цыган п/у К.Дулеско
3250 Жоакино (арг.танго) – орк. венгерских цыган п/у К.Дулеско
3251 Мексиканский (арг.танго) – орк. венгерских цыган п/у К.Дулеско
3252 Эль Чокло – духовой оркестр
3253 Кубинец – орк. венгерских цыган п/у К.Дулеско
3260 Эль ирресистибле – орк. венгерских цыган п/у К.Дулеско
3261 Танго Бресилиен – орк. венгерских цыган п/у К.Дулеско
3262 Ребятишки молодцы – дух.орк. Сумского гренадёрского полка
3263 Молодыя силы – дух.орк. Сумского гренадёрского полка
3264 Шопот любви – дух.орк. Сумского гренадёрского полка
3265 На прощание – дух.орк. Сумского гренадёрского полка
3267 Козачёк Кроповницкого – орк. 14 Гусарского Митавского полка
3268 Козачек Садовского – орк. 14 Гусарского Митавского полка
3269 Опять хотелось тебя видеть – орк. венгерских цыган п/у К.Дулеско
3271 Муки истерзанной души – орк. венгерских цыган п/у К.Дулеско
3272 Берёзка – орк. венгерских цыган п/у К.Дулеско
3273 Тhe Phantom Bridge – орк. венгерских цыган п/у К.Дулеско
3273’- Танго Макс Линдер танцует – орк. полка Франца Иосифа в Берлине
3275 Признание – орк. полка Франца Иосифа в Берлине
3287 Дедушка – духовой оркестр
3288 Смешка – духовой оркестр
3289 Дни нашей жизни – духовой оркестр
3290 Разбитая жизнь – духовой оркестр
3291 Семь сорок – духовой оркестр
3292 Молдавянка-Суббота – духовой оркестр
3293 Коханочка – духовой оркестр
3294 Крестьяночка – духовой оркестр гусарского полка п/у П.Фролова
3307 Скакун – народная капелла
3308 Квитка – народная капелла
3353 Ростовский юбилейный марш – орк. полка Франца Иосифа в Берлине
3354 Ченстоховский юбилейный марш – орк. полка Франца Иосифа в Берлине
3355 Дни нашей жизни – орк. полка Франца Иосифа в Берлине
3356 Нежныя розы – орк. полка Франца Иосифа в Берлине
3357 Разлука – орк. полка Франца Иосифа в Берлине
3358 Не раз люби – орк. полка Франца Иосифа в Берлине
3359 Поппури из оп-ты “Ночь любви” – орк. полка Франца Иосифа в Берлине
3360 Поппури из оп-ты “Ночь любви” (ок.) – орк. полка Франца Иосифа в Берлине
3361 Aтаманская полька – орк. полка Франца Иосифа в Берлине
3362 Донская козачка – орк. полка Франца Иосифа в Берлине
3370 Восточный марш – орк. гренадёрского полка гвардии п/у И.Иванова
3371 Армянский марш – орк. гренадёрского полка гвардии п/у И.Иванова
3373 – Сон жизни – орк. гренадёрского полка гвардии п/у И.Иванова
3374 На шведской могиле – орк. гренадёрского полка гвардии п/у И.Иванова
3375 Конец моим терзаниям – орк. гренадёрского полка гвардии п/у И.Иванова
3389 На развалинах Белгии – орк. Л-Г Волынского полка п/у Е.Павелка
3390 Сыганския ласки – орк. гренадёрского полка гвардии п/у И.Иванова
3391 Бальный менует – орк. гренадёрского полка гвардии п/у И.Иванова
3402 Русско – славянский танец – орк. Л-Г Волынского полка п/у Е.Павелка
8509 Тыроляна из оп. „Пташник из Тирола” – Л.Мессаль
8560 Цыганский марш – духовой оркестр
8563 Пастеречка – Мария Хавеау [артистка театра „Новости” в Варшаве]
8565 Гвардеец – Мария Хавеау [артистка театра „Новости” в Варшаве]
8594 Ноеть печень, ноют почки – С.Ф.Сарматов
8597 Тяжело, тяжело жить – С.Ф.Сарматов
8606 Ты помнишь-ли – А.Г.Сибиряков
8658 Ночи безумные – К.В.Баянов
8662 Зачем вы меня погубили – К.В.Баянов
8666 Ты помнишь-ли – К.В.Баянов
8667 И не могу – и все люблю – К.В.Баянов
8774a Народная мазурка – духовой оркестр
9289 Пожар Московский – орк. гарм. Соловьева и Бруева
9290 Гибель Варяга – орк. гарм. Соловьева и Бруева
9307 Живо, живее целуй меня – А.Карлович
9310 Тра-ля-ля – г-н и г-жа Бершадские
9311 Почему я безумно люблю – А.Карлович
9380 Я не скажу тебе – П.М.Корпус
9396 Чёрна хмара у дiброви из оп. “Запорожец за Дунаем” – Федько и Федоровский (малоросс.дуэт)
9397 Ой казала менi матi Федько и Федоровский (малоросс.дуэт)
9398 Ой гиля гиля Федько и Федоровский (малоросс.дуэт)
9400 Козак виизжае - Федько и Федоровский (малоросс.дуэт)
9744 Полковой марш – орк. Л-Г Кексгольмского полка п/у В.Вилды
9988 Абрам, Абрам – П.Кельтер
9990 А бривеле дер Кале – П.Кельтер
10509 А йид бин их – Я.Лерман
10543 Шантекллиер – Е.А.Морская – Волна
12892 Голосом жизнь спасл – Бим-Бом
12896 Человек и его душа – Бим-Бом
12898 Кто есть счастливым и несчастливым в мире – Бим-Бом
13371 Сувайце танго – М.Домославски и Г.Орлеанска; oкрестр
13372 Макарони – М.Домославски и Г.Орлеанска; oкрестр
After you or your users have uploaded image assets to Cloudinary, you can deliver them via dynamic URLs. You can include instructions in your dynamic URLs that tell Cloudinary to manipulate your assets using a set of transformation parameters. All manipulations are performed automatically in the cloud and your transformed assets are automatically optimized before they are routed through a fast CDN to the end user for optimal user experience.
For example, you can resize and crop, add overlay images, blur or pixelate faces, apply a large variety of special effects and filters, and apply settings to optimize your images and to deliver them responsively.
Cloudinary"s PHP library simplifies the generation of transformation URLs for easy embedding of assets in your PHP application.
You can deliver your images using methods the generate image tags or via direct URL-building directives.
You can add images to your PHP view using Cloudinary"s cl_image_tag helper method. This method generates the full image resource URL based on the given transformation parameters and adds the image tag to your HTML code:
cl_image_tag(" sample " );
The code above generates the following HTML image tag:
"
https://res.сайт/demo/image/upload/sample
"
>
You can also include transformation parameters in the request, for example, to deliver a JPEG image padded to a width of 400 pixels:
cl_image_tag(" sample.jpg " , array (" width " => 400 , " crop " => " pad " ));
You can either add transformations directly to your cl_image_tag method (all transformations will be in a single, flat component of the resulting URL source, as above), or you can define them with the transformation parameter.
cl_image_tag(" sample.jpg " , array (" transformation " => array (" width " => 400 , " crop " => " pad " )));
Cloudinary supports powerful transformations. You can even combine multiple transformations together as part of a single transformation request, e.g. crop an image and add a border. In certain cases you may want to perform additional transformations on the result of the previous transformation request. To do that, you can use chained transformations.
To apply chained transformations in a transformation URL, you include multiple transformation components separated by "/". Each transformation component is applied to the result of the previous one. In PHP, applying multiple transformations is done by specifying the transformation parameter as an array of transformation arrays. The following example first crops the original image to a specific set of custom coordinates and then transforms the result so it fills a 130x100 rectangle:
cl_image_tag(" brown_sheep.jpg " , array (" transformation " =>array (array (" x " =>355 , " y " =>410 , " width " =>300 , " height " =>200 , " crop " =>" crop " ), array (" width " =>130 , " height " =>100 , " crop " =>" fill " ))))
The following example applies 4 chained transformations: custom cropping to 300x200, fill to 130x100, rotate by 20 degrees and then scale to 50%:
cl_image_tag(" brown_sheep.jpg " , array (" transformation " =>array (array (" x " =>355 , " y " =>410 , " width " =>300 , " height " =>200 , " crop " =>" crop " ), array (" width " =>130 , " height " =>100 , " crop " =>" fill " ), array (" angle " =>20 ), array (" width " =>0.5 , " crop " =>" scale " ))))
For more information on image transformations, see .
The cl_image_tag method described above generates an HTML image tag. In certain conditions, you might want to generate a transformation URL directly, without the containing image tag. To return only the URL, either use the cloudinary_url view helper method. Here are few examples:
cloudinary_url(" sample.jpg " , array (" width " => 100 , " height " => 150 , " crop " => " fill " )); // Output: "https://res..jpg"
cloudinary_url(" sample_spreadsheet.xls " , array (" resource_type " => " raw " )); // Output: "https://res..xls"
This section provides an overview and examples of the following commonly used image transformation features, along with links to more detailed documentation on these features:
Keep in mind that this section is only intended to introduce you to the basics of using image transformations with PHP.
For comprehensive explanations of how to implement a wide variety of transformations, see Image transformations . For a full list of all supported image transformations and their usage, see the Image transformation reference .
There are a variety of different ways to resize and/or crop your images, and to control the area of the image that is preserved during a crop.
The following example uses the fill cropping method to generate and deliver an image that completely fills the requested 250x250 size while retaining the original aspect ratio. It uses face detection gravity to ensure that all the faces in the image are retained and centered when the image is cropped:
Original image
Fill cropping with "faces" gravity
For details on all resizing and cropping options, see
You can deliver any image uploaded to Cloudinary in essentially any image format. There are 3 main ways to convert and deliver in another format:
Deliver a .jpg file in .gif format:
Let Cloudinary select the optimal format for each browser. For example, in Chrome, this image delivers in .webp format.
You can select from a large selection of image effects, enhancements, and filters to apply to your images. The available effects include a variety of color balance and level effects, tinting, blurring, pixelating, sharpening, automatic improvement effects, artistic filters, image and text overlays, distortion and shape changing effects, outlines, backgrounds, shadows, and more.
For example, the code below applies a cartoonify effect, rounding corners effect, and background color effect (and then scales the image down to a height of 300 pixels).
cl_image_tag(" actor.jpg " , array (" transformation " =>array (array (" effect " =>" cartoonify " ), array (" radius " =>" max " ), array (" effect " =>" outline:100 " , " color " =>" lightblue " ), array (" background " =>" lightblue " ), array (" height " =>300 , " crop " =>" scale " ))))

For more details on the available image effects and filters, see Applying image effects and filters
You can add images and text as overlays on your main image. You can apply the same types of transformations on your overlay images as you can with any image and you can use gravity settings or x and y coordinates to control the location of the overlays. You can also apply a variety of transformations on text, such color, font, size, rotation, and more.
For example, the code below overlays a couple"s photo on a mug image. The overlay photo is cropped using face detection with adjusted color saturation and a vignette effect applied. The word love is added in a pink, fancy font and rotated to fit the design. A balloon graphic is also added. Additionally, the final image is cropped and the corners are rounded.
cl_image_tag(" coffee_cup.jpg " , array (" transformation " =>array (array (" width " =>400 , " height " =>250 , " gravity " =>" south " , " crop " =>" fill " ), array (" overlay " =>" nice_couple " , " width " =>1.3 , " height " =>1.3 , " gravity " =>" faces " , " flags " =>" region_relative " , " crop " =>" crop " ), array (" effect " =>" saturation:50 " ), array (" effect " =>" vignette " ), array (" flags " =>" layer_apply " , " width " =>100 , " radius " =>" max " , " gravity " =>" center " , " y " =>20 , " x " =>-20 , " crop " =>" scale " ), array (" overlay " =>" balloon " , " height " =>55 ), array (" effect " =>" hue:-20 " , " angle " =>5 ), array (" flags " =>" layer_apply " , " x " =>30 , " y " =>5 ), array (" overlay " =>array (" font_family " =>" Cookie " , " font_size " =>40 , " font_weight " =>" bold " , " text " =>" Love " ), " effect " =>" colorize " , " color " =>" #f08 " ), array (" angle " =>20 , " flags " =>" layer_apply " , " x " =>-45 , " y " =>44 ), array (" width " =>300 , " height " =>250 , " x " =>30 , " crop " =>" crop " ), array (" radius " =>60 ))))

For an in-depth review of the many ways you can optimize your images, see Image optimization
Responsive web design is a method of designing websites to provide an optimal viewing experience to users, irrespective of the device, window size, orientation, or resolution used to view it. Ensuring that optimal experience means you should avoid sending high resolution images that get resized client-side, with significant bandwidth waste for users of small displays. Instead, you should always deliver the right size image for each device and screen size.
For example, you can ensure that each user receives images at the size and device pixel ratio (dpr) that fit their device using the auto value for the dpr and width attributes. The auto value is replaced with actual values on the client side based on the actual browser settings and window width:
cl_image_tag(" myphoto " , array (" transformation " => array (array (" dpr " => " auto " , " responsive " => TRUE , " width " => " auto " , " crop " => " scale " , " angle " => 20 ), array (" effect " => " art:hokusai " , " : " border" => " 3 px_solid_rgb:00390 b " , " radius" => 20))));
Cloudinary offers several options for simplifying the complexity of delivering responsive images. For a detailed guide on how to implement these options, see
Вы наверняка задавались вопросом «Что это за цифры и где мой путь к картинке?» 🙂 Давайте разберем несколько примеров, как с этим можно работать.
Файлы изображений нам обычно нужны, когда мы говорим за новости или товары. За такие поля, как правило, отвечают свойства элемента «Картинка для анонса » и «Детальная картинка «. Иногда, создают свойства инфоблока, тип этого свойства файл, и используют для дополнительных изображений (например, галерея товаров). Вся проблема в том, что Битрикс не даст вам сразу готовый путь к файлу изображения, или к его уменьшенной ресайз копии.
Советую для начала прочесть небольшую статью про вывод элементов на странице т.к. в дальнейшем мы столкнемся с похожим кодом.
if (CModule::IncludeModule("iblock")):
$iblock_id = 1;
$my_elements = CIBlockElement::GetList (Array("ID" => "ASC"),
Array("IBLOCK_ID" => $iblock_id),
false,
false,
Array("ID", "NAME", "DETAIL_PAGE_URL", "PREVIEW_PICTURE", "DETAIL_PICTURE"));
while($ar_fields = $my_elements->GetNext())
{
echo $ar_fields["PREVIEW_PICTURE"]."
";
}
endif;
?>
и на самом деле все отработало правильно, мы получили «код изображений», некий уникальный идентификатор файла, по которому мы сможем получить данные.
В 1С-Битрикс есть класс CFile — который используется для работы с файлами и изображениями. Мы воспользуемся его методом GetPath и получим полный путь к изображению на примере картинки для анонса (для детальной все точно также):
if (CModule::IncludeModule("iblock")):
$iblock_id = 1;
$my_elements = CIBlockElement::GetList (Array("ID" => "ASC"),
Array("IBLOCK_ID" => $iblock_id),
false,
false,
Array("ID", "NAME", "DETAIL_PAGE_URL", "PREVIEW_PICTURE", "DETAIL_PICTURE"));
while($ar_fields = $my_elements->
";
$img_path = CFile::GetPath($ar_fields["PREVIEW_PICTURE"]);
echo $img_path."
";
}
endif;
?>
Теперь у меня выводит:
/upload/iblock/c2a/c2a29aad47791f81f6fa8fd038d83789.jpg /upload/iblock/35e/35e000d0e7c3a94b32fb086c627f87eb.jpg /upload/iblock/088/08847400f3c59cae1371cf97009228a9.jpg
Отлично, это то что нужно. Теперь мы при помощи HTML тега img сможем задать картинке путь. Меняем нашу строчку с echo
Echo "
";
Перед тем как создать проект или новый инфоблок, всегда думайте «какого размера должны быть мои изображения «. Это очень важно, т.к. если вы не настроите в информационном блоке уменьшение картинки после загрузки, генерацию картинки анонса из детальной (если нужно) и прочие параметры, то размер вашей страницы может превышать несколько мегабайт (а в очень редких случаях даже больше 10 мб 🙂).
На самом деле, когда вы строго задаете размеры изображению, используя CSS, картинка все равно грузится в полном размере, и такие вещи не прокатят:
//HTML
//CSS
.my-prev-image {
width: 200px;
height: 200px;
}
Это не решит нашу проблему с размером исходного изображения на странице, и единственные допустимые правила, на мой взгляд, могут быть max-width и max-height .
Рассмотрим случай, когда у нас уже есть большие картинки и мы хотим получить их уменьшенные копии. Нам поможет метод CFile::ResizeImageGet . Его преимущество в том, что когда мы запускаем страницу, он создает картинки в папке /upload/resize_cache/путь — и если такая картинка уже есть, он автоматически вернет нам путь к ней. Кроме того, мы можем задавать любой размер, качество и даже вид масштабирования изображений.
Вот какие типы нам доступны (информация взята из официальной документации Битрикс ):
Давайте попробуем уменьшить наши картинки используя ResizeImageGet:
if (CModule::IncludeModule("iblock")):
$iblock_id = 1;
$my_elements = CIBlockElement::GetList (Array("ID" => "ASC"),
Array("IBLOCK_ID" => $iblock_id),
false,
false,
Array("ID", "NAME", "DETAIL_PAGE_URL", "PREVIEW_PICTURE", "DETAIL_PICTURE"));
while($ar_fields = $my_elements->GetNext())
{
//echo $ar_fields["PREVIEW_PICTURE"]."
";
//$img_path = CFile::GetPath($ar_fields["PREVIEW_PICTURE"]);
$img_resize_path = CFile::ResizeImageGet($ar_fields["PREVIEW_PICTURE"],
array("width"=>"100", "height"=>"150"),
BX_RESIZE_IMAGE_PROPORTIONAL);
//echo "
";print_r($img_resize_path);echo ""; echo "
$img_resize_path[‘src’] — надеюсь вы заметили что этот метод возвращает нам массив, и нам нужен только src .
Разберем по порядку:
$ ar_ fields[« PREVIEW_ PICTURE»] — поле для кода файла (для детальной меняем на $ar_fields[«DETAIL_PICTURE»]),
array(‘ width’=>’100′, ‘ height’=>’150′) — размеры итогового изображения (или вышеупомянутый arSize),
BX_ RESIZE_ IMAGE_ PROPORTIONAL — тип масштабирования, про котором наши изображения не будут вылазить за указанные границы.
В официальной документации этого метода есть подробное описание, кроме того, там описываются остальные 4 параметра, которые мы тут не использовали (InitSizes, Filters, Immediate, jpgQuality) .