Part of the EllisLab Network

Bug Report

Image Lib, no resize, and dynamic output

Date: 08/04/2008 Severity: Major
Status: Resolved Reporter: mnk6
Version: 1.6.3
Keywords: Libraries, Image Manipulation Class

Description

When trying to resize an image to the same dimensions as the original output is to a file and not to dynamic output even if specified. Fix with the following on line 480 of Image_lib.php

if ($this->dynamic_output !== TRUE) {
      if ( ! @copy($this->full_src_path, $this->full_dst_path))
      {
          $this->set_error('imglib_copy_failed');
          return FALSE;
      }
      @chmod($this->full_dst_path, DIR_WRITE_MODE);
} else {
      if ( ! ($src_img = $this->image_create_gd()))
      {
          return FALSE;
      } else {
          $this->image_display_gd($src_img);
      }
} return TRUE;

Code Sample

$config = array(
        
'image_library' => 'gd2',
        
'source_image' => $path,
        
'create_thumb' => true,
        
'dynamic_output' => true,
        
'width' => $width,
        
'height' => $height,
        
'quality'=>90,
);
$this->load->library('image_lib', $config);
$this->image_lib->resize();

Expected Result

The source image dynamically outputted.

Actual Result

The source image copied with the thumb marker _thumb added to the filename.

Comment on Bug Report

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?