Welcome Guest, Not a member yet? Register   Sign In
Image resize issue (2 in a row)
#1

[eluser]alexdemers[/eluser]
Hey,

I have been struggling for an hour with a dozen lines of code and I can't find the issue.
Code:
// Do the thumbnailing
$thumb_config['image_library'] = 'gd2';
$thumb_config['source_image'] = $fullpath;
$thumb_config['create_thumb'] = true;
$thumb_config['maintain_ratio'] = true;
$thumb_config['master_dim'] = 'width';
$thumb_config['new_image'] = $path_fixed . 'images/products/thumbs/'.$filename;

$thumb_config['width'] = '48';
$thumb_config['thumb_marker'] = '_48';

print_r($thumb_config);
$this->image_lib->initialize($thumb_config);
$this->image_lib->resize();
$this->image_lib->clear();

$thumb_config['width'] = '125';
$thumb_config['thumb_marker'] = '_125';

print_r($thumb_config);
$this->image_lib->initialize($thumb_config);
$this->image_lib->resize();


The second thumbnail gets created successfully but the first one's "maintaint_ratio" property gets ignored completly.

Here's a screen shot of my I get: http://imgur.com/3ILzA.png

The _125 has 125x94 and the _48 has 48x768 which is the original height of the image.

What am I doing wrong here?

Thanks


Edit: Oh, and the output of print_r's are both the same:
Code:
Array
(
    [image_library] => gd2
    [source_image] => /images/products/originals/nqpoiyad7avauacw.jpg
    [create_thumb] => 1
    [maintain_ratio] => 1
    [master_dim] => width
    [new_image] => /images/products/thumbs/nqpoiyad7avauacw.jpg
    [width] => 48
    [thumb_marker] => _48
)
Array
(
    [image_library] => gd2
    [source_image] => /images/products/originals/nqpoiyad7avauacw.jpg
    [create_thumb] => 1
    [maintain_ratio] => 1
    [master_dim] => width
    [new_image] => /images/products/thumbs/nqpoiyad7avauacw.jpg
    [width] => 125
    [thumb_marker] => _125
)


Messages In This Thread
Image resize issue (2 in a row) - by El Forum - 10-04-2009, 08:46 PM
Image resize issue (2 in a row) - by El Forum - 10-04-2009, 11:46 PM
Image resize issue (2 in a row) - by El Forum - 10-07-2009, 01:51 PM
Image resize issue (2 in a row) - by El Forum - 10-07-2009, 09:13 PM
Image resize issue (2 in a row) - by El Forum - 12-02-2009, 03:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB