Coder Social home page Coder Social logo

Comments (7)

kesselb avatar kesselb commented on July 20, 2024 2

What is worse is that even with enable_previews => false in config.php the preview folder is growing too

#45697

from server.

artonge avatar artonge commented on July 20, 2024 1

I may have miss understood your last comment. There is a difference between "we need to generate the blurhash after preview generation" and "we need to always generate a blurhash (after causing a preview generation)"

To be clearer, blurhash generation should not trigger preview generation ;)

from server.

kesselb avatar kesselb commented on July 20, 2024

Can confirm.

Steps to reproduce:

  • Connect desktop client to Nextcloud
  • Copy an image
  • See the post request for the bulk upload endpoint
  • Max Preview + 256er Previews are generated

To monitor the preview folder for create events:
inotifywait -m -r -e create /path/to/preview/folder

Output:

preview/1/0/ CREATE,ISDIR a
preview/1/0/a/b/2/6/9/39539/ CREATE 2560-1440-max.jpg
preview/1/0/a/b/2/6/9/39539/ CREATE 256-144.jpg
preview/b/5/7/ CREATE,ISDIR 7
preview/b/5/7/7/2/e/7/39548/ CREATE 1920-1080-max.jpg
preview/b/5/7/7/2/e/7/39548/ CREATE 256-144.jpg
preview/e/4/ CREATE,ISDIR 9
preview/e/4/9/f/1/7/b/39556/ CREATE 2559-1599-max.jpg
preview/e/4/9/f/1/7/b/39556/ CREATE 256-160.jpg
preview/c/a/b/ CREATE,ISDIR 8
preview/c/a/b/8/c/3/7/39565/ CREATE 1920-1080-max.jpg
preview/c/a/b/8/c/3/7/39565/ CREATE 256-144.jpg
preview/7/1/ CREATE,ISDIR c
preview/7/1/c/7/2/2/e/39573/ CREATE 1920-1200-max.png
preview/7/1/c/7/2/2/e/39573/ CREATE 256-160.png

That could be

$preview = $this->preview->getPreview($file, 256, 256);
, however adding a return before getPreview had no effect on my end.

from server.

kesselb avatar kesselb commented on July 20, 2024

cc @ArtificialOwl @artonge

from server.

marcos-guerrero avatar marcos-guerrero commented on July 20, 2024

What is worse is that even with enable_previews => false in config.php the preview folder is growing too
I dropped 4 images on my desktop app and

root@maqueta-nextcloud-backend2:~# inotifywait -m -r -e create /disco_datos_nextcloud/nextcloud_data/appdata_XXX/preview/
Setting up watches.  Beware: since -r was given, this may take a while!
Watches established.
/disco_datos_nextcloud/nextcloud_data/appdata_XXX/preview/5/6/1/ CREATE,ISDIR f
/disco_datos_nextcloud/nextcloud_data/appdata_XXX/preview/0/3/9/ CREATE,ISDIR 7
/disco_datos_nextcloud/nextcloud_data/appdata_XXX/preview/4/7/a/f/ CREATE,ISDIR d
/disco_datos_nextcloud/nextcloud_data/appdata_XXX/preview/7/f/8/2/ CREATE,ISDIR f

I'm on nc 29.0.2

from server.

artonge avatar artonge commented on July 20, 2024

We indeed need to generate the blurhash after the preview generation:

  • emit an event when a preview is created with the original and preview File objects
    $this->eventDispatcher->dispatchTyped(new BeforePreviewFetchedEvent(
    $file,
    $width,
    $height,
    $crop,
    $mode,
    ));
    // since we only ask for one preview, and the generate method return the last one it created, it returns the one we want
    return $this->generatePreviews($file, [$specification], $mimeType);
    }
  • in the listener generate and update the blurhash metadata

from server.

csware avatar csware commented on July 20, 2024

@artonge
I may have miss understood your last comment. There is a difference between "we need to generate the blurhash after preview generation" and "we need to always generate a blurhash (after causing a preview generation)"

from server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.