-
Notifications
You must be signed in to change notification settings - Fork 58
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
Conversation
Fallback to old method can be removed, since the app now is NC20 compatible only: 03665bc#diff-ab97a56738913a50d2334c4d3f10991748d3e29d011f5a674734b63d33d5ce9eR27 |
There was a problem hiding this 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
1cb8d0d
to
637931e
Compare
done |
637931e
to
3d10307
Compare
$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']) | ||
); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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)