]> git.mxchange.org Git - friendica.git/blobdiff - mod/parse_url.php
Merge https://github.com/friendica/friendica into pull
[friendica.git] / mod / parse_url.php
index 27dac4d5d318565483a392f3a0a7170e2dae4868..cdf2223a866d677c2598614b4c8e185c6b480154 100644 (file)
@@ -215,8 +215,11 @@ function parse_url_content(&$a) {
                                        
                                        $i = fetch_url($image);
                                        if($i) {
+                                               // guess mimetype from headers or filename
+                                               $type = guess_image_type($image,true);
+                                               
                                                require_once('include/Photo.php');
-                                               $ph = new Photo($i);
+                                               $ph = new Photo($i, $type);
                                                if($ph->is_valid()) {
                                                        if($ph->getWidth() > 300 || $ph->getHeight() > 300) {
                                                                $ph->scaleImage(300);