GNOME Bugzilla – Bug 559239
Error while loading psd-data
Last modified: 2008-11-19 07:01:05 UTC
While opening any *.psd files i get following Error (in German): "Das Öffnen von ..psd ist fehlgeschlagen: Fehler beim Öffnen der psd-datei: Zu viele Ebenenkanäle:1279" It occurs since Version 2.6.0 and persists till 2.6.2. In 2.4.2 these files could be opened correctly. I installed Gimp in Vista x64(SP1) and in XP 32(SP3) on different workstations with the same result. Even uninstalling Gimp, deleting the folders, rebooting and reinstalling does not correct the problem.
Hi and thanks for the bug report! Please attach a small PSD that can be used to reproduce the problem.
Created attachment 121940 [details] Sample data Hello, this is the sample to my bug-report.
I can confirm the regression from 2.4.
It bails out here: if (lyr_a[lidx]->num_channels > MAX_CHANNELS) { g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED, _("Too many channels in layer: %d"), lyr_a[lidx]->num_channels); return NULL; } in psd-load.c:542 with lyr_a[lidx]->num_channels = 1279. Obviously a bogus read. It shouldn't be too hard to compare how the 2.4 code behaves with how the 2.6 code behaves and fix this. Setting gnome-love.
*** Bug 561298 has been marked as a duplicate of this bug. ***
We might want to bump of MAX_CHANNELS to fix this. But to me it sounds like 1279 should be enough. So there is likely a different problem here. Dennis, since you wrote this code, you certainly have an idea of what's going wrong here, don't you?
I didn't make much sense of that comment. MAX_CHANNELS was even lower in 2.4, namely 30. The value 1279 is not relevant in any way at all, it's just an arbitrary value read from an arbitrary location in the PSD file. At least that is my current conclusion. To fix this regression someone with enough motivation must simply run the PSD plug-ins of 2.4 and 2.6 in parallel and see how the fread() calls differ.
I got a bit curious about the cause of this bug... The patch makes the .psd of this bug and the duplicated bug load, as well as the last .psd attached to bug 555222. The fix feels safe, especially since the 2.4 plug-in did not do any padding. The fix will be available in GIMP 2.6.3. Commited to trunk (rev 27680) and gimp-2-6. 2008-11-18 Martin Nordholts <martinn@svn.gnome.org> Bug 559239 – Error while loading psd-data * plug-ins/file-psd/psd-layer-res-load.c (load_layer_resource): Layer resource data should not be padded.
For correctness, the 2.4 plug-in has the same channel limitation as 2.6, namely 56, not 30 as I stated earlier.