Tk Source Code

View Ticket
Login
Ticket UUID: 9daafa27a90966914c236c2ad02d5f1178c3e17e
Title: Doc improvement for Tk "image photo" support
Type: Bug Version: 8.6.4
Submitter: dburns Created on: 2015-04-23 20:15:02
Subsystem: 41. Photo Images Assigned To: dkf
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2016-08-21 23:13:33
Resolution: None Closed By: nobody
    Closed on:
Description:
Current Tk Image photo documentation for "data" and "put" subcommands:

imageName data ?option value(s) ...?
    Returns image <data> in the form of a string.

imageName put <data> ?option value(s) ...?
    Sets pixels in imageName to the data specified in <data>.

As written, one now naturally assumes a "binary string" for <data>.  But Img support dates from before [binary] support, and the string data is actually base64 encoded.  This means that if "-format" option is used, the data are doubly encoded!

Proposed: A documentation change that indicates base64 encoding and reflects the possibility of double encoding and the usefulness of [binary encode/decode base64] in that case.