iseahound / ImagePut

A core library for images in AutoHotkey. Supports AutoHotkey v1 and v2.
https://www.autohotkey.com/boards/viewtopic.php?f=83&t=76633
MIT License
116 stars 24 forks source link

Receiving "invalid UTF-8 payload" from server when sending ImagePutBase64 strings #16

Closed sargearmstrong closed 2 years ago

sargearmstrong commented 2 years ago

Dears,

Appreciate the library, thanks so much!

What, if any, non-UTF8 characters could ImagePutBase64 be generating in the Base64 string? Not sure if this is actually the case but..

I'm using the call below (from ImagePut for v1) and sending the output to a websocket server which works great, albeit the server randomly (and rarely) throws "invalid UTF-8 payload" which I'm struggling to catch/sanitize on the client before sending.

ImagePutBase64({image: [0, 0, A_ScreenWidth, A_ScreenHeight ], scale: ["", 600]}, "jpg", 75)

When able, kindly share whatever you deem helpful. Thank you for your time and effort!

iseahound commented 2 years ago

Can't say for certain what the cause is, it's clearly failing your servers validation code. You'll have to try and figure out what the cause is, ImagePut uses CryptBinaryToString (microsoft's implementation) so that may help.

On Thu, Jun 9, 2022 at 03:04 sargearmstrong @.***> wrote:

Dears,

Appreciate the library, thanks so much!

What, if any, non-UTF8 characters could ImagePutBase64 be generating in the Base64 string? Not sure if this is actually the case but..

I'm using the call below (from ImagePut for v1) and sending the output to a websocket server which works great, albeit the server randomly (and rarely) throws "invalid UTF-8 payload" which I'm struggling to catch/sanitize on the client before sending.

ImagePutBase64({image: [0, 0, A_ScreenWidth, A_ScreenHeight ], scale: ["", 600]}, "jpg", 75)

When able, kindly share whatever you deem helpful. Thank you for your time and effort!

— Reply to this email directly, view it on GitHub https://github.com/iseahound/ImagePut/issues/16, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKTTVBJY37QGJSB5AT6N23VOGJQBANCNFSM5YI65JZA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

sargearmstrong commented 2 years ago

Thank you friend. Seems I jumped the gun - looks like the lack of debounce in my send function was causing packet differentiation issues, sorry.. thank you though.