Tk Library Source Code

View Ticket
Login
2026-11-15
23:40 • Ticket [3470437fff] Padding on and mask rasters incorrect. status still Open with 3 other changes artifact: 0feb13cc83 user: serhiy.storchaka
23:33
Fix [3470437fff]: wrong padding of the AND mask rows in ico. Each row of the mask is padded to a multiple of 32 bits, but ico padded it with (width % 32) bits, both when writing and when reading, so icons with widths like 8, 20 or 40 had a wrong transparency. Fixed in ico 1.x and ico 0.x. Add ico.test. leaf check-in: d227043609 user: serhiy.storchaka tags: ico-andmask-padding
2012-01-06
20:49 • New ticket [3470437fff] Padding on and mask rasters incorrect.. artifact: a805564383 user: rkroll

Ticket UUID: 3470437
Title: Padding on and mask rasters incorrect.
Type: Bug Version: None
Submitter: rkroll Created on: 2012-01-06 20:49:12
Subsystem: tklib :: ico Assigned To: afaupell
Priority: 5 Medium Severity:
Status: Open Last Modified: 2026-11-15 23:40:01
Resolution: None Closed By:
    Closed on:
Description:
in proc ::ico::getAndMaskFromColors {colors}

Padding calculation might look better like this:

  append l [string repeat 0 [expr {(32 - ([string length $l] % 32))%32}]]
User Comments: serhiy.storchaka added on 2026-11-15 23:40:01:

Proposed fix in branch ico-andmask-padding.

The rows of the AND mask are now padded to a multiple of 32 bits as suggested, both when writing and when reading, in ico 1.x and in the old ico 0.x. The sizes which worked before (16, 24, 32, 48, 64, 256) are not affected, except 24 in ico 0.x, which was wrong too.