Add support for PNG images with alpha

This commit is contained in:
Fabio Comuni
2012-06-07 17:42:13 +02:00
parent 1d832618a4
commit 7cc8c369cb
11 changed files with 215 additions and 70 deletions

View File

@@ -807,8 +807,11 @@ function scale_external_images($s,$include_link = true) {
if(stristr($mtch[1],$hostname))
continue;
$i = fetch_url($mtch[1]);
// guess mimetype from headers or filename
$type = guess_image_type($mtch[1],true);
if($i) {
$ph = new Photo($i);
$ph = new Photo($i, $type);
if($ph->is_valid()) {
$orig_width = $ph->getWidth();
$orig_height = $ph->getHeight();