diff options
author | Mario <mario@mariovavti.com> | 2025-04-04 15:20:57 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2025-04-04 15:20:57 +0000 |
commit | 2c4f1dcf039c8d9d99c3e8ab579b775268a4e853 (patch) | |
tree | 088f8503f752e05aa8076874d0e3b4e9476e6e6c /Zotlabs | |
parent | 0a1255518f0f2f1225e637791c6af431d3aaa23f (diff) | |
download | volse-hubzilla-2c4f1dcf039c8d9d99c3e8ab579b775268a4e853.tar.gz volse-hubzilla-2c4f1dcf039c8d9d99c3e8ab579b775268a4e853.tar.bz2 volse-hubzilla-2c4f1dcf039c8d9d99c3e8ab579b775268a4e853.zip |
use the syntax which allows image descriptions
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Embedphotos.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Zotlabs/Module/Embedphotos.php b/Zotlabs/Module/Embedphotos.php index 767cfbb92..5c6038686 100644 --- a/Zotlabs/Module/Embedphotos.php +++ b/Zotlabs/Module/Embedphotos.php @@ -55,7 +55,7 @@ class Embedphotos extends \Zotlabs\Web\Controller { $output = EMPTY_STR; if($channel) { $resolution = ((feature_enabled($channel['channel_id'],'large_photos')) ? 1 : 2); - $r = q("select mimetype, height, width from photo where resource_id = '%s' and $resolution = %d and uid = %d limit 1", + $r = q("select mimetype, filename from photo where resource_id = '%s' and $resolution = %d and uid = %d limit 1", dbesc($resource), intval($resolution), intval($channel['channel_id']) @@ -63,6 +63,8 @@ class Embedphotos extends \Zotlabs\Web\Controller { if(! $r) return $output; + $filename = $r[0]['filename']; + if($r[0]['mimetype'] === 'image/jpeg') $ext = '.jpg'; elseif($r[0]['mimetype'] === 'image/png') @@ -75,7 +77,7 @@ class Embedphotos extends \Zotlabs\Web\Controller { $ext = EMPTY_STR; $output = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $resource . ']' . - '[zmg=' . $r[0]['width'] . 'x' . $r[0]['height'] . ']' . z_root() . '/photo/' . $resource . '-' . $resolution . $ext . '[/zmg][/zrl]'; + '[zmg=' . z_root() . '/photo/' . $resource . '-' . $resolution . $ext . ']' . $filename . '[/zmg][/zrl]'; return $output; } |