saber210
Supreme Member
- Sep 1, 2011
- 1,358
- 503
I have a gallery code that will resize the image to 255,xxx.. I really need to set the width to 330px.
I tried changing the 255 to 330, but it keeps resizing the images to 255px..
This is wordpress btw.
Thanks!
I tried changing the 255 to 330, but it keeps resizing the images to 255px..
This is wordpress btw.
Code:
function wim_index($id){
$img = get_bloginfo('wpurl').'/wp-content/uploads/thumbnail/'.$id.'2550.jpg';
$sn = 0;
$src_h = wim_exist($id, 255, 0);
if($src_h > 0){
return '<img src="'.$img.'" height="'.$src_h.'" />';
}else{
ob_start();
ob_end_clean();
$fpost = get_post($id);
$content = $fpost->post_content;
$output = preg_match_all('/\<img.+?src="(.+?)".*?\/>/is',$content,$matches ,PREG_SET_ORDER);
$cnt = count( $matches );
if($cnt>0){
wim_delete($id, 255, 0);
$args = resizeimg($id, $matches[0][1], 0, 255);
$w = $args['width'];
$h = $args['height'];
wim_insert($id, $sn, $w, $h);
return '<img src="'.$img.'" height="'.$h.'" />';
}else{
return false;
}
}
}
Thanks!