mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Remove (un)premultiply ops when not resizing/compositing #413
This commit is contained in:
parent
531a0402f7
commit
c920180cb3
@ -4,6 +4,12 @@
|
||||
|
||||
Requires libvips v8.2.3
|
||||
|
||||
#### v0.14.2 - TBD
|
||||
|
||||
* Remove unnecessary (un)premultiply operations when not resizing/compositing.
|
||||
[#413](https://github.com/lovell/sharp/issues/413)
|
||||
[@jardakotesovec](https://github.com/jardakotesovec)
|
||||
|
||||
#### v0.14.1 - 16<sup>th</sup> April 2016
|
||||
|
||||
* Allow removal of limitation on input pixel count via limitInputPixels. Use with care.
|
||||
|
@ -288,12 +288,12 @@ class PipelineWorker : public AsyncWorker {
|
||||
// are already less than the required dimensions
|
||||
if (baton->withoutEnlargement) {
|
||||
if (inputWidth < baton->width || inputHeight < baton->height) {
|
||||
xfactor = 1;
|
||||
yfactor = 1;
|
||||
xfactor = 1.0;
|
||||
yfactor = 1.0;
|
||||
xshrink = 1;
|
||||
yshrink = 1;
|
||||
xresidual = 0;
|
||||
yresidual = 0;
|
||||
xresidual = 1.0;
|
||||
yresidual = 1.0;
|
||||
baton->width = inputWidth;
|
||||
baton->height = inputHeight;
|
||||
}
|
||||
@ -431,7 +431,7 @@ class PipelineWorker : public AsyncWorker {
|
||||
);
|
||||
}
|
||||
|
||||
bool shouldAffineTransform = xresidual != 0.0 || yresidual != 0.0;
|
||||
bool shouldAffineTransform = xresidual != 1.0 || yresidual != 1.0;
|
||||
bool shouldBlur = baton->blurSigma != 0.0;
|
||||
bool shouldSharpen = baton->sharpenRadius != 0;
|
||||
bool shouldThreshold = baton->threshold != 0;
|
||||
|
BIN
test/fixtures/expected/embed-16bit-rgba.png
vendored
BIN
test/fixtures/expected/embed-16bit-rgba.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 755 B After Width: | Height: | Size: 782 B |
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 23 KiB |
Loading…
x
Reference in New Issue
Block a user