// New HTML image wrapper function modified for KISS Image Thumbnailer by FWR Media
function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
// If width and height are not numeric then we can't do anything with it
$imageg = @getimagesize($src);
// Check the input variables and decide what to do:
if($width > $imageg[0] && $height > $imageg[1]){
$image = '<img src="' . tep_output_string($src) . '" alt="' . tep_output_string($alt) . '"';
if (tep_not_null($alt)) {
$image .= ' title=" ' . tep_output_string($alt) . ' "';
}
$image .= ' '.$imageg[3];
if (tep_not_null($parameters)) $image .= ' ' . $parameters;
$image .= ' />';
return $image;
}else{
if ( !is_numeric ( $width ) || !is_numeric ( $height ) ) return tep_image_legacy( $src, $alt, $width, $height, $parameters );
require_once DIR_WS_MODULES . 'kiss_image_thumbnailer/classes/Image_Helper.php';
$attributes = array( 'alt' => $alt, 'width' => $width, 'height' => $height );
$image = new Image_Helper( array( 'src' => $src,
'attributes' => $attributes,
'parameters' => $parameters,
'default_missing_image' => DIR_WS_IMAGES . 'no_image_available_150_150.gif',
'isXhtml' => true,
'thumbs_dir_path' => DIR_WS_MODULES . 'kiss_image_thumbnailer/thumbs/',
'thumb_quality' => 75,
'thumb_background_rgb' => array( 'red' => 255,
'green' => 255,
'blue' => 255 ) ) );
if ( false === $image_assembled = $image->assemble() ) {
return tep_image_legacy( $src, $alt, $width, $height, $parameters );
}
return $image_assembled;
}
} // end function
it checks first the Image dimensions with the original - if both width and height are bigger - it will instead just link the original Image
Latest News: (loading..)
KissIT Image Thumnailer
Started by FWR Media, Jul 08 2012 11:57 AM
108 replies to this topic
#101
Posted 01 May 2013 - 09:04 AM
try this new function in html_output.php
#102
Posted 08 May 2013 - 08:23 AM
@14steve14 unfortunately I have to be able to cope with two different dimensions. It's just not possible to rely only on one, and it will also save a lot of time later on, because we won't have to edit the images.
@thejudge99 this could be it. I'll try it and get back to you. Thanks
@thejudge99 this could be it. I'll try it and get back to you. Thanks
#103 ONLINE
Posted 08 May 2013 - 09:09 PM
Hello
If the images are not in the default folder "images" but in "images/products" will I need to change any code in KissIT Thumbnailer?
Thank You
If the images are not in the default folder "images" but in "images/products" will I need to change any code in KissIT Thumbnailer?
Thank You
#104
Posted 09 May 2013 - 08:28 PM
the Location of all Images along with whatever dimensions are passed to the function - so no that shouldnt matter
#105 ONLINE
#106
Posted 17 May 2013 - 05:08 PM
Hi,
maybe this function would be usefull for reset or clean thumbs cache at admin -> Configure -> Images
Run in phpMyadmin (mySql):
add this hard coded function into admin/includes/functions/general.php

Regards,
Gergely
maybe this function would be usefull for reset or clean thumbs cache at admin -> Configure -> Images
Run in phpMyadmin (mySql):
INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
('Reset thumbs', 'RESET_IMAGE_THUMBS', 'false', 'Reset thumbs cache', 4, 9, '2013-02-20 19:36:26', '2013-01-29 17:11:10', 'tep_cfg_reset_thumbs_cache', 'tep_cfg_select_option(array(''reset'', ''false''),');
add this hard coded function into admin/includes/functions/general.php
function tep_cfg_reset_thumbs_cache( $action = 'false' ) {
if ($action == 'reset' ) {
$mask = "../includes/modules/kiss_image_thumbnailer/thumbs/*.jpg";
array_map( "unlink", glob( $mask ) );
$mask = "../includes/modules/kiss_image_thumbnailer/thumbs/*.gif";
array_map( "unlink", glob( $mask ) );
$mask = "../includes/modules/kiss_image_thumbnailer/thumbs/*.png";
array_map( "unlink", glob( $mask ) );
tep_db_query( "UPDATE " . TABLE_CONFIGURATION . " SET configuration_value='false' WHERE configuration_key='RESET_IMAGE_THUMBS'" );
}
}
Regards,
Gergely
Header Footer Content Modules
SCM
v3
and some rewrites :-)
SCM
v3
and some rewrites :-)
#107
Posted 22 May 2013 - 04:34 PM
It seems that I had missed the extra part in the installation about the product_info file for oscommerce 2.3.x
Sorry for wasting your time, and thank you for wasting it
Sorry for wasting your time, and thank you for wasting it
#109
Posted 22 May 2013 - 04:57 PM
Gergely, on 17 May 2013 - 05:08 PM, said:
Hi,
maybe this function would be usefull for reset or clean thumbs cache at admin -> Configure -> Images
maybe this function would be usefull for reset or clean thumbs cache at admin -> Configure -> Images
Yes there really should be a way to clear the thumbs via admin.
Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls
KissMT Dynamic SEO Meta & Canonical Header Tags
KissER Error Handling and Debugging
KissIT Image Thumbnailer
Security Pro - Querystring protection against hackers ( a KISS contribution )
If you found my post useful please click the "Like This" button to the right.
Please only PM me for paid work.
KissMT Dynamic SEO Meta & Canonical Header Tags
KissER Error Handling and Debugging
KissIT Image Thumbnailer
Security Pro - Querystring protection against hackers ( a KISS contribution )
If you found my post useful please click the "Like This" button to the right.
Please only PM me for paid work.









