Improved Media Library

I suggest an improved media library, because this is a feature of WP which has been strongly neglected in the past. Whenever someone came up with a new proposal, most of it went under, unheard or was post-poned till somewhere in the far-off future.

At least having some option to display files and directories in a classic tree view would be great. Oh, and a slightly more welcoming Media API.

Both features would be very welcome. The former one should sooth newcomers, who are used to having a “regular” overview of their media, while the latter should rush forward plugin development.

Update (2018-12-18)

This petition was posted by Fabian Wolf.

It had 95 votes.

The status was open.

It had the following tags:

  • difficulty-moderate
  • request-modify-feature
  • cp-research-plugin
  • request-add-feature
  • difficulty-hard

Read-only archive: https://petitions.classicpress.net/posts/51/improved-media-library

Comments:

2 Likes

I don’t think there’s any doubt that the media library can be improved but I think we should break it down into manageable chunks. We should agree what the main issues are and create a wishlist.

In the past, I’ve used this plugin - with good results - to replace the standard media library: Justified Image Grid - Premium WordPress Gallery by Firsh | CodeCanyon but I have two go-to plugins that I install on nearly every site: Regenerate Thumbnails – WordPress plugin | WordPress.org and Format Media Titles – WordPress plugin | WordPress.org.

Perhaps we could look at puling out the media library from the core and then tweak it as required. As has already been mentioned, there’s a research repository for this already at GitHub - ClassicPress-research/improved-media-library: ClassicPress EXPERIMENTAL plugin: Media library improvements. if anyone wants to take that on?

2 Likes

This petition had a lot of activity in the early days, but nothing has happened since then. Is this something we still want to tackle at some point?

I agree with this.

At least having some option to display files and directories in a classic tree view would be great

I am not entirely sure what this should be good for.
There is no file hierarchy in the media uploader.
It is not a PHP Directory Manager, it is a Media Manager, and thus there is just files, without “parent” folders.

If this refers to the “date” folders, I rather suggest to make the decision in the begin to not use date folders and even make this not the default (thus: not use date folders as default)
This because it is rather annoying and useless, even disturbing when programming with dynamically generated file urls, for example, when having media in date folders.
It is not developer friendly, it is “manager” friendly, and I am not sure this should be the default.

For me that could be step one of the betterment: make the non-date organised upload directory the default.

Step two could be to check each, and fixe where needed, API for the media management.

Then there are things like medium_size, which should be looked at (and probably removed).

Then there is a lot of (IMO) messy stuff going on in the editor of media in terms of UI.
Just as example, to crop an image, you have to know that first you got to move the mouse on the image to designate a crop area and only then the crop tool will become active and useable. That is horrible UI. After almost 10 years using WP I still every time I crop an image in there kind of get lost.

To save a alt tag, you have to know that it will save when clicking outside the text area. Etc.

I agree with almost all points made here as well Petititon: Improved Media Library but again, those are different things, they likely shouldn’t be part of one big project, rather a step by step thingy (just to make sure we do not force unwanted feature while pushing wanted feature)

So I would personally suggest to proceed with chunked requests, if we need, because this here is seems a “please fix all issues but there are too many issues to list them all” kind of task. That means it will never lead to a result. Developers need “micro” tasks to successfully and quickly make things happen (at least, that is how I see it)
So let’s make microvotes :slight_smile:
Then each can be implemented, even by different contributors.

On the other hand there is GitHub - ClassicPress-research/improved-media-library: ClassicPress EXPERIMENTAL plugin: Media library improvements., maybe we can just open that to let users add “Feature Requests” there?
So we do not have to open (probably hundreds) of Votes?

1 Like

Problem: FTP often chokes on folders containing more than 15,000 files. And with sometimes 12+ thumbnail sizes per image (WooCommerce, undisciplined themes, etc), this limit can easily be reached if you don’t use the dated folders option.

Maybe a different way of splitting uploads into folders would be nicer than dates, but we need some kind of way. One folder for everything is just too problematic.

1 Like

I understand… the main problem I have with folders is this:

often I find myself in need of dynamically generating some links to media (be it download or display).
When you have folder structure that arbitrary changes (such as 12/03/2021/filename.png) then it is impossible to “know” in what folder the file is.

If they are all in a main folder, you know where they are and can construct the path and use a dynamic filename
This is for example the case when you have a lot of pictures of users. Those pictures are all named user_name.png. Now you have a list of users (pulled from DB). You know the usernames, and can thus show the png by username.
IF those png where in a folder, one from last year and one maybe from last month and other from today, you can’t get the right image because its in a folder, which you do not know the path of.
You can, if you have the ID of said image (wp_get_original_image_path() | Function | WordPress Developer Resources), but that is not always the case (almost never, in above scenario)

You can do this wordpress - get the url file by name of image - Stack Overflow, but when you have some Ks of images, that becomes expensive, whereas, if you know the filename, and can “get” that with a static prefix path, it’s quite fast.

I see however the point you make, I did not know that limitation… that’s quite problematic, as I don’t see an easy way to resolve both issues at once. Either you have folders, but then you don’t know to what folder the image was added, or you don’t, and then the server might choke…

Maybe if we allow the admin to create those folders and upload to them, that could solve it, as then we would know the path since it would be a static one (like: user-mugshots/ or product-1-to-1000/ etc)

PS If anyone knows a solution to the above problem I am happy to hear it :smiley:

Maybe that other request to add taxonomies to media can help with this, actually.

One could put the media in whatever folders the system wants, but we still could get the media by specific criteria, and at least narrow the pool down to a few only (like: user-mugshot term), then run a title match against the pool and find the image we need.

That could work, without a lot of changes to the folder structure (could already work now, since you can easily add terms to media, you just need to declare it programmatically at this point)

Not useful if the media is uploaded in the front end thou, but better than nothing…

Many websites are not big enough to have thousands of images in one folder. Majority of regular users don’t even know how to use FTP or that each image they upload generates several versions. I think by default keeping it to one folder would be best, that’s what I do on all websites.

However, there could be some middle ground here. 2 alternate options are:

  1. Limit folders inside uploads folder to years only, no months.

  2. Create a folder for each post type ID as folder name when images are uploaded. Unattached images would stay inside main uploads folder.

I still prefer no folders, but these are just some possible options to think about.

But overall, adding taxonomy for media categorization would be great. Also, improving UI and tools as suggested by @anon66243189

Me too ::smiley: :smiley:
But as @anon95694377 pointed out this will proverbially bite me in the rear :stuck_out_tongue:

It’s not clear to me how this petition would be implemented - there are a lot of different ideas being thrown around.

Maybe this can help get some clarity. Those of you who modify the folder structure used to upload media files: what plugin are you using to do this today? What, if anything, have you seen break as a result of this change?

1 Like

The only thing I do is uncheck the year/month option under Settings > Media. So no plugins and nothing breaks.

However, for more advanced functionality like taxonomy-type folders (not actual directories on the server) I use HappyFiles. It also allows uploading and sanitizing SVGs :wink:

I remember reading in an email developer is doing a complete rewrite in VueJS. Wouldn’t it be nice if the media library used VueJS instead of jQuery? I would call that a definite improvement.

That’s not a reason for giving them defaults that could break their site or seriously inconvenience them in future. ClassicPress needs to be as bomb-proof as possible for regular users, otherwise why use a CMS at all?

2 Likes

I like this idea, but giving both choices. How hard would it be to make that an option in settings? So you could select years/months, years or none.

I find the month thing really annoying because you end up with a bunch of empty folders.

1 Like

Taxonomies of years without months would definitely be an improvement, but a proper ability to set taxonomies would be optimum. I have tried several plugins for this, but I’m yet to find one I really like.

1 Like

Yes, “Improved media library” is way too broad. It needs to be broken into smaller petitions for separate discussions. This should be one on its own…

3 Likes