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

Ensure delays of the origin image is preserved #3062

Merged
merged 1 commit into from
Jan 28, 2022

Conversation

kleisauke
Copy link
Contributor

By not initializing the delay vector, since we assume it's empty by default in SetAnimationProperties.

sharp/src/common.cc

Lines 495 to 503 in 68823a5

bool hasDelay = !delay.empty();
// Avoid a copy if none of the animation properties are needed.
if (nPages == 1 && !hasDelay && loop == -1) return image;
if (delay.size() == 1) {
// We have just one delay, repeat that value for all frames.
delay.insert(delay.end(), nPages - 1, delay[0]);
}

A test case was added to prevent further regressions.

See: #3061.

By not initializing the delay vector, since we assume it's empty by default.

See: lovell#3061.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 1f09d28 on kleisauke:preserve-origin-delays into 68823a5 on lovell:main.

@lovell lovell merged commit 7aa3402 into lovell:main Jan 28, 2022
@lovell
Copy link
Owner

lovell commented Jan 28, 2022

Bedankt!

@kleisauke kleisauke deleted the preserve-origin-delays branch January 28, 2022 11:52
Y2zz pushed a commit to Y2zz/sharp that referenced this pull request Feb 26, 2022
By not initializing the delay vector, since we assume it's empty by default.

See: lovell#3061.
martinj pushed a commit to aptoma/sharp that referenced this pull request Mar 31, 2022
By not initializing the delay vector, since we assume it's empty by default.

See: lovell#3061.
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.

3 participants