X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fnetwork.php;h=16c8185e1abb48b0fec1ada966fe06a0e9ffce35;hb=0475fc1fce4965e660332cd538a43c1c82b7df6c;hp=e9cfe86035c5836461f417073a3ae4353c84b318;hpb=6b23548a2bf2bbd9aa0b6f8dd967d50754e3e66f;p=friendica.git diff --git a/include/network.php b/include/network.php index e9cfe86035..16c8185e1a 100644 --- a/include/network.php +++ b/include/network.php @@ -1,13 +1,12 @@ $result); - echo XML::from_array($xmldata, $xml); + echo XML::fromArray($xmldata, $xml); killme(); } @@ -687,7 +686,6 @@ function scale_external_images($srctext, $include_link = true, $scale_replace = $matches = null; $c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism', $s, $matches, PREG_SET_ORDER); if ($c) { - require_once 'include/Photo.php'; foreach ($matches as $mtch) { logger('scale_external_image: ' . $mtch[1]); @@ -712,18 +710,18 @@ function scale_external_images($srctext, $include_link = true, $scale_replace = } // guess mimetype from headers or filename - $type = guess_image_type($mtch[1], true); + $type = Image::guessType($mtch[1], true); if ($i) { - $ph = new Photo($i, $type); - if ($ph->is_valid()) { - $orig_width = $ph->getWidth(); - $orig_height = $ph->getHeight(); + $Image = new Image($i, $type); + if ($Image->isValid()) { + $orig_width = $Image->getWidth(); + $orig_height = $Image->getHeight(); if ($orig_width > 640 || $orig_height > 640) { - $ph->scaleImage(640); - $new_width = $ph->getWidth(); - $new_height = $ph->getHeight(); + $Image->scaleDown(640); + $new_width = $Image->getWidth(); + $new_height = $Image->getHeight(); logger('scale_external_images: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], LOGGER_DEBUG); $s = str_replace( $mtch[0],