Skip to content
Snippets Groups Projects
Commit d001eac4 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Merge branch 'patches/bug10094' into 8.0

* patches/bug10094:
  Standards.IIM: Fix alignment of Photoshop 6 block scanner.
parents a02e1ab4 858cd2e1
No related branches found
No related tags found
No related merge requests found
...@@ -144,11 +144,16 @@ protected mapping(string:string|array(string)) decode_photoshop_data(string data ...@@ -144,11 +144,16 @@ protected mapping(string:string|array(string)) decode_photoshop_data(string data
if (block[0]) { if (block[0]) {
// Photoshop 6.0 format with header description text of variable length. // Photoshop 6.0 format with header description text of variable length.
// The description text is padded with NUL so that it together with its
// length field is even.
// The two bytes after the description text is zero padding, then comes // The two bytes after the description text is zero padding, then comes
// the two bytes of data length. // the two bytes of data length.
//
// Cf https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_46269
int dsclen = block[0]; int dsclen = block[0];
//werror("dsclen: %d\n", dsclen); //werror("dsclen: %d\n", dsclen);
block_type_2 = block[1..dsclen]; block_type_2 = block[1..dsclen];
dsclen |= 1; // Skip pascal string NUL-pad.
block_length = short_value(block[dsclen+3..dsclen+4]); block_length = short_value(block[dsclen+3..dsclen+4]);
info = block[5+dsclen..4+dsclen+block_length]; info = block[5+dsclen..4+dsclen+block_length];
} }
...@@ -160,9 +165,11 @@ protected mapping(string:string|array(string)) decode_photoshop_data(string data ...@@ -160,9 +165,11 @@ protected mapping(string:string|array(string)) decode_photoshop_data(string data
} }
#if 0 #if 0
werror("block_length: %O\n" werror("block_type_2: %O\n"
"block_length: %O\n"
"actual length: %O\n" "actual length: %O\n"
"info: %O\n", block_length, sizeof(info), info); "info: %O\n",
block_type_2, block_length, sizeof(info), info);
#endif /* 0 */ #endif /* 0 */
while (sizeof(info)) { while (sizeof(info)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment