[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/calligra/2.9] krita/plugins/formats/psd: Fix loading PSD files by PS after being edited by
From:       Dmitry Kazakov <dimula73 () gmail ! com>
Date:       2015-11-17 15:06:46
Message-ID: E1ZyhqI-0002FD-UT () scm ! kde ! org
[Download RAW message or body]

Git commit 22f7b3b9171f2ee79abd816ebd6d0da49174c3f2 by Dmitry Kazakov.
Committed on 17/11/2015 at 15:04.
Pushed by dkazakov into branch 'calligra/2.9'.

Fix loading PSD files by PS after being edited by Krita

Some resources of PS contain the list of all the layers in the image.
Therefore, if we edit the layers structure, the list might become invalid
and PS will refuse to load that

BUG:355110

M  +15   -0    krita/plugins/formats/psd/psd_resource_block.cpp

http://commits.kde.org/calligra/22f7b3b9171f2ee79abd816ebd6d0da49174c3f2

diff --git a/krita/plugins/formats/psd/psd_resource_block.cpp b/krita/plugins/formats/psd/psd_resource_block.cpp
index 604e7ff..c3e720f 100644
--- a/krita/plugins/formats/psd/psd_resource_block.cpp
+++ b/krita/plugins/formats/psd/psd_resource_block.cpp
@@ -268,6 +268,21 @@ bool PSDResourceBlock::write(QIODevice* io)
         return false;
     }
 
+    if (identifier == PSDImageResourceSection::LAYER_STATE ||
+        identifier == PSDImageResourceSection::LAYER_GROUP ||
+        identifier == PSDImageResourceSection::LAYER_COMPS ||
+        identifier == PSDImageResourceSection::LAYER_GROUP_ENABLED_ID ||
+        identifier == PSDImageResourceSection::LAYER_SELECTION_ID) {
+
+        /**
+         * We can actually handle LAYER_SELECTION_ID. It consists
+         * of a number of layers and a list of IDs to select, which
+         * are retrieved from 'lyid' additional layer block.
+         */
+        dbgFile << "Skip writing resource block" << identifier << displayText();
+        return true;
+    }
+
     QByteArray ba;
 
     // createBlock returns true by default but does not change the data.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic