mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure composite can tile with outside resize #3227
This commit is contained in:
@@ -607,14 +607,14 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
int across = 0;
|
||||
int down = 0;
|
||||
// Use gravity in overlay
|
||||
if (compositeImage.width() <= baton->width) {
|
||||
if (compositeImage.width() <= image.width()) {
|
||||
across = static_cast<int>(ceil(static_cast<double>(image.width()) / compositeImage.width()));
|
||||
// Ensure odd number of tiles across when gravity is centre, north or south
|
||||
if (composite->gravity == 0 || composite->gravity == 1 || composite->gravity == 3) {
|
||||
across |= 1;
|
||||
}
|
||||
}
|
||||
if (compositeImage.height() <= baton->height) {
|
||||
if (compositeImage.height() <= image.height()) {
|
||||
down = static_cast<int>(ceil(static_cast<double>(image.height()) / compositeImage.height()));
|
||||
// Ensure odd number of tiles down when gravity is centre, east or west
|
||||
if (composite->gravity == 0 || composite->gravity == 2 || composite->gravity == 4) {
|
||||
|
||||
Reference in New Issue
Block a user