photo driver abstraction

This commit is contained in:
friendica
2013-04-25 20:01:24 -07:00
parent d3b5e67890
commit 72e83f69bc
15 changed files with 461 additions and 496 deletions

View File

@@ -1051,7 +1051,8 @@ function scale_external_images($s, $include_link = true, $scale_replace = false)
$matches = null;
$c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism',$s,$matches,PREG_SET_ORDER);
if($c) {
require_once('include/Photo.php');
require_once('include/photo/photo_driver.php');
foreach($matches as $mtch) {
logger('scale_external_image: ' . $mtch[1]);
@@ -1080,7 +1081,7 @@ function scale_external_images($s, $include_link = true, $scale_replace = false)
$type = guess_image_type($mtch[1],true);
if($i) {
$ph = new Photo($i, $type);
$ph = photo_factory($i, $type);
if($ph->is_valid()) {
$orig_width = $ph->getWidth();
$orig_height = $ph->getHeight();