Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX: Indicate that Page Medias are loading to prevent "blank effect" when images aren't loaded #779

Closed
maximelebreton opened this issue Sep 17, 2016 · 5 comments
Assignees

Comments

@maximelebreton
Copy link

maximelebreton commented Sep 17, 2016

Because when you have lot of large images, and the cache isn't build, or when you have a slow connection, you can think there is no medias in the page.

Look at this example:

animation

(and an other small thing: the thumbnails ratio is broken)

@rhukster
Copy link
Member

I can appreciate your situation, but those images are HUGE. Having PHP manipulate 12-22mb images is going to make things very slow, not just with this preview but building pages where you are resizing them.

We have moved to an ajax solution to show media, so it doesn't hold the page up, but we'll have to investigate if it's the thumbnailing process or something else that is causing the slowness. I'm not sure it's anything we can fix. Also regarding the aspect-ratio, we'll have to look into this too.

My suggestion to you is to resize those image to something more usable before uploading them. Even images that are 1MB would be plenty large enough for the web, and would speed things up a lot.

@w00fz
Copy link
Member

w00fz commented Sep 17, 2016

i don't think we have any thumbnailing process in admin, the same for the file picker with the new preview, the file field with Ajax upload and other places. In most areas we load the raw images.

That's why the browser is so slow, those huge files are all allocated on the client side memory which causes fatigue.

We had a talk about this before I think we need something to generate admin specific thumbnails. Like media does but internal to admin so we don't interfere with front end. Or some way to intercept the images and return a thumbnail version instead. What do you think?

Also this doesn't mean uploading a 12mb image is ok, 1mb should be enough but if you had 12 of the 1mb it could impact performance.

@maximelebreton
Copy link
Author

I know these images are huge, but unfortunately i can't tell "resize your image before upload them" to some of my clients :)

I think that original file sizes shouldn't be a problem.
On Wordpress, when you upload an image, by default it generates and cache a small, medium and large format, who are reused in the back and front office.
Thereby the original file is used only at the first time, or when you want to regenerates custom sizes, and will not impact performance after the generating phase?

Furthermore, in templates when you use resize(), or cropresize(), you have to set numbers ( example: cropresize(320, 320)), who is not reusable.
And it could be a good practice to have variables like small, medium and large: cropresize('small')

What do you think?

@w00fz
Copy link
Member

w00fz commented Sep 17, 2016

I agree, we need to definitely look into this so that we only ever read smaller converted images, but I also think you should let your clients know they should prefer and try to use smaller images uploaded, if anything, it will help keep their hosting memory low, allowing for more images and it will have less of an impact in the resources of the host.

I know it's much easier to just drag and drop whatever file is laying around for upload and have the platform deal with them but the honest truth is that processing 12mb of image is very resource intensive and quite a waste of resources considering that ultimately the original format most likely will never get used.

A good way to prevent this from happening could be reducing the php.ini upload setting or you could set this even in the admin so that its a more reasonable size. The user will get prompted that the file they are trying to upload is too big.

@w00fz
Copy link
Member

w00fz commented Dec 14, 2018

It is now possible to resize the image upon upload.

@w00fz w00fz closed this as completed Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants