Reply to image_resize and JPEG filesize

image_resize and JPEG filesize new!
by Konstantin, 16 years, 9 months ago
Hi, Colin!
Now I try to execute the following algorithm:
1) the maximum size of a file is 300 kilobytes
2) the maximum sizes of a file is 1024*768 pixels
If the user has prepared in advance a file according to these rules, recalculation should not be made. And at me on an input volume of a file of 290 kilobyte, after upload I have 150 kilobytes. How it is possible to avoid recalculation?
$handle->image_resize            = true;
$handle->file_max_size           = '307200';
$handle->allowed                 = array('image/*');
$handle->file_new_name_body      = $add_data;
$handle->image_x                 = 1025;
$handle->image_y                 = 769;
$handle->image_ratio_no_zoom_in  = true;
$handle->image_min_width         = 100;
$handle->image_min_height        = 50;
$handle->process('gallery/data/');

Second question.
How I can forbid to upload the files which are distinct from JPEG? For example, if the user takes in head to upload GIF, and I do not want it? Whether it is possible to include $handle-> image_convert = ' jpg '; whether it will influence loading JPEG-files?

Thanks a lot. RegardsReply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important