Skip to content
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

use new batch preview generation #182

Merged
merged 2 commits into from
Jan 27, 2021

Conversation

icewind1991
Copy link
Member

Use the new optimized preview generation methods introduced with nextcloud/server#19495

I've used "feature detection" to remain backwards compatible (and to allow using the new methods if these get backported)

@MichaIng
Copy link
Member

Fallback to old method can be removed, since the app now is NC20 compatible only: 03665bc#diff-ab97a56738913a50d2334c4d3f10991748d3e29d011f5a674734b63d33d5ce9eR27

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah please rebase and indeed it is only 20+ now so all good to just do the 1 way

@icewind1991 icewind1991 force-pushed the use-batch-generation branch from 1cb8d0d to 637931e Compare January 5, 2021 15:35
@icewind1991
Copy link
Member Author

done

@icewind1991 icewind1991 force-pushed the use-batch-generation branch from 637931e to 3d10307 Compare January 5, 2021 15:42
@rullzer rullzer merged commit 250fcb8 into nextcloud:master Jan 27, 2021
@icewind1991 icewind1991 deleted the use-batch-generation branch January 27, 2021 14:29
Comment on lines +203 to +213
$specifications = array_merge(
array_map(function ($squareSize) {
return ['width' => $squareSize, 'height' => $squareSize, 'crop' => true];
}, $this->sizes['square']),
array_map(function ($heightSize) {
return ['width' => -1, 'height' => $heightSize, 'crop' => false];
}, $this->sizes['height']),
array_map(function ($widthSize) {
return ['width' => $widthSize, 'height' => -1, 'crop' => false];
}, $this->sizes['width'])
);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is very old, but $specifications doesn't depend on the current file, so it could be computed only once and set as class member

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I'll create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants