use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Network\Probe;
-use Friendica\Object\Photo;
+use Friendica\Object\Image;
use Friendica\Util\XML;
/**
if (x($opts, 'timeout')) {
@curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
} else {
- $curl_time = intval(Config::get('system', 'curl_timeout'));
- @curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
+ $curl_time = Config::get('system', 'curl_timeout', 60);
+ @curl_setopt($ch, CURLOPT_TIMEOUT, intval($curl_time));
}
// by default we will allow self-signed certs
if (intval($timeout)) {
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
} else {
- $curl_time = intval(Config::get('system', 'curl_timeout'));
- curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
+ $curl_time = Config::get('system', 'curl_timeout', 60);
+ curl_setopt($ch, CURLOPT_TIMEOUT, intval($curl_time));
}
if (defined('LIGHTTPD')) {
}
// 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],