mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-05-28 00:30:23 -04:00
XCF: fixed wrong composite on Grayscale images
CCBUG: 476755
This commit is contained in:
parent
99663607b2
commit
bd083ff354
BIN
autotests/read/xcf/bug_476755_gray_layers.png
Normal file
BIN
autotests/read/xcf/bug_476755_gray_layers.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 234 KiB |
BIN
autotests/read/xcf/bug_476755_gray_layers.xcf
Normal file
BIN
autotests/read/xcf/bug_476755_gray_layers.xcf
Normal file
Binary file not shown.
BIN
autotests/read/xcf/bug_476755_rgb_layers.png
Normal file
BIN
autotests/read/xcf/bug_476755_rgb_layers.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 234 KiB |
BIN
autotests/read/xcf/bug_476755_rgb_layers.xcf
Normal file
BIN
autotests/read/xcf/bug_476755_rgb_layers.xcf
Normal file
Binary file not shown.
@ -2755,10 +2755,10 @@ void XCFImageFormat::copyLayerToImage(XCFImage &xcf_image)
|
|||||||
// For each tile...
|
// For each tile...
|
||||||
|
|
||||||
for (uint j = 0; j < layer.nrows; j++) {
|
for (uint j = 0; j < layer.nrows; j++) {
|
||||||
uint y = j * TILE_HEIGHT;
|
qint32 y = qint32(j * TILE_HEIGHT);
|
||||||
|
|
||||||
for (uint i = 0; i < layer.ncols; i++) {
|
for (uint i = 0; i < layer.ncols; i++) {
|
||||||
uint x = i * TILE_WIDTH;
|
qint32 x = qint32(i * TILE_WIDTH);
|
||||||
|
|
||||||
// This seems the best place to apply the dissolve because it
|
// This seems the best place to apply the dissolve because it
|
||||||
// depends on the global position of each tile's
|
// depends on the global position of each tile's
|
||||||
@ -3045,7 +3045,7 @@ void XCFImageFormat::mergeLayerIntoImage(XCFImage &xcf_image)
|
|||||||
merge = mergeRGBToRGB;
|
merge = mergeRGBToRGB;
|
||||||
break;
|
break;
|
||||||
case GRAY_GIMAGE:
|
case GRAY_GIMAGE:
|
||||||
if (layer.opacity == OPAQUE_OPACITY) {
|
if (layer.opacity == OPAQUE_OPACITY && xcf_image.image.depth() <= 8) {
|
||||||
merge = mergeGrayToGray;
|
merge = mergeGrayToGray;
|
||||||
} else {
|
} else {
|
||||||
merge = mergeGrayToRGB;
|
merge = mergeGrayToRGB;
|
||||||
@ -3181,10 +3181,10 @@ void XCFImageFormat::mergeLayerIntoImage(XCFImage &xcf_image)
|
|||||||
qCDebug(XCFPLUGIN) << "Using QPainter for mode" << layer.mode;
|
qCDebug(XCFPLUGIN) << "Using QPainter for mode" << layer.mode;
|
||||||
|
|
||||||
for (uint j = 0; j < layer.nrows; j++) {
|
for (uint j = 0; j < layer.nrows; j++) {
|
||||||
uint y = j * TILE_HEIGHT;
|
qint32 y = qint32(j * TILE_HEIGHT);
|
||||||
|
|
||||||
for (uint i = 0; i < layer.ncols; i++) {
|
for (uint i = 0; i < layer.ncols; i++) {
|
||||||
uint x = i * TILE_WIDTH;
|
qint32 x = qint32(i * TILE_WIDTH);
|
||||||
|
|
||||||
QImage &tile = layer.image_tiles[j][i];
|
QImage &tile = layer.image_tiles[j][i];
|
||||||
if (x + layer.x_offset < MAX_IMAGE_WIDTH &&
|
if (x + layer.x_offset < MAX_IMAGE_WIDTH &&
|
||||||
@ -3210,10 +3210,10 @@ void XCFImageFormat::mergeLayerIntoImage(XCFImage &xcf_image)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (uint j = 0; j < layer.nrows; j++) {
|
for (uint j = 0; j < layer.nrows; j++) {
|
||||||
uint y = j * TILE_HEIGHT;
|
qint32 y = qint32(j * TILE_HEIGHT);
|
||||||
|
|
||||||
for (uint i = 0; i < layer.ncols; i++) {
|
for (uint i = 0; i < layer.ncols; i++) {
|
||||||
uint x = i * TILE_WIDTH;
|
qint32 x = qint32(i * TILE_WIDTH);
|
||||||
|
|
||||||
// This seems the best place to apply the dissolve because it
|
// This seems the best place to apply the dissolve because it
|
||||||
// depends on the global position of each tile's
|
// depends on the global position of each tile's
|
||||||
@ -3853,6 +3853,9 @@ bool XCFImageFormat::mergeGrayAToRGB(const Layer &layer, uint i, uint j, int k,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (layer.mode) {
|
switch (layer.mode) {
|
||||||
|
case GIMP_LAYER_MODE_NORMAL:
|
||||||
|
case GIMP_LAYER_MODE_NORMAL_LEGACY:
|
||||||
|
break;
|
||||||
case GIMP_LAYER_MODE_MULTIPLY:
|
case GIMP_LAYER_MODE_MULTIPLY:
|
||||||
case GIMP_LAYER_MODE_MULTIPLY_LEGACY: {
|
case GIMP_LAYER_MODE_MULTIPLY_LEGACY: {
|
||||||
src = INT_MULT(src, dst);
|
src = INT_MULT(src, dst);
|
||||||
|
Loading…
Reference in New Issue
Block a user