GNOME Bugzilla – Bug 585665
Exporting to PSD with a blank text layer creates a corrupt file
Last modified: 2009-07-16 20:31:44 UTC
Please describe the problem: When creating a multi layer image (such as several layers of text) and exporting that file to PSD, the PSD file is corrupt and unreadable Steps to reproduce: 1. Create a new image 2. With the text tool, create a new text layer, type in "test text" 3. With the text tool, create a another text layer, type in "test text 2" 4. With the text tool, create a another text layer, type in "test text 3" 5. Go back and edit the layer of "test text 2". Remove all the text so that is blank, but do not delete the layer (i.e. a blank layer). 6. Save as PSD 7. Attempt to open the saved file Actual results: Gimp reports that the PSD file is corrupt Expected results: To be able to open and edit the file normally Does this happen every time? Yes Other information: If you have any questions, or would like a sample file that reproduces this bug, please email me.
Confirming.
Created attachment 138234 [details] [review] Proposed patch against 2.6.6 In file 'plug-ins/file-psd/psd-save.c' the function write_pascalstring miscomputes the number of zeros needed to pad an empty string. And a text layer with no text in it has no name, so after storing the name, the remainder of the file is misaligned. The attached patch against the release 2.6.6 fixes the problem.
commit 48a6b0c59cbdfc07e904d7b000776b2ccc55504c Author: Massimo Valentini <sixtysix@inwind.it> Date: Thu Jul 16 22:21:40 2009 +0200 Bug 585665 – Exporting to PSD with a blank text layer creates a corrupt file Use write_gchar() to write an empty string, not write_gint16(). plug-ins/file-psd/psd-save.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)