Welcome Guest, Not a member yet? Register   Sign In
Image resize on JPGs - resized image appears as tiny thumb on black background
#1

[eluser]w1ntermut3[/eluser]
Using resize as:

Code:
$config['image_library'] = 'gd2';
$config['source_image'] = $save_path. $upload_data['file_name'];
$config['maintain_ratio'] = TRUE;
$config['master_dim'] = 'width';
$config['width'] = 250;
$config['height'] = 100000;

$ci->image_lib->initialize($config);
if ( ! $ci->image_lib->resize()){
echo $ci->image_lib->display_errors();
}
$ci->image_lib->resize();
$ci->image_lib->clear();

I upload a 797 x 1024 image, and expect it to be resized down to 250 wide, maintaining aspect ratio. What I get is this:

http://www.bencasey.co.uk/resize-wrong.jpg

Well, it's got the aspect ratio right I guess. The image IS 250 wide, and a corresponding height. However, most of the image is, in fact, not my image at all but a large expanse of black, with the actual image - at the correct aspect ratio - confined to a tiny thumb area at the top.

There seem to be a few posts regarding unwanted black backgrounds, but they're working with GIF/PNG transparency. This is on JPGs.

Why is it doing this, and how do I stop it?



Messages In This Thread
Image resize on JPGs - resized image appears as tiny thumb on black background - by El Forum - 02-27-2012, 04:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB