• tclfpdf

    From Manfred Stelzhammer@21:1/5 to All on Sat Jun 17 21:33:05 2023
    Hello

    I have a Problem with tclfpdf.

    I try to insert a picture.


    % tclfpdf::Image [pwd]/logo.gif 30 30


    The first error:
    "can't read "::env(PROCESSOR_ARCHITECTURE)": no such variable"

    I solved it with: "set ::env(PROCESSOR_ARCHITECTURE) 64"


    The second error:
    "can't read "a": no such variable"

    Who can I solved this problem?


    regards

    manfred

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to All on Sat Jun 17 14:12:45 2023
    On 6/17/2023 2:10 PM, et99 wrote:
    On 6/17/2023 12:33 PM, Manfred Stelzhammer wrote:
    Hello

    I have a Problem with tclfpdf.

    I try to insert a picture.


    % tclfpdf::Image [pwd]/logo.gif 30 30


    The first error:
      "can't read "::env(PROCESSOR_ARCHITECTURE)": no such variable"

    I solved it with: "set ::env(PROCESSOR_ARCHITECTURE) 64"


    The second error:
      "can't read "a": no such variable"

    Who can I solved this problem?


    regards

    manfred



    When I run a 64 bit tcl I see:

    env(PROCESSOR_ARCHITECTURE)          = AMD64

    32 bit:

    env(PROCESSOR_ARCHITECTURE)          = x86

    System wide, it's set to AMD64, not sure how it shows up as X86 when
    running a 32 bit tclkit.



    Forgot to mention, this is on my windows 10 system.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to Manfred Stelzhammer on Sat Jun 17 14:10:36 2023
    On 6/17/2023 12:33 PM, Manfred Stelzhammer wrote:
    Hello

    I have a Problem with tclfpdf.

    I try to insert a picture.


    % tclfpdf::Image [pwd]/logo.gif 30 30


    The first error:
     "can't read "::env(PROCESSOR_ARCHITECTURE)": no such variable"

    I solved it with: "set ::env(PROCESSOR_ARCHITECTURE) 64"


    The second error:
     "can't read "a": no such variable"

    Who can I solved this problem?


    regards

    manfred



    When I run a 64 bit tcl I see:

    env(PROCESSOR_ARCHITECTURE) = AMD64

    32 bit:

    env(PROCESSOR_ARCHITECTURE) = x86

    System wide, it's set to AMD64, not sure how it shows up as X86 when
    running a 32 bit tclkit.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Manfred Stelzhammer@21:1/5 to All on Sun Jun 18 12:20:35 2023
    Hi

    I use kubuntu.

    With .jpeg and .jpg it works.

    But .png and .gif it unfortunately doesn't work.


    Regards

    Manfred




    Am 17.06.23 um 23:12 schrieb et99:
    On 6/17/2023 2:10 PM, et99 wrote:
    On 6/17/2023 12:33 PM, Manfred Stelzhammer wrote:
    Hello

    I have a Problem with tclfpdf.

    I try to insert a picture.


    % tclfpdf::Image [pwd]/logo.gif 30 30


    The first error:
      "can't read "::env(PROCESSOR_ARCHITECTURE)": no such variable"

    I solved it with: "set ::env(PROCESSOR_ARCHITECTURE) 64"


    The second error:
      "can't read "a": no such variable"

    Who can I solved this problem?


    regards

    manfred



    When I run a 64 bit tcl I see:

    env(PROCESSOR_ARCHITECTURE)          = AMD64

    32 bit:

    env(PROCESSOR_ARCHITECTURE)          = x86

    System wide, it's set to AMD64, not sure how it shows up as X86 when
    running a 32 bit tclkit.



    Forgot to mention, this is on my windows 10 system.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to Manfred Stelzhammer on Sun Jun 18 05:00:09 2023
    On 6/18/2023 3:20 AM, Manfred Stelzhammer wrote:
    Hi

    I use kubuntu.

    With .jpeg and .jpg it works.

    But .png and .gif it unfortunately doesn't work.


    Regards

    Manfred




    Am 17.06.23 um 23:12 schrieb et99:
    On 6/17/2023 2:10 PM, et99 wrote:
    On 6/17/2023 12:33 PM, Manfred Stelzhammer wrote:
    Hello

    I have a Problem with tclfpdf.

    I try to insert a picture.


    % tclfpdf::Image [pwd]/logo.gif 30 30


    The first error:
      "can't read "::env(PROCESSOR_ARCHITECTURE)": no such variable"

    I solved it with: "set ::env(PROCESSOR_ARCHITECTURE) 64"


    The second error:
      "can't read "a": no such variable"

    Who can I solved this problem?


    regards

    manfred



    When I run a 64 bit tcl I see:

    env(PROCESSOR_ARCHITECTURE)          = AMD64

    32 bit:

    env(PROCESSOR_ARCHITECTURE)          = x86

    System wide, it's set to AMD64, not sure how it shows up as X86 when
    running a 32 bit tclkit.



    Forgot to mention, this is on my windows 10 system.


    Are you trying to use the file logo.gif in the examples folder?

    That file is interlaced. Try converting it to non-interlaced.
    Check if your .png files are interlaced as well.

    Internally the code converts a .gif to a .png. On my 8.6.9 32 bit tcl/tk
    it creates an interlaced .png and gets an error saying interlaced
    not supported.

    On my 8.6.12 and 8.6.13 64 bit tcl/tk it converts it to a non-interlaced .png and
    it works.

    I don't know if its 32 vs 64 or the version of Tk that makes the difference.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Manfred Stelzhammer@21:1/5 to All on Sun Jun 18 16:32:01 2023
    Hi

    I think, I make a workaround.
    I convert the file to a jpeg, and after the tclfpdf::Image command I
    delete the temporary file.


    proc convert-to-jpeg {file} {
    image create photo _tempimage
    _tempimage read $file
    _tempimage write mytempfile[file tail [file rootname $file]].jpeg
    return mytempfile[file tail [file rootname $file]].jpeg
    }

    set mytempimage [convert-to-jpeg image.gif]

    tclfpdf::Image $mytempimage 30 30
    file delete $mytempimage



    regards

    Manfred

    Am 18.06.23 um 14:00 schrieb et99:
    On 6/18/2023 3:20 AM, Manfred Stelzhammer wrote:
    Hi

    I use kubuntu.

    With .jpeg and .jpg it works.

    But .png and .gif it unfortunately doesn't work.


    Regards

    Manfred




    Am 17.06.23 um 23:12 schrieb et99:
    On 6/17/2023 2:10 PM, et99 wrote:
    On 6/17/2023 12:33 PM, Manfred Stelzhammer wrote:
    Hello

    I have a Problem with tclfpdf.

    I try to insert a picture.


    % tclfpdf::Image [pwd]/logo.gif 30 30


    The first error:
      "can't read "::env(PROCESSOR_ARCHITECTURE)": no such variable"

    I solved it with: "set ::env(PROCESSOR_ARCHITECTURE) 64"


    The second error:
      "can't read "a": no such variable"

    Who can I solved this problem?


    regards

    manfred



    When I run a 64 bit tcl I see:

    env(PROCESSOR_ARCHITECTURE)          = AMD64

    32 bit:

    env(PROCESSOR_ARCHITECTURE)          = x86

    System wide, it's set to AMD64, not sure how it shows up as X86 when
    running a 32 bit tclkit.



    Forgot to mention, this is on my windows 10 system.


    Are you trying to use the file logo.gif in the examples folder?

    That file is interlaced. Try converting it to non-interlaced.
    Check if your .png files are interlaced as well.

    Internally the code converts a .gif to a .png. On my 8.6.9 32 bit tcl/tk
    it creates an interlaced .png and gets an error saying interlaced
    not supported.

    On my 8.6.12 and 8.6.13 64 bit tcl/tk it converts it to a non-interlaced
    .png and
    it works.

    I don't know if its 32 vs 64 or the version of Tk that makes the
    difference.






    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From et99@21:1/5 to Manfred Stelzhammer on Sun Jun 18 12:01:10 2023
    On 6/18/2023 7:32 AM, Manfred Stelzhammer wrote:
    Hi

    I think, I make a workaround.
    I convert the file to a jpeg, and after the tclfpdf::Image command I delete the temporary file.


    proc convert-to-jpeg {file} {
        image create photo _tempimage
        _tempimage read $file
        _tempimage write mytempfile[file tail [file rootname $file]].jpeg
        return mytempfile[file tail [file rootname $file]].jpeg
    }

    set mytempimage [convert-to-jpeg image.gif]

    tclfpdf::Image $mytempimage 30 30
    file delete $mytempimage



    regards

    Manfred

    Am 18.06.23 um 14:00 schrieb et99:
    On 6/18/2023 3:20 AM, Manfred Stelzhammer wrote:
    Hi

    I use kubuntu.

    With .jpeg and .jpg it works.

    But .png and .gif it unfortunately doesn't work.


    Regards

    Manfred




    Am 17.06.23 um 23:12 schrieb et99:
    On 6/17/2023 2:10 PM, et99 wrote:
    On 6/17/2023 12:33 PM, Manfred Stelzhammer wrote:
    Hello

    I have a Problem with tclfpdf.

    I try to insert a picture.


    % tclfpdf::Image [pwd]/logo.gif 30 30


    The first error:
      "can't read "::env(PROCESSOR_ARCHITECTURE)": no such variable" >>>>>>
    I solved it with: "set ::env(PROCESSOR_ARCHITECTURE) 64"


    The second error:
      "can't read "a": no such variable"

    Who can I solved this problem?


    regards

    manfred



    When I run a 64 bit tcl I see:

    env(PROCESSOR_ARCHITECTURE)          = AMD64

    32 bit:

    env(PROCESSOR_ARCHITECTURE)          = x86

    System wide, it's set to AMD64, not sure how it shows up as X86 when >>>>> running a 32 bit tclkit.



    Forgot to mention, this is on my windows 10 system.


    Are you trying to use the file logo.gif in the examples folder?

    That file is interlaced. Try converting it to non-interlaced.
    Check if your .png files are interlaced as well.

    Internally the code converts a .gif to a .png. On my 8.6.9 32 bit tcl/tk
    it creates an interlaced .png and gets an error saying interlaced
    not supported.

    On my 8.6.12 and 8.6.13 64 bit tcl/tk it converts it to a non-interlaced .png and
    it works.

    I don't know if its 32 vs 64 or the version of Tk that makes the difference. >>





    Good idea. Note you have the source code, and here's what they do.
    Maybe submit an issue on github.

    proc ::tclfpdf::_parsegif { file } {
    ;#Note: sometimes there are some problems converting GIF to PNG
    ;# using img. One alternative is use the utility gif2png an then load the file as PNG
    set img "_$file"
    image create photo $img
    ;#first frame in case of animated GIF
    $img read $file -format "gif -index 0"
    set tmp $file.png
    $img write $tmp
    set info [_parsepng $tmp]
    file delete $tmp
    return $info
    }

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Mon Jun 19 13:25:39 2023
    * Manfred Stelzhammer <[email protected]>
    | proc convert-to-jpeg {file} {
    | image create photo _tempimage
    | _tempimage read $file
    | _tempimage write mytempfile[file tail [file rootname $file]].jpeg

    You need to delete the _tempimage here before returning, otherwise you
    have a memory leak - albeit a small one.

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Manfred Stelzhammer@21:1/5 to All on Mon Jun 19 17:12:39 2023
    Thank's

    manfred

    Am 19.06.23 um 13:25 schrieb Ralf Fassel:
    * Manfred Stelzhammer <[email protected]>
    | proc convert-to-jpeg {file} {
    | image create photo _tempimage
    | _tempimage read $file
    | _tempimage write mytempfile[file tail [file rootname $file]].jpeg

    You need to delete the _tempimage here before returning, otherwise you
    have a memory leak - albeit a small one.

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)