Error while processing image

See all posts Reply

Error while processing image new!
by Viper, 13 years ago
When class processing an image I'm get an error

Warning: array_key_exists() expects parameter 2 to be array, null given in upload.php on line 2531
Warning: array_key_exists() expects parameter 2 to be array, null given in upload.php on line 2532
Warning: array_key_exists() expects parameter 2 to be array, null given in upload.php on line 2533


Error raises in getcolors method. But file uploading and processing successful.
Any ideas?

PS! My code
if ($_FILES['v_thumb_img_upload']['name']) {
  $params = &JComponentHelper::getParams('com_mycomponent');
  include(JPATH_COMPONENT.DS.'libraries'.DS.'uploads'.DS.'upload.php');

  set_time_limit(3600);
  clearstatcache();

  $sys_path = $params->get('ka_path_scr_trailer');
  $filename_prefix = 'tr_';
  $temp_filename = $filename_prefix.$tr_id;
  $handle = new upload($_FILES['v_thumb_img_upload']);
  $handle->file_max_size = $params->get('ka_max_filesize');
  $handle->allowed = array('image/*');

  if ($handle->uploaded) {
    $handle->file_new_name_body = 'thumb_'.$filename_prefix.$movie_id.'_';
    $handle->file_name_body_add = $tr_id;
    $handle->image_resize = true;
    $handle->jpeg_quality = $params->get('ka_thumbnail_quality');
    $handle->image_x = $params->get('ka_size_scr_x');
    $handle->image_ratio_y = true;
    $handle->image_convert = $params->get('ka_upload_imgtype');

    // If need watermarked so do it
    if ($params->get('ka_watermark') == 1) {
      if (file_exists($params->get('ka_path_wt_image'))) {
        $handle->image_watermark = $params->get('ka_path_wt_image');
        $handle->image_watermark_position = $params->get('ka_image_watermark_position');
        $handle->image_watermark_x = $params->get('ka_image_watermark_x');
        $handle->image_watermark_y = $params->get('ka_image_watermark_y');
        $handle->image_watermark_no_zoom_in = (bool)$params->get('ka_image_watermark_no_zoom_in');
        $handle->image_watermark_no_zoom_out = (bool)$params->get('ka_image_watermark_no_zoom_out');
      } else {
        $handle->image_text = $params->get('ka_watermark_text');
        $handle->image_text_position = $params->get('ka_image_watermark_position');
        $handle->image_text_padding_x = (int)$params->get('ka_watermark_text_padd_x');
        $handle->image_text_padding_y = (int)$params->get('ka_watermark_text_padd_y');
        $handle->image_text_background = '#'.$params->get('ka_watermark_text_color');
        $handle->image_text_background_percent = (int)$params->get('ka_watermark_text_opacity');
      }
    }
    $handle->process($sys_path.$sys_part_path.DS.$tr_id.DS);

    if ($handle->processed) {
      $result_file_path = $sys_part_path.'/'.$movie_id.'/'.$handle->file_dst_name;
      $img_size_x = $handle->image_dst_x;
      $img_size_y = $handle->image_dst_y;
    } else {
      echo JError::raiseError(500, $handle->error.' '.$handle->log);
    }
  }

  $handle->clean();
  unset($handle);
}
Reply
Re: Error while processing image new!
by Viper, 13 years ago
I'm located an error. If we set 'image_text_background' but variable an empty or set to '#' we got an errors. Should we setup additionally checking for this?Reply
Re: Error while processing image new!
by colin, 13 years ago
Yes, I will add some more checking on the next version. Thank you.Reply