From b03fc197aa502c7170f1d6f00a6c83bdd9cc03f0 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 11 Jun 2019 16:32:33 -0700 Subject: [PATCH] file sync issues related to thumbnail os_storage --- Zotlabs/Module/Getfile.php | 8 ++++++-- include/import.php | 31 +++++++++++++++++-------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Zotlabs/Module/Getfile.php b/Zotlabs/Module/Getfile.php index c222177dc..208683acd 100644 --- a/Zotlabs/Module/Getfile.php +++ b/Zotlabs/Module/Getfile.php @@ -1,6 +1,9 @@ $channel['channel_hash'], - 'time' => $time, - 'resource' => $att['hash'], - 'revision' => 0, + $parr = [ + 'hash' => $channel['channel_hash'], + 'time' => $time, + 'resource' => $att['hash'], + 'revision' => 0, 'signature' => Libzot::sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey']) - ); + ]; $store_path = $newfname; @@ -1504,23 +1505,25 @@ function sync_files($channel, $files) { ); } - if (intval($p['imgscale']) === 0 && $p['os_storage']) { - $p['content'] = $store_path; + if (intval($p['os_storage'])) { + $p['content'] = $store_path . ((intval($p['imgscale'])) ? '-' . $p['imgscale'] : EMPTY_STR); } else { - $p['content'] = (($p['content'])? base64_decode($p['content']) : ''); + $p['content'] = (($p['content']) ? base64_decode($p['content']) : ''); } + if (intval($p['imgscale']) && (! $p['content'])) { $time = datetime_convert(); - $parr = array('hash' => $channel['channel_hash'], - 'time' => $time, - 'resource' => $att['hash'], - 'revision' => 0, - 'signature' => zot_sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey']), + $parr = [ + 'hash' => $channel['channel_hash'], + 'time' => $time, + 'resource' => $att['hash'], + 'revision' => 0, + 'signature' => Libzot::sign($channel['channel_hash'] . '.' . $time, $channel['channel_prvkey']), 'resolution' => $p['imgscale'] - ); + ]; $stored_image = $newfname . '-' . intval($p['imgscale']);