[Suggestion] Image size check #18

Open
opened 2021-10-11 00:00:34 +10:30 by VARYOS · 11 comments
VARYOS commented 2021-10-11 00:00:34 +10:30 (Migrated from github.com)

For people who dont have nitro would be usefull if you can have an option to upload images higher or lower then 8mb.Sometimes i save to many pictures and the bot stops uploading because of a high size image,so if you could check the file size and if is higher then 8 then just skip,kinda option.

For people who dont have nitro would be usefull if you can have an option to upload images higher or lower then 8mb.Sometimes i save to many pictures and the bot stops uploading because of a high size image,so if you could check the file size and if is higher then 8 then just skip,kinda option.
tardisx commented 2021-10-11 01:10:17 +10:30 (Migrated from github.com)

Hi @VARYOS

I think there was a problem with previous versions where it would terminate if it couldn't upload an image (because it was too big or for some other reason). That should no longer happen, it will just skip that one (eventually, after trying a few times).

It is reasonable to resize images larger than 8Mb though.... I'll look into that.

Hi @VARYOS I think there was a problem with previous versions where it would terminate if it couldn't upload an image (because it was too big or for some other reason). That should no longer happen, it will just skip that one (eventually, after trying a few times). It is reasonable to resize images larger than 8Mb though.... I'll look into that.
VARYOS commented 2021-10-11 10:01:33 +10:30 (Migrated from github.com)

Yea,i saw that.I did a test now with 2 pics.First pic. save was the 8mb then the second pic.
Tries to upload the 8mb file 4 times,fails,after last attempt is goes back and tries another 4 times,then goes to upload the second pic(witch goes through) and then goes back to keep trying to upload the high file size the same way, 2x 4times.Then i saved another random pic. pic3 and it got throught and it got back to trying to upload the 8mb one. So..
1.Save first: pic1(8mb),save second: pic2(less then 8mb).
2.Tries to upload pic1 one time with 4 retry,fails.
3.Goes back and tries again on the same file,same as before,one time 4 retrys \ so in total 8 retry with the ones from before.
4.Uploads the lower file,succeed.
5.Goes back to try and upload the high file size,same as before, 2 times 4 retry each.
6.Meanwhile i saved a random pic3(lower then 8mb),it uploads and then goes back trying to upload the 8mb one.
I was thinking if you have more pics higher then 8mb with all the retries to upload the time to upload the small one will get longer,so my thought was just to check the file size and skip it (or if you get the

Bad response from server:413
2021/10/11 02:30:36 Body:{"message": "Request entity too large", "code": 40005}
2021/10/11 02:30:36 Bad response: {"message": "Request entity too large", "code": 40005}
2021/10/11 02:30:36 Will retry in 31 seconds (1 remaining attempts)

Edit: Forgot to say,if you delete the file while the program is in "retry to upload" state it will just close itself after 5sec(more or less)

Yea,i saw that.I did a test now with 2 pics.First pic. save was the 8mb then the second pic. Tries to upload the 8mb file 4 times,fails,after last attempt is goes back and tries another 4 times,then goes to upload the second pic(witch goes through) and then goes back to keep trying to upload the high file size the same way, 2x 4times.Then i saved another random pic. pic3 and it got throught and it got back to trying to upload the 8mb one. So.. 1.Save first: pic1(8mb),save second: pic2(less then 8mb). 2.Tries to upload pic1 one time with 4 retry,fails. 3.Goes back and tries again on the same file,same as before,one time 4 retrys \ so in total 8 retry with the ones from before. 4.Uploads the lower file,succeed. 5.Goes back to try and upload the high file size,same as before, 2 times 4 retry each. 6.Meanwhile i saved a random pic3(lower then 8mb),it uploads and then goes back trying to upload the 8mb one. I was thinking if you have more pics higher then 8mb with all the retries to upload the time to upload the small one will get longer,so my thought was just to check the file size and skip it (or if you get the > Bad response from server:413 2021/10/11 02:30:36 Body:{"message": "Request entity too large", "code": 40005} 2021/10/11 02:30:36 Bad response: {"message": "Request entity too large", "code": 40005} 2021/10/11 02:30:36 Will retry in 31 seconds (1 remaining attempts) Edit: Forgot to say,if you delete the file while the program is in "retry to upload" state it will just close itself after 5sec(more or less)
tardisx commented 2021-10-11 12:02:52 +10:30 (Migrated from github.com)

Thank you! Looks like you’ve found some interesting edge case bugs I need to squash as well as dealing with the 8mb issue.

Thank you! Looks like you’ve found some interesting edge case bugs I need to squash as well as dealing with the 8mb issue.
tardisx commented 2021-10-11 22:57:11 +10:30 (Migrated from github.com)

Hello @VARYOS , I've released v0.11.1 which partially alleviates this problem. Too-large uploads will fail immediately (no retries) and will not be re-added to the queue when other uploads occur. I will leave this issue open, as I would like to include configurable detection of large files, and a choice of ignoring or resizing them.

Hello @VARYOS , I've released v0.11.1 which partially alleviates this problem. Too-large uploads will fail immediately (no retries) and will not be re-added to the queue when other uploads occur. I will leave this issue open, as I would like to include configurable detection of large files, and a choice of ignoring or resizing them.
VARYOS commented 2021-10-12 05:00:12 +10:30 (Migrated from github.com)

Hi,
I found:
1.If you left click anywhere on the console the program stops until you press ENTER(idk if that's intended to work like that)
2.PIC1 to PIC20 high size,PIC21-low size.

PIC1 to PIC20 on que to uploads and fails PIC1 skip and jump to PIC2...etc.
PIC20 fails and tries to upload PIC21-low,goes through
Jumps back to the first PIC1 and resume the que and tries to upload from PIC1 to PIC20,fails and skip each.

New save file in between que file/pictures will be ignored until the que is finish. / if you have a picture when the que is at PIC7 the program will still go through the whole que until PIC20 and then tries to upload the new save file/pic you made ,so if you have a bunch of them in the que will take a while.

Video for exemple.
Note :I used the file date changer so I do not have to keep saving new files for every test.

//Off-topic
3.Support for files .bmp .jpeg if possible.

Hi, I found: 1.If you left click anywhere on the console the program stops until you press ENTER(idk if that's intended to work like that) 2.PIC1 to PIC20 high size,PIC21-low size. > PIC1 to PIC20 on que to uploads and fails PIC1 skip and jump to PIC2...etc. PIC20 fails and tries to upload PIC21-low,goes through Jumps back to the first PIC1 and resume the que and tries to upload from PIC1 to PIC20,fails and skip each. New save file in between que file/pictures will be ignored until the que is finish. / if you have a picture when the que is at PIC7 the program will still go through the whole que until PIC20 and then tries to upload the new save file/pic you made ,so if you have a bunch of them in the que will take a while. [Video for exemple.](https://www.youtube.com/watch?v=ONKWlYnJxf4) Note :I used the file date changer so I do not have to keep saving new files for every test. //Off-topic 3.Support for files .bmp .jpeg if possible.
tardisx commented 2021-10-12 10:30:44 +10:30 (Migrated from github.com)

Thanks for the video. It doesn’t match my experience but I don’t use windows at all - I just cross compile.

I will have to test on a windows machine.

Can you confirm that was with v0.11.1 ?

Thanks for the video. It doesn’t match my experience but I don’t use windows at all - I just cross compile. I will have to test on a windows machine. Can you confirm that was with v0.11.1 ?
tardisx commented 2021-10-12 10:34:46 +10:30 (Migrated from github.com)

The pause-on-click behaviour is caused by the windows terminal going into copy/paste mode - you can see that change in the title bar. It’s an annoying behaviour but I don’t have any control over that.

The pause-on-click behaviour is caused by the windows terminal going into copy/paste mode - you can see that change in the title bar. It’s an annoying behaviour but I don’t have any control over that.
BuyMyMojo commented 2021-10-12 17:42:06 +10:30 (Migrated from github.com)

an idea for images over 8mb (or over the limit of the server):
Use imgur's api and let user supply their own imgur api key
https://api.imgur.com/

an idea for images over 8mb (or over the limit of the server): Use imgur's api and let user supply their own imgur api key https://api.imgur.com/
BuyMyMojo commented 2021-10-12 18:03:53 +10:30 (Migrated from github.com)

I can confirm webhooks can send larger images on boosted servers but with webhooks alone I have no way of testing what file sizes a server supports other then sending a few test images of specific sizes to see if they work

I can confirm webhooks can send larger images on boosted servers but with webhooks alone I have no way of testing what file sizes a server supports other then sending a few test images of specific sizes to see if they work
VARYOS commented 2021-10-13 02:09:55 +10:30 (Migrated from github.com)

Can you confirm that was with v0.11.1 ?

Yea,it was on v0.11.1.

I can confirm webhooks can send larger images on boosted servers but with webhooks alone I have no way of testing what file sizes a server supports other then sending a few test images of specific sizes to see if they work

One of my friend had nitro or boosted server and was able to upload large pics/file size,i sas few of them around 50mb and im pretty sure you can go even larger until 100mb the discord limit ,this option i suggested would be nice for people who do not have the nitro/boosted server.

> Can you confirm that was with v0.11.1 ? Yea,it was on v0.11.1. > I can confirm webhooks can send larger images on boosted servers but with webhooks alone I have no way of testing what file sizes a server supports other then sending a few test images of specific sizes to see if they work One of my friend had nitro or boosted server and was able to upload large pics/file size,i sas few of them around 50mb and im pretty sure you can go even larger until 100mb the discord limit ,this option i suggested would be nice for people who do not have the nitro/boosted server.
tardisx commented 2021-10-19 22:49:32 +10:30 (Migrated from github.com)

I've released v0.11.2 which really fixes the bug where it keeps trying to upload too-large files. Thanks for the report! I will keep this open to track potentially adding a resize option.

I've released v0.11.2 which really fixes the bug where it keeps trying to upload too-large files. Thanks for the report! I will keep this open to track potentially adding a resize option.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: justin/discord-auto-upload#18
No description provided.