Knewest / uncompressed-discord-images

Discord's solution to previewing images is awful so by changing 'media.discordapp.net' links to 'cdn.discordapp.com' links, we will no longer have blurry images (especially with JPEG 1, WebP, & other lossy formats).
Boost Software License 1.0
16 stars 3 forks source link

Toggle on and off #17

Open Miyuki-10 opened 6 months ago

Miyuki-10 commented 6 months ago

Hi, i want a toggle the uncompress image on and off, because some big discord server, make my discord lag if i turn this plugin on, or at least make a white list over either which discord server or dm channel it is not turn on off, or some way to prevent it. because once you have a bot spamming tons of images, it will overload discord client, which it cannot handle.

Knewest commented 6 months ago

Hey, I've been aware of this issue for a while, but hadn't had the time to figure out why. I investigated it and it appears to be a Discord issue. I don't know if it serves any purpose or breaks when Uncompressed Images is enabled, but the client adds an invisible overlay, blocking user inputs for an unset amount of time (I assume to let things load, but it persists even after everything has loaded).

I am testing this right now, but you are welcome too by doing this:

  1. Go to your custom CSS.
  2. Apply this CSS:
    .pointerCover_b7f426 {
    z-index: -9999 !important;
    }
  3. Save, and refresh Discord.

If there is no downsides to doing this, I will push it as an update. Thanks for reporting this.

If the client blocking your inputs is not the issue you were experiencing, and you literally mean you are getting performance issues, then this is actually somewhat expected as this plugin removes the optimisation set by Discord for loading images (which was by replacing the image with a low quality thumbnail). I'm aware that there are cases where an image can cause major client instability due to being very large in file size, but these are extremely rare scenarios. Images from bots are usually not very resource intense, but it may be on lower end hardware when a lot are spammed.

Miyuki-10 commented 6 months ago

Hey, I've been aware of this issue for a while, but hadn't had the time to figure out why. I investigated it and it appears to be a Discord issue. I don't know if it serves any purpose or breaks when Uncompressed Images is enabled, but the client adds an invisible overlay, blocking user inputs for an unset amount of time (I assume to let things load, but it persists even after everything has loaded).

I am testing this right now, but you are welcome too by doing this:

  1. Go to your custom CSS.
  2. Apply this CSS:
.pointerCover_b7f426 {
  z-index: -9999 !important;
}
  1. Save, and refresh Discord.

If there is no downsides to doing this, I will push it as an update. Thanks for reporting this.

If the client blocking your inputs is not the issue you were experiencing, and you literally mean you are getting performance issues, then this is actually somewhat expected as this plugin removes the optimisation set by Discord for loading images (which was by replacing the image with a low quality thumbnail). I'm aware that there are cases where an image can cause major client instability due to being very large in file size, but these are extremely rare scenarios. Images from bots are usually not very resource intense, but it may be on lower end hardware when a lot are spammed.

I tested this, idk if this is on me, but it does the same except, whenever i go into an image like open it in bigger preview, i am stuck on that image. so it does the same thing. (I did test them all so i doubt it's the other plugins and themes I have, since it's only when i turn this plugin on it happens), and yeah it makes my discord very slow and laggy.

I also refresh discord many times again to test it.

If you want to test it, join these 2 servers and go into new-skins on the first discord server

server name: ck | cpol | osu text channel: new-skins https://discord.gg/2xTFasuckK

server name: osuck.net text channel: new-skins-feed https://discord.gg/h255CTZpBR

in both servers, it's same owner, there is a bot, spamming a lot of skins, which contains tons of links and images on discord so i have to load a lot which make my discord disable and i am forced to restart and disable the plugin in order to use discord sadly.

Knewest commented 6 months ago

and yeah it makes my discord very slow and laggy.

Could you tell me what your hardware is and if you are using the 64-bit version of Discord? I've only ever had performance instability with extremely high file size images or when Discord would block my inputs (which the CSS snippet I provided completely fixed for me). Although, I have a fairly high end system.

If you want to test it, join these 2 servers and go into new-skins on the first discord server

server name: ck | cpol | osu text channel: new-skins https://discord.gg/

server name: osuck.net text channel: new-skins-feed https://discord.gg/

Could you please send a video recording instead? If you can, also post and example image here.

Miyuki-10 commented 6 months ago

and yeah it makes my discord very slow and laggy.

Could you tell me what your hardware is and if you are using the 64-bit version of Discord? I've only ever had performance instability with extremely high file size images or when Discord would block my inputs (which the CSS snippet I provided completely fixed for me). Although, I have a fairly high end system.

If you want to test it, join these 2 servers and go into new-skins on the first discord server server name: ck | cpol | osu text channel: new-skins https://discord.gg/ server name: osuck.net text channel: new-skins-feed https://discord.gg/

Could you please send a video recording instead? If you can, also post and example image here.

i use 32 bit version, for hardware i have:

Rtx 3070, i5 10600k 64gb ram ddr4 3600 mhz

Idk if specific hardwares you searching for but my computer is an highend computer. so it should not be because of hardware.

Here is the video, i always get stuck when i click on an image, and the rest is just a discord them. but it is specific this server, cuz the bot spam a lot and need to load many images and resources. here is the video, i just get stuck here, not because of hardware, but could be the discord client or some other reasons not sure why, i been using discord without the plugin like disable it is still install on my pc. i just get stuck into there for very long time.

https://github.com/Knewest/uncompressed-discord-images/assets/93956624/c3c006b9-5501-4ac4-ab71-f6e8d38c51be

Miyuki-10 commented 6 months ago

the bots is just for fetch and display like osu! skins but it require resource which the client need to load if i open that server and text channel.

Miyuki-10 commented 6 months ago

it's not my own bot but yeah. let me knnow if you need me to do more, i will gladly be your tester :D

Knewest commented 6 months ago

Here is the video,

I cannot recreate this.

i use 32 bit version,

Switch to the 64-bit version of Discord. Stable: https://discord.com/api/downloads/distributions/app/installers/latest?channel=stable&platform=win&arch=x64 PTB: https://discord.com/api/downloads/distributions/app/installers/latest?channel=ptb&platform=win&arch=x64 Canary: https://discord.com/api/downloads/distributions/app/installers/latest?channel=canary&platform=win&arch=x64 Development: https://discord.com/api/downloads/distributions/app/installers/latest?channel=development&platform=win&arch=x64

Miyuki-10 commented 6 months ago

Here is the video,

I cannot recreate this.

i use 32 bit version,

Switch to the 64-bit version of Discord. Stable: https://discord.com/api/downloads/distributions/app/installers/latest?channel=stable&platform=win&arch=x64 PTB: https://discord.com/api/downloads/distributions/app/installers/latest?channel=ptb&platform=win&arch=x64 Canary: https://discord.com/api/downloads/distributions/app/installers/latest?channel=canary&platform=win&arch=x64 Development: https://discord.com/api/downloads/distributions/app/installers/latest?channel=development&platform=win&arch=x64

Ok I have a question what is the Development version for

Miyuki-10 commented 6 months ago

Here is the video,

I cannot recreate this.

i use 32 bit version,

Switch to the 64-bit version of Discord. Stable: https://discord.com/api/downloads/distributions/app/installers/latest?channel=stable&platform=win&arch=x64 PTB: https://discord.com/api/downloads/distributions/app/installers/latest?channel=ptb&platform=win&arch=x64 Canary: https://discord.com/api/downloads/distributions/app/installers/latest?channel=canary&platform=win&arch=x64 Development: https://discord.com/api/downloads/distributions/app/installers/latest?channel=development&platform=win&arch=x64

Ok I have a question what is the Development version for

so after i install it, it will auto change to 64 bit version, or do i need to uninstall 32 bit first.

Miyuki-10 commented 6 months ago

I uninstall discord and then download 64 bit version now

Miyuki-10 commented 6 months ago

but i still have same issue where i need to restart discord in order to make it work or wait 1 - 2 minute for it to load my input which is esc.

Knewest commented 6 months ago

Ok I have a question what is the Development version for

This isn't relevant.

I uninstall discord and then download 64 bit version now

Yeah, uninstall your current Discord and then install using the 64-bit installer.

Miyuki-10 commented 6 months ago

Ok I have a question what is the Development version for

This isn't relevant.

I uninstall discord and then download 64 bit version now

Yeah, uninstall your current Discord and then install using the 64-bit installer.

i did that already i still have same issues

Knewest commented 6 months ago

i did that already i still have same issues

Have you made sure it isn't happening when the plugin is run by itself with no themes or other plugins?

Miyuki-10 commented 6 months ago

i did that already i still have same issues

Have you made sure it isn't happening when the plugin is run by itself with no themes or other plugins?

i can try that

Miyuki-10 commented 6 months ago

i just tested it's still the same, i still get stuck on that image

Miyuki-10 commented 6 months ago

idk why. if you join the discord server and test yourself, you can make understand. because it's only these 2 discord server.

Jugom commented 6 months ago

Hi, just adding to this issue. for me it's not about the server size, but the channel itself. regular text channels run as usual, but if I open a channel (in any server) that contains a lot of images, for example a news/announcement channel, or a gallery, then discord freezes for a while, which I somewhat guess is to be expected. so more than, or additionally to a toggle it would be nice to have a whitelist/blacklist setting to prevent it to run in certain servers/channels.

and yes. I have the same behavior when I try the plugin by itself as well as mixed with the rest.