- Posts: 663
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- creat thumbnail by width and height. you can input height value on K2 control center
creat thumbnail by width and height. you can input height value on K2 control center
- BBC
- Offline
- Platinum Member
Less
More
13 years 4 months ago #75440
by BBC
Replied by BBC on topic creat thumbnail by width and height. you can input height value on K2 control center
Don´t call it my script. :)
Please Log in or Create an account to join the conversation.
- juju
- Offline
- Premium Member
Less
More
- Posts: 119
13 years 4 months ago #75441
by juju
Replied by juju on topic creat thumbnail by width and height. you can input height value on K2 control center
Ok, if I want to crop (zoom if needed) to have a full image, how I can do ?
Thanks ;)
Thanks ;)
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 4 months ago #75442
by BBC
Replied by BBC on topic creat thumbnail by width and height. you can input height value on K2 control center
Use that link above. All there is allowed to use in K2. If your server supports it.$handle->image_ratio_crop = true; (I guess default is center crop ?)or calculate byself$handle->image_crop = array(50,40,30,20); OR '-20 20%'...
Please Log in or Create an account to join the conversation.
- juju
- Offline
- Premium Member
Less
More
- Posts: 119
13 years 4 months ago #75443
by juju
Replied by juju on topic creat thumbnail by width and height. you can input height value on K2 control center
Ok, so tomorrow I'll test that :
//Medium image $handle->image_resize = true; $handle->image_ratio_crop = true; $handle->image_convert = 'jpg'; $handle->image_ratio_fill = true; $handle->image_background_color = '#000000'; $handle->jpeg_quality = $params->get('imagesQuality'); $handle->file_auto_rename = false; $handle->file_overwrite = true; $handle->file_new_name_body = $filename.'_M'; if (JRequest::getInt('itemImageM')) { $imageWidth = JRequest::getInt('itemImageM'); } else { $imageWidth = $params->get('itemImageM', '100'); } if (JRequest::getInt('itemImageM_Height')) { $imageHeight = JRequest::getInt('itemImageM_Height'); } else { $imageHeight = $params->get('itemImageM_Height', '115'); } $handle->image_x = $imageWidth; $handle->image_y = $imageHeight; $handle->Process($savepath);
Is that right, I just replace the second line.
//Medium image $handle->image_resize = true; $handle->image_ratio_crop = true; $handle->image_convert = 'jpg'; $handle->image_ratio_fill = true; $handle->image_background_color = '#000000'; $handle->jpeg_quality = $params->get('imagesQuality'); $handle->file_auto_rename = false; $handle->file_overwrite = true; $handle->file_new_name_body = $filename.'_M'; if (JRequest::getInt('itemImageM')) { $imageWidth = JRequest::getInt('itemImageM'); } else { $imageWidth = $params->get('itemImageM', '100'); } if (JRequest::getInt('itemImageM_Height')) { $imageHeight = JRequest::getInt('itemImageM_Height'); } else { $imageHeight = $params->get('itemImageM_Height', '115'); } $handle->image_x = $imageWidth; $handle->image_y = $imageHeight; $handle->Process($savepath);
Is that right, I just replace the second line.
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 4 months ago #75444
by BBC
Replied by BBC on topic creat thumbnail by width and height. you can input height value on K2 control center
"Crop" an "Fill" are in contradiction, but you can try. I guess it wont work.
It is one or another.
It is one or another.
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 4 months ago #75445
by BBC
Replied by BBC on topic creat thumbnail by width and height. you can input height value on K2 control center
You can try to achieve it with statements "if" and "else". But there i can´t help you.
Please Log in or Create an account to join the conversation.
- juju
- Offline
- Premium Member
Less
More
- Posts: 119
13 years 4 months ago #75446
by juju
Replied by juju on topic creat thumbnail by width and height. you can input height value on K2 control center
Ok, so I delete the line who talk about ratio, ratio_fill, image_background_color and I put the line about ratio_crop, right ?
I'll test it tomorrow and I'll see if it's work :)
I'll test it tomorrow and I'll see if it's work :)
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 4 months ago #75447
by BBC
Replied by BBC on topic creat thumbnail by width and height. you can input height value on K2 control center
This works for center crop, tested:
$handle->image_resize = true;$handle->image_convert = 'jpg';$handle->jpeg_quality = $params->get('imagesQuality');$handle->file_auto_rename = false;$handle->file_overwrite = true;$handle->file_new_name_body = $filename.'_L';if (JRequest::getInt('itemImageL')) {$imageWidth = JRequest::getInt('itemImageL');} else {$imageWidth = $params->get('itemImageL', '600');}if (JRequest::getInt('itemImageL_height')) {$imageHeight = JRequest::getInt('itemImageL_height');} else {$imageHeight = $params->get('itemImageL_height', '600');}$handle->image_x = $imageWidth;$handle->image_y = $imageHeight;$handle->image_ratio_crop = true;$handle->Process($savepath);
$handle->image_resize = true;$handle->image_convert = 'jpg';$handle->jpeg_quality = $params->get('imagesQuality');$handle->file_auto_rename = false;$handle->file_overwrite = true;$handle->file_new_name_body = $filename.'_L';if (JRequest::getInt('itemImageL')) {$imageWidth = JRequest::getInt('itemImageL');} else {$imageWidth = $params->get('itemImageL', '600');}if (JRequest::getInt('itemImageL_height')) {$imageHeight = JRequest::getInt('itemImageL_height');} else {$imageHeight = $params->get('itemImageL_height', '600');}$handle->image_x = $imageWidth;$handle->image_y = $imageHeight;$handle->image_ratio_crop = true;$handle->Process($savepath);
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
13 years 4 months ago #75448
by BBC
Replied by BBC on topic creat thumbnail by width and height. you can input height value on K2 control center
It is OK, taste thing. Don´t complain if "Obama ends in picture without a head". :)
Please Log in or Create an account to join the conversation.
- juju
- Offline
- Premium Member
Less
More
- Posts: 119
13 years 4 months ago #75449
by juju
Replied by juju on topic creat thumbnail by width and height. you can input height value on K2 control center
hihi, thanks ;)
I forget something, if I already have some thumbnail created on my website, how it works when I put this script ?
I forget something, if I already have some thumbnail created on my website, how it works when I put this script ?
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- creat thumbnail by width and height. you can input height value on K2 control center