problem in uploading JPG files

See all posts Reply

problem in uploading JPG files new!
by cris, 17 years, 6 months ago
first of all .. this is a great work. i love it. i am trying to use the class and it seems to work great but i meet a problem when i am testing it with the JPG format. The images i am trying to upload are from my personal camera and have the extension .JPG(uppercase).Can you please help me with this problem. the code i use is
if ($handle->uploaded) {
   $handle->image_convert = 'jpg';
   $handle->jpeg_quality  = 80;
   $handle->file_max_size = '40000000'; 
}
Reply
Re: the full code is here new!
by cris, 17 years, 6 months ago
include('../includeClasses/class.upload.php');
$files = array();
foreach ($_FILES['insert'] as $k => $l) {
  foreach ($l as $i => $v) {
    if (!array_key_exists($i, $files)) 
      $files[$i] = array();
    $files[$i][$k] = $v;
  }
}
$t=1;
foreach ($files as $file) {
  $handle = new Upload($file);
  if ($handle->uploaded) {
    $handle->image_convert         = 'jpg';
    $handle->jpeg_quality          = 80;
    $handle->file_max_size = '40000000'; 
    $handle->Process("../images/unprocessed/");
    $handle->image_convert         = 'jpg';
    $handle->jpeg_quality          = 80;
    $handle->image_resize         = true;
    $handle->image_ratio_y        = true;
    $handle->image_x              = 140;
    $handle->image_text           = 'eLaHoL';
    $handle->image_text_direction  = 'v';
    $handle->image_text_font       = 2;
    $handle->image_text_position   = 'BL';
    $handle->image_text_padding_x  = 2;
    $handle->image_text_padding_y  = 8;
    $handle->file_max_size = '40000000'; 
    $handle->Process("../images/thumbs/");
    $handle->image_convert         = 'jpg';
    $handle->jpeg_quality          = 80;
    $handle->image_text            = 'eLaHoL';
    $handle->image_text_direction  = 'v';
    $handle->image_text_percent    = '100';
    $handle->image_text_x  		   = '12';
    $handle->image_text_y          = '12';
    $handle->image_text_font       = 10;
    $handle->image_text_percent    = 80;
    $handle->image_text_position   = 'BL';
    $handle->image_resize          = true;
    $handle->image_ratio_y         = true;
    $handle->image_x               = 400;
    $handle->file_max_size = '40000000'; 
    $handle->Process("../images/natural/");
  }
}
Reply
Re: the full code is here new!
by colin, 17 years, 6 months ago
Are you using the last version of the class (0.21RC)?
Are you on Windows or Unix?

Is the class working when you upload the same images, but with lowercase extension?Reply
Re: the full code is here new!
by cris, 17 years, 6 months ago
Fist of all thank you for your help and forgive my bad english. I am trying to use it on unix system and i am using the 0.20 version. The class works great on windows with apache (locally tested not on an online server) and i try to test it online on a unix server and it seems to have the problem. I tested it with lowercase extension and it still doesnt work. it stops the whole procedure.
i am afraid that it is due to the size of the images because it works with very small images great. when the image is over 300KB it seems to have a problem. I think that this class is a Great Work and i am asking for you help to overcome this limitation. thank you very muchReply
Re: the full code is here new!
by colin, 17 years, 6 months ago
You probably are running out of memory. See this thread

Try to raise your local memory to 20M, 32M or more.

You can add this in your script:
ini_set ( "memory_limit", "20M")

Or in a .htaccess file:
php_value memory_limit 20M
Reply