Faster (and smaller) uploads in Discourse with Rust, WebAssembly and MozJPEG | Blog

@sam can we address the above before the release please?

5 Likes

From what I can tell @andrei’s change was tightly scoped to the toolbar, increasing the scope so it also catches drag-and-drop and paste would be a bit risky for the release.

Also unsure if we want to do that?

9 Likes

5 posts were split to a new topic: Caret moves to end-of-line when uploading an image via toolbar

I’ll fix it and then we can decide if the fix is dangerous to merge before release.

7 Likes

As I remember and from what I see in the code, it doesn’t matter if an image was added using toolbar or using drag-and-drop. In both cases, this should work.

Also, I tested it and looks like now everything works as expected (it’s hard to tell when exactly this was fixed, but I think it’s not so important). Here are videos for drag-and-drop, but it also works when using toolbar.

In the middle of the line:

At the end of the line:

At the end of the last line:

8 Likes

Oh yeah sorry that’s my fault I didn’t even tested it since the last video I uploaded. :confused: Now it works as expected :slightly_smiling_face: Thank you @andrei to check this.

6 Likes

Saw a Reddit post about a promotional press image for Diablo IV that is 109MB in size and 12000x12000 and wondered if it would be possible to upload it to Discourse, and if so, how long it would take.

Managed to upload it from my phone in just 20 seconds for processing and upload :tada:

It was downscaled to 1920x1920 and 208KB.

9 Likes

Note, on iPhone that image is a consistent crash

7 Likes

Which iPhone? I can open it in browser and locally just fine.




4 Likes

It crashes Safari if you try to upload the 100mb file, somehow the flow triggers an out of memory

6 Likes

Oh that may be the key to the crashing bug @martin been hunting down!

7 Likes

Weird, on my 2017 iPad with 4GB RAM it fails to compress, but it does gracefully as it gets detected and then the original image goes forward in the upload process.

@sam can you try running http://clb.confined.space/dump/mem_growth.html and clicking until you get the max? Does it crash the tab for you? My old iPad goes to 900MB but doesn’t crash.

3 Likes

I did try it but also no crash observed at all… :thinking:

4 Likes

Note… this is now disabled by default pending fixes from Apple

4 Likes

Let me try this and see…

I can download the giant image to my phone but get

Sorry, the image you are trying to upload is too big (maximum size is 4MB), please resize it and try again

When I attempt to upload it

4 Likes

Sadly Apple have too many bugs here, we were forced to disable the feature on iOS due to missing standards and frequent crashes, we have a reminder set to try again in a few months

8 Likes