-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New occ commands to manage thumbnails #387
Conversation
👍 |
c91b03d
to
d2e2df4
Compare
👍 |
@mmattel - If you know the path to the mount, you can already use |
I've just tested with a mounted ownCloud instance and it worked. I'll updated the OP. |
From what I can tell it only creates thumbnails for a single size which wont be enough for people with HiDPI screens, maybe add some sort of scale parameter to handle that? |
The main goal is to generate the max preview, but since I need to also give another size (there is no getMaxPreview() method), I picked the Gallery thumbnail dimensions with a pixel ratio of 1 since we can't guess what the ratio is going to be in the various clients connecting to the app. If |
Testing if creating thumbnails of a mount with --path works, here is the result: Having a clean fresh install from git master and finalizing it.
This is what I expected, because having a mount only is not a path having a user in. And the mounts are not in the users home... But this is what my suggestion is about. Usually lots of picture files are mounted with external storage support... And advanced thumbnail creation on an mount would be a big help. |
|
@icewind1991 @oparoz Question: do I get it right, that --all and --path do exclude each other? |
@oparoz
|
@icewind1991 After a short time running the command, I get on each thumb created a message like below logged, and I have thousands of pictures to be processed:
|
Yes, the user will be determined from the path
Samba error. Perhaps it's scanning a folder it doesn't have access to, like some cache? You can debug this with the files:scan command on which this is based. |
@mmattel - I investigated a bit and pushed some changes.
|
@oparoz |
@mmattel I'm not sure anything clean can be done about this. GD seems to be using the temp folder to process images and I don't have a command or the filenames. |
OK, so I've imported most of the Scanner class in order to customise the scan since the original class didn't give us access to the mount options before scanning that storage location. Using the latest master, we can now listen to scanPostFile event (owncloud/core#19460) and the Image class cleans up after itself (owncloud/core#19471), so the command should behave as expected. @mmattel Let us know how it goes with your 19K images :) |
Just for the record, this is the fix to my comment above regarding temp space usage: owncloud/core#19471 (Clean temp files used for thumbnail generation, merged) |
I'm glad it's made it to the base class :). Thanks for the heads up. |
I just applied this patch on OC 9.0 (using the guide from http://blog.jospoortvliet.com/2016/01/patching-owncloud-get-your-fix-now.html?m=1). Does somebody know when I'm doing an error? |
Cool guide @jospoortvliet :) @elpraga - The problem is that things have changed in |
OK. Thanks for explaining! Are the changes big? In other words, is there a chance that the branch gets updated and the patch will be applicable to 9.0? I was waiting quite anxiously for 9.0 to try out the command for thumbnail generation and I was really sad it did not maker it after all.. :-( |
No idea. It could be relatively quick to just fix, but some refactoring will be needed on 9.0 as some of the features developed in here have been integrated in It's been low on my list of priorities unfortunately as I can't justify spending 2-3 days to fix it. |
Thank you for clarifying! I understand that priorities are tough sometimes. Unfortunately I cannot afford to pitch in some money right now nor offer my skills to write the fix as I lack them.. I'll have to wait then.. But thank you a lot anyways! |
Hoping that this will live to see OC 9+ |
Agreed, Love to see this working with OC9. This is why I use OC but the thumbnail generation is holding us back. |
Closing as this will not be added to Gallery |
So this functionality will not be added not even to 9.1? Really? That is really sad to hear, I was waiting for it for months... |
@elpraga if somebody writes the tests, I suppose ;-) |
Unfortunately, I don't know how to. Otherwise, I would offer to help.. :-/ |
Write tests, remove code made obsolete by changes in core, use the background queue if it ever gets documented (and is useful) plus much more I'm sure. Since I'm going to focus on Gallery+, this may make a come back there. |
@oparoz, i'm sure there's a whole lot of us who will be happy with just an ugly hack to run in the shell, something that would call the thumb generation method directly, not integrated in core or anything. ditaW pasted a browser-side greasemonkey script here , but it seems broken already... any hints? |
Form my pov this should go into core .... |
@DeepDiver1975 - I agree, all the base components are there. This was sort of a crutch while waiting for some movement on a background task queue manager capable of generating thumbnails. |
we should start up the discussion about this for the scope of 9.2 again |
For reference this is the issue in core: Migrate preview generation to async job execution |
Sunday Funday!
Here are some command some of you may find useful to manage your thumbnails:
Create thumbnails
Solution for owncloud/core#17536
Documentation
Create thumbnails
Specs
/<user>/files
Stats
of folders
of files
of images
of previews generated
of failed previews (listed)
TODO
/<user>/files
Offer a safer scanning option, with transactional locking. I'm hoping this will solve the error 1205 problems and not create more problems when trying to generate thumbnailsPossible extensions
For future PRs
Delete thumbnails
Documentation
Delete thumbnails
Specs
Stats
of images
of thumbnails deleted
of failed deletion (listed)
Possible extensions
For future PRs
TODO
Notes
Of course, it would be much more useful to be able to run that from a cron, from the user's settings panel, etc. so don't hesitate to improve this solution ;)
@mmattel @setnes @EricReiche @jospoortvliet @DeepDiver1975 @icewind1991 @Xenopathic @deMattin @TheDD @patman15 @africanforest @MorrisJobke @PVince81 @libasys @mbazdell @blackm