Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Revert "Possibly fix saving EXR files with extremely low alpha values"

Dmitry Kazakov80d801232e16
diff --git a/plugins/impex/exr/exr_converter.cc b/plugins/impex/exr/exr_converter.cc
index 629fd12086..d5b1fbf51f 100644
--- a/plugins/impex/exr/exr_converter.cc
+++ b/plugins/impex/exr/exr_converter.cc
@@ -244,7 +244,7 @@ struct RgbPixelWrapper
}
inline bool checkMultipliedColorsConsistent() const {
- return !(std::abs(pixel.a) <= alphaEpsilon<T>() &&
+ return !(std::abs(pixel.a) < alphaEpsilon<T>() &&
(!qFuzzyIsNull(pixel.r) ||
!qFuzzyIsNull(pixel.g) ||
!qFuzzyIsNull(pixel.b)));
@@ -284,7 +284,7 @@ struct GrayPixelWrapper
}
inline bool checkMultipliedColorsConsistent() const {
- return !(std::abs(pixel.alpha) <= alphaEpsilon<T>() &&
+ return !(std::abs(pixel.alpha) < alphaEpsilon<T>() &&
!qFuzzyIsNull(pixel.gray));
}
@@ -349,7 +349,7 @@ void multiplyAlpha(Pixel *pixel)
if (alphaPos >= 0) {
T alpha = pixel->data[alphaPos];
- if (alpha > alphaEpsilon<T>()) {
+ if (alpha > 0.0) {
for (int i = 0; i < size; ++i) {
if (i != alphaPos) {
pixel->data[i] *= alpha;
@@ -357,10 +357,6 @@ void multiplyAlpha(Pixel *pixel)
}
pixel->data[alphaPos] = alpha;
- } else {
- for (int i = 0; i < size; ++i) {
- pixel->data[i] = 0;
- }
}
}
}