WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
//if user is allowed to see the page's content, then we retrieve it: $page_source = ''; if(($agg_settings['aggregate_hidden'] && ($item['visibility'] == 'hidden')) || $wb->show_page($item)){ $query = "SELECT * FROM ".TABLE_PREFIX."sections WHERE page_id = '" . $item['page_id'] . "' ORDER BY block, position ASC"; $sections_query = $database->query($query); if($sections_query->numRows() >= 1) { while($section = $sections_query->fetchRow()) { $section_id = $section['section_id']; $module = $section['module']; if($section['module'] != 'enhanced_aggregator'){ ob_start(); include(WB_PATH.'/modules/'.$module.'/view.php'); $page_source .= ob_get_contents(); ob_end_clean(); } } } } $img_tag = get_first_element($page_source,'img'); // Filter de img-tag uit $img_tag $find = '/<img.*src="(.*?)"/'; $match = preg_match($find, $img_tag, $img ); if ( $match ) { // Afmetingen van het origineel ophalen. list($width_orig, $height_orig) = getimagesize($img[1]); // Check hoe groot de maximale maat mag zijn $maxsize = $agg_settings['thumb_size']; // Bepalen van de nieuwe afmetingen: if($width_orig < $maxsize && $height_orig < $maxsize) { // -> breedte en hoogte < maxsize: niet resizen, originele afmetingen behouden. $height = $height_orig; $width = $width_orig; } elseif($width_orig < $height_orig) { // -> breedte < hoogte: de hoogte is de maxsize, de breedte naar verhouding aanpassen. $height = $maxsize; $width = round(($maxsize / $height_orig) * $width_orig); } else { // -> breedte > hoogte: de breedte is de maxsize, de hoogte naar verhouding aanpassen. $height = round(($maxsize / $width_orig) * $height_orig); $width = $maxsize; } $thumb = "<img src=\"" . $img[1] . "\" height=\"" . $height . "\" width=\"" . $width . "\" />"; // $thumb = "<img src=\"" . $img[1] . "\" height=\"" . $height . "\" width=\"" . $width . "\" />"; } else { $thumb = "<h5>Geen afbeelding beschikbaar</h5>"; }
// Filter de img-tag uit $img_tag $find = '/<img.*src="(.*?)"/'; $match = preg_match($find, $img_tag, $img ); if ( $match ) { // Afmetingen van het origineel ophalen. list($width_orig, $height_orig) = getimagesize($img[1]);
var_dump(getimagesize('http://localhost/fjorkahoeve/media/Fjorden/Bjorna/Bjorna.33.06.jpg'));
var_dump(getimagesize('$img[1]'));
<?php$img_tag = '<img src="http://localhost/fjorkahoeve/media/Fjorden/Bjorna/Bjorna.33.06.jpg" "="';// Filter de img-tag uit $img_tag$find = '/<img.*src="(.*?)"/';$match = preg_match($find, $img_tag, $img );var_dump($img[1]);echo "<br />";var_dump(getimagesize($img[1]));?>
$find = '/<img.*src="(.*?)"/'; $match = preg_match($find, $img_tag, $img );$info = [];$size = getimagesize($img[1], $info);echo $size[0];echo "<br>";echo $size[1];
<?php var_dump($size);?>