- Posts: 23
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
- vanshion
- Topic Author
- Offline
- Junior Member
Less
More
14 years 10 months ago #75400
by vanshion
Replied by vanshion on topic creat thumbnail by width and height. you can input height value on K2 control center
Hi Lukas, after tested that. maybe something wasn't referred to.
of course,i can input Height value, then ever thumbnail' height equal to half of width
it means that won't work
of course,i can input Height value, then ever thumbnail' height equal to half of width
it means that won't work
Please Log in or Create an account to join the conversation.
- vtiger
- Offline
- Premium Member
Less
More
- Posts: 83
14 years 10 months ago #75401
by vtiger
Replied by vtiger on topic creat thumbnail by width and height. you can input height value on K2 control center
won't work at all? Some error messages? Error reporting on? What exactly is (not) happened..? First metod works?
Have you commented out //$handle->image_ratio_y = true; etc ;)
l
Have you commented out //$handle->image_ratio_y = true; etc ;)
l
Please Log in or Create an account to join the conversation.
- vanshion
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
14 years 10 months ago #75402
by vanshion
Replied by vanshion on topic creat thumbnail by width and height. you can input height value on K2 control center
of course , i do. $hanle->image_ration_y=false;
no error! everthing is normal
you are right! first method work. ($handle->image_y = $imageWidth*0.8; ) this way is work too
however, when i add height setting on K2 then input value of height. it's seem to invalidation. heght is also 200px.
no error! everthing is normal
you are right! first method work. ($handle->image_y = $imageWidth*0.8; ) this way is work too
however, when i add height setting on K2 then input value of height. it's seem to invalidation. heght is also 200px.
Please Log in or Create an account to join the conversation.
- vtiger
- Offline
- Premium Member
Less
More
- Posts: 83
14 years 10 months ago #75403
by vtiger
Replied by vtiger on topic creat thumbnail by width and height. you can input height value on K2 control center
is new height value from params stored in DB?..
Is possible "echo" that values?..
l
Is possible "echo" that values?..
l
Please Log in or Create an account to join the conversation.
- vanshion
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
14 years 10 months ago #75404
by vanshion
Replied by vanshion on topic creat thumbnail by width and height. you can input height value on K2 control center
I guess, it dose not get new height value , in fact, I have inputed it
can u have a try
Lukas said:is new height value from params stored in DB?.. Is possible "echo" that values?.. l
can u have a try
Lukas said:is new height value from params stored in DB?.. Is possible "echo" that values?.. l
Please Log in or Create an account to join the conversation.
- vanshion
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
14 years 10 months ago #75405
by vanshion
Replied by vanshion on topic creat thumbnail by width and height. you can input height value on K2 control center
param menu="hide" name="itemImageS_Height" type="text" default="200" size="4" label="Item Small image height (in px)" description=""
1.
2.
1.
2.
Please Log in or Create an account to join the conversation.
- vtiger
- Offline
- Premium Member
Less
More
- Posts: 83
14 years 10 months ago #75406
by vtiger
Replied by vtiger on topic creat thumbnail by width and height. you can input height value on K2 control center
It looks "doublesized" height. Hard to say without atleast look to your code in both files...
p.s. "$hanle->image_ration_y=false;" is exact typo? there is ration
p.s. "$hanle->image_ration_y=false;" is exact typo? there is ration
Please Log in or Create an account to join the conversation.
- vtiger
- Offline
- Premium Member
Less
More
- Posts: 83
14 years 10 months ago #75407
by vtiger
Replied by vtiger on topic creat thumbnail by width and height. you can input height value on K2 control center
Well, this is wrong:
if (JRequest::getInt('itemImageS')) {
$imageWidth = JRequest::getInt('itemImageS');
$imageHeight = JRequest::getInt('itemImageS_height');
} else {
$imageWidth = $params->get('itemImageS', '200');
$imageHeight = $params->get('itemImageS_height', '200');
}
should be? :
if (JRequest::getInt('itemImageS')) {
$imageWidth = JRequest::getInt('itemImageS');
} else {
$imageWidth = $params->get('itemImageS', '200');
}
if (JRequest::getInt('itemImageS_height')) {
$imageHeight = JRequest::getInt('itemImageS_height');
} else {
$imageHeight = $params->get('itemImageS_height', '200');
}
p.s. for clear view, am just frontendguy, so php i guess+assemble+tweak ;)
if (JRequest::getInt('itemImageS')) {
$imageWidth = JRequest::getInt('itemImageS');
$imageHeight = JRequest::getInt('itemImageS_height');
} else {
$imageWidth = $params->get('itemImageS', '200');
$imageHeight = $params->get('itemImageS_height', '200');
}
should be? :
if (JRequest::getInt('itemImageS')) {
$imageWidth = JRequest::getInt('itemImageS');
} else {
$imageWidth = $params->get('itemImageS', '200');
}
if (JRequest::getInt('itemImageS_height')) {
$imageHeight = JRequest::getInt('itemImageS_height');
} else {
$imageHeight = $params->get('itemImageS_height', '200');
}
p.s. for clear view, am just frontendguy, so php i guess+assemble+tweak ;)
Please Log in or Create an account to join the conversation.
- vanshion
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
14 years 10 months ago #75408
by vanshion
Replied by vanshion on topic creat thumbnail by width and height. you can input height value on K2 control center
No, //$hanle->image_ration_y=true; it also does not work. height value is 200px
it does't matter I follow the first method for the moment. Wishing the next patch will add height setting.
Thank you all the same. Lukas
Lukas said:It looks "doublesized" height. Hard to say without atleast look to your code in both files...
p.s. "$hanle->image_ration_y=false;" is exact typo? there is ration
it does't matter I follow the first method for the moment. Wishing the next patch will add height setting.
Thank you all the same. Lukas
Lukas said:It looks "doublesized" height. Hard to say without atleast look to your code in both files...
p.s. "$hanle->image_ration_y=false;" is exact typo? there is ration
Please Log in or Create an account to join the conversation.
- vtiger
- Offline
- Premium Member
Less
More
- Posts: 83
14 years 10 months ago #75409
by vtiger
Replied by vtiger on topic creat thumbnail by width and height. you can input height value on K2 control center
Weird, it works for me.
Example code from both files:
model/item.php
//Small image
$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.'_S';
if (JRequest::getInt('itemImageS')) {
$imageWidth = JRequest::getInt('itemImageS');
} else {
$imageWidth = $params->get('itemImageS', '200');
}
if (JRequest::getInt('itemImageS_height')) {
$imageHeight = JRequest::getInt('itemImageS_height');
} else {
$imageHeight = $params->get('itemImageS_height', '200');
}
$handle->image_x = $imageWidth;
$handle->image_y = $imageHeight;
$handle->image_ratio_crop = true;
$handle->Process($savepath);
config.xml (with<> at start and end of course, forum cut out full string...)
param menu="hide" name="itemImageS_height" type="text" default="200" size="4" label="Item Small image height (in px)" description="" /
In config i fill 10 for height and 110 for width and correct (expected=zoom to center and crop to width 110xheight 10) result attached.
Example code from both files:
model/item.php
//Small image
$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.'_S';
if (JRequest::getInt('itemImageS')) {
$imageWidth = JRequest::getInt('itemImageS');
} else {
$imageWidth = $params->get('itemImageS', '200');
}
if (JRequest::getInt('itemImageS_height')) {
$imageHeight = JRequest::getInt('itemImageS_height');
} else {
$imageHeight = $params->get('itemImageS_height', '200');
}
$handle->image_x = $imageWidth;
$handle->image_y = $imageHeight;
$handle->image_ratio_crop = true;
$handle->Process($savepath);
config.xml (with<> at start and end of course, forum cut out full string...)
param menu="hide" name="itemImageS_height" type="text" default="200" size="4" label="Item Small image height (in px)" description="" /
In config i fill 10 for height and 110 for width and correct (expected=zoom to center and crop to width 110xheight 10) result attached.
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