]> git.mxchange.org Git - friendica.git/commitdiff
Improve the speed for blurhash generation
authorMichael <heluecht@pirati.ca>
Sun, 8 Dec 2024 19:45:38 +0000 (19:45 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 8 Dec 2024 21:21:20 +0000 (21:21 +0000)
src/Object/Image.php
src/Protocol/ATProtocol/Jetstream.php

index 256de2f284597c30c08501b1647f90091ce2f7f0..26fc5bac6f6492927ae14f780ed08da6ccc97a52 100644 (file)
@@ -770,7 +770,7 @@ class Image
         */
        public function getBlurHash(): string
        {
-               $image = New Image($this->asString(), $this->getType(), $this->filename, false);
+               $image = clone($this);
                if (empty($image) || !$this->isValid()) {
                        return '';
                }
index c1b866dac8f0599aefcc69837e7b4e0db4bbbd25..834d6ac5c6e932d46aa32e3bf8c1b74cb05f9efc 100755 (executable)
@@ -295,7 +295,7 @@ class Jetstream
                                break;
                }
                if (microtime(true) - $timestamp > 2) {
-                       $this->logger->notice('Commit processed', ['duration' => round(microtime(true) - $timestamp, 3), 'time' => date(DateTimeFormat::ATOM, $data->time_us / 1000000), 'did' => $data->did, 'operation' => $data->commit->operation, 'collection' => $data->commit->collection]);
+                       $this->logger->notice('Commit processed', ['duration' => round(microtime(true) - $timestamp, 3), 'drift' => $drift, 'capped' => $this->capped, 'time' => date(DateTimeFormat::ATOM, $data->time_us / 1000000), 'did' => $data->did, 'operation' => $data->commit->operation, 'collection' => $data->commit->collection]);
                }
        }