Joomla - Image resize

See all posts Reply

Joomla - Image resize new!
by Thomas Dill, 15 years, 6 months ago
Hallo! Ich habe die class.upload.php in meine Joomla-Komponente eingefügt. Folgendes ist meine Image Klasse:

class Image {
  function saveImage($image,$newName, $path, $image_size, $thumb_size) {
    $newName = str_replace (array("ä", "ö", "ü", "ß", "Ä", "Ö", "Ü", " "),
                            array("ae", "oe", "ue", "ss", "Ae", "Oe", "Ue", "_"),
                            $newName);
    if(substr($path, strlen($path)-1, 1) != DS) $path .= DS;
    if(substr($path, 0, 1) != DS) $path = DS . $path;
    $instance = new Image();
    $handle = new Upload($image);
    if ($handle->uploaded) {
      $handle->file_new_name_body   = $newName;
      $handle->image_resize         = true;
      $handle->image_x              = $image_size;
      $handle->image_ratio_y        = true;
      $handle->Process(JPATH_ROOT . $path);
      if ($handle->processed) {
        echo 'SUCCESS';
          $fileNames['image']       = $handle->file_dst_pathname;
        } else {
          echo 'error : ' . $handle->error;
        }
        //$handle->image_resize            = true;
        //$handle->image_ratio_y           = true;
        //$handle->image_x                 = $thumb_size;
        $handle->file_new_name_body      = $newName.'_small';
        $handle->Process(JPATH_ROOT . $path);
        if ($handle->processed) {
          echo 'SUCCESS';
          $fileNames['image_small']        = $handle->file_dst_pathname;
          $handle->Clean();
        } else {
          echo 'error : ' . $handle->error;
        }
      return $fileNames;
      }
    echo "ERROR";
    return null;
  }
}

Das Problem ist, dass es, sobald ich ein resize versuche zu machen, abbricht. Wenn ich nur ein Rename mache, funktioniert es. Kann mir jemand helfen?

Freundliche Grüsse
TomReply
Re: Joomla - Image resize new!
by Thomas Dill, 15 years, 6 months ago
Is there a size limit for resizing jpgs? With smaller jpg's it work...Reply
Re: Joomla - Image resize new!
by colin, 15 years, 6 months ago
You may run of memory for large images. If you have enough memory, there is no limits in the dimensions of the images you are resizing.

Search for memory in the site, or click here.

You can also check this post.Reply
Re: Joomla - Image resize new!
by colin, 15 years, 6 months ago
This forum doesn't speak German. Please write in EnglishReply
Re: Joomla - Image resize new!
by mic, 15 years, 5 months ago
Check the size of the image, divide this sum through 8 and you know the limit php can handle this image.Reply