Jump to content


Photo

Image Magick Not Creating Some Image Sizes


If an Image is uploaded that is smaller than the resize dimensions, that particular image is not created. As an example the small image dimension setting is 240 but the image being uploaded is 100x100

admin/applications_addon/gallery/sources/classes/gallery/image.php (line 2234)

$return = $img->resizeImage( $this->settings['gallery_size_small'], $this->settings['gallery_size_small'] );

in resizeImage() in classImageImagemagick we return early with;

    return array( 'originalWidth'  => $this->orig_dimensions['width'],
		  'originalHeight' => $this->orig_dimensions['height'],
		  'newWidth'	   => $this->orig_dimensions['width'],
		  'newHeight'	  => $this->orig_dimensions['height'],
		 'noResize'    => true );

This means that the creation of the temp files lower down in that function never occurs.

Going back to the image helper (line 2242)

if ( $img->writeImage( $small ) )

this fails because the temporary image wasn't created

   	 if( !is_file( $this->temp_file ) )
        {
             $this->error = 'temp_image_not_exists';
             return false;
        }

Status: Not a Bug
Version: 4.2.1
Fixed In:


1 Comments

GD does the same thing. There's no point in creating 4 files all the same size that I can see. Gallery should already account for this.